/** * Finds the index of the element value with the given name in the given * array of element values. */ private int findElementValue(int elementValuesCount, ElementValue[] elementValues, String elementValueName) { for (int index = 0; index < elementValuesCount; index++) { if (elementValues[index].getMethodName(targetClass).equals(elementValueName)) { return index; } } return -1; } }
/** * Finds the index of the element value with the given name in the given * array of element values. */ private int findElementValue(int elementValuesCount, ElementValue[] elementValues, String elementValueName) { for (int index = 0; index < elementValuesCount; index++) { if (elementValues[index].getMethodName(targetClass).equals(elementValueName)) { return index; } } return -1; } }
/** * Finds the index of the element value with the given name in the given * array of element values. */ private int findElementValue(int elementValuesCount, ElementValue[] elementValues, String elementValueName) { for (int index = 0; index < elementValuesCount; index++) { if (elementValues[index].getMethodName(targetClass).equals(elementValueName)) { return index; } } return -1; } }
/** * Finds the index of the element value with the given name in the given * array of element values. */ private int findElementValue(int elementValuesCount, ElementValue[] elementValues, String elementValueName) { for (int index = 0; index < elementValuesCount; index++) { if (elementValues[index].getMethodName(targetClass).equals(elementValueName)) { return index; } } return -1; } }
/** * Initializes the referenced method of an element value, if any. */ private void initializeElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // See if we have a referenced class. if (annotation != null && annotation.referencedClasses != null && elementValue.u2elementNameIndex != 0) { // See if we can find the method in the referenced class // (ignoring the descriptor). String name = elementValue.getMethodName(clazz); Clazz referencedClass = annotation.referencedClasses[0]; elementValue.referencedClass = referencedClass; elementValue.referencedMethod = referencedClass.findMethod(name, null); } }
/** * Tries put the given element value in place of an existing element value * of the same name, returning whether it was present. */ private boolean replaceElementValue(int elementValuesCount, ElementValue[] elementValues, ElementValue elementValue) { // Find the element value with the same name. int index = findElementValue(elementValuesCount, elementValues, elementValue.getMethodName(targetClass)); if (index < 0) { return false; } elementValues[index] = elementValue; return true; }
/** * Initializes the referenced method of an element value, if any. */ private void initializeElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // See if we have a referenced class. if (annotation != null && annotation.referencedClasses != null && elementValue.u2elementNameIndex != 0) { // See if we can find the method in the referenced class // (ignoring the descriptor). String name = elementValue.getMethodName(clazz); Clazz referencedClass = annotation.referencedClasses[0]; elementValue.referencedClass = referencedClass; elementValue.referencedMethod = referencedClass.findMethod(name, null); } }
/** * Initializes the referenced method of an element value, if any. */ private void initializeElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // See if we have a referenced class. if (annotation != null && annotation.referencedClasses != null && elementValue.u2elementNameIndex != 0) { // See if we can find the method in the referenced class // (ignoring the descriptor). String name = elementValue.getMethodName(clazz); Clazz referencedClass = annotation.referencedClasses[0]; elementValue.referencedClass = referencedClass; elementValue.referencedMethod = referencedClass.findMethod(name, null); } }
/** * Tries put the given element value in place of an existing element value * of the same name, returning whether it was present. */ private boolean replaceElementValue(int elementValuesCount, ElementValue[] elementValues, ElementValue elementValue) { // Find the element value with the same name. int index = findElementValue(elementValuesCount, elementValues, elementValue.getMethodName(targetClass)); if (index < 0) { return false; } elementValues[index] = elementValue; return true; }
/** * Tries put the given element value in place of an existing element value * of the same name, returning whether it was present. */ private boolean replaceElementValue(int elementValuesCount, ElementValue[] elementValues, ElementValue elementValue) { // Find the element value with the same name. int index = findElementValue(elementValuesCount, elementValues, elementValue.getMethodName(targetClass)); if (index < 0) { return false; } elementValues[index] = elementValue; return true; }
/** * Tries put the given element value in place of an existing element value * of the same name, returning whether it was present. */ private boolean replaceElementValue(int elementValuesCount, ElementValue[] elementValues, ElementValue elementValue) { // Find the element value with the same name. int index = findElementValue(elementValuesCount, elementValues, elementValue.getMethodName(targetClass)); if (index < 0) { return false; } elementValues[index] = elementValue; return true; }
public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { Clazz referencedClass = elementValue.referencedClass; Clazz newReferencedClass = updateReferencedClass(referencedClass); if (referencedClass != newReferencedClass) { // Change the referenced annotation class. elementValue.referencedClass = newReferencedClass; // Change the referenced method. elementValue.referencedMethod = (Method)updateReferencedMember(elementValue.referencedMethod, elementValue.getMethodName(clazz), null, newReferencedClass); } }
public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { Clazz referencedClass = elementValue.referencedClass; Clazz newReferencedClass = updateReferencedClass(referencedClass); if (referencedClass != newReferencedClass) { // Change the referenced annotation class. elementValue.referencedClass = newReferencedClass; // Change the referenced method. elementValue.referencedMethod = (Method)updateReferencedMember(elementValue.referencedMethod, elementValue.getMethodName(clazz), null, newReferencedClass); } }
public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { Clazz referencedClass = elementValue.referencedClass; Clazz newReferencedClass = updateReferencedClass(referencedClass); if (referencedClass != newReferencedClass) { // Change the referenced annotation class. elementValue.referencedClass = newReferencedClass; // Change the referenced method. elementValue.referencedMethod = (Method)updateReferencedMember(elementValue.referencedMethod, elementValue.getMethodName(clazz), null, newReferencedClass); } }
public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { Clazz referencedClass = elementValue.referencedClass; Clazz newReferencedClass = updateReferencedClass(referencedClass); if (referencedClass != newReferencedClass) { // Change the referenced annotation class. elementValue.referencedClass = newReferencedClass; // Change the referenced method. elementValue.referencedMethod = (Method)updateReferencedMember(elementValue.referencedMethod, elementValue.getMethodName(clazz), null, newReferencedClass); } }
/** * Fixes the method reference of the element value, if any. */ private void fixElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // Do we know the referenced method? Member referencedMember = elementValue.referencedMethod; if (referencedMember != null) { // Does it have a new name or type? String methodName = elementValue.getMethodName(clazz); String newMethodName = referencedMember.getName(elementValue.referencedClass); if (!methodName.equals(newMethodName)) { // Update the element name index. elementValue.u2elementNameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newMethodName); } } }
/** * Fixes the method reference of the element value, if any. */ private void fixElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // Do we know the referenced method? Member referencedMember = elementValue.referencedMethod; if (referencedMember != null) { // Does it have a new name or type? String methodName = elementValue.getMethodName(clazz); String newMethodName = referencedMember.getName(elementValue.referencedClass); if (!methodName.equals(newMethodName)) { // Update the element name index. elementValue.u2elementNameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newMethodName); } } }
/** * Fixes the method reference of the element value, if any. */ private void fixElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // Do we know the referenced method? Member referencedMember = elementValue.referencedMethod; if (referencedMember != null) { // Does it have a new name or type? String methodName = elementValue.getMethodName(clazz); String newMethodName = referencedMember.getName(elementValue.referencedClass); if (!methodName.equals(newMethodName)) { // Update the element name index. elementValue.u2elementNameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newMethodName); } } }
/** * Fixes the method reference of the element value, if any. */ private void fixElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) { // Do we know the referenced method? Member referencedMember = elementValue.referencedMethod; if (referencedMember != null) { // Does it have a new name or type? String methodName = elementValue.getMethodName(clazz); String newMethodName = referencedMember.getName(elementValue.referencedClass); if (!methodName.equals(newMethodName)) { // Update the element name index. elementValue.u2elementNameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newMethodName); } } }