public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // Remember whether the method is an initializer. isInitializer = methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // Remember whether the method is an initializer. isInitializer = methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // Remember whether the method is an initializer. isInitializer = methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { isInitializer = methodrefConstant.getName(clazz).equals(ClassConstants.INTERNAL_METHOD_NAME_INIT); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { if (methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT)) { // Is the constant referring to a wrapper class? methodrefConstant.referencedClassAccept(this); } }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { if (methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT)) { // Is the constant referring to a wrapper class? methodrefConstant.referencedClassAccept(this); } }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { if (methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT)) { // Is the constant referring to a wrapper class? methodrefConstant.referencedClassAccept(this); } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { if (DEBUG) { System.out.println("WrapperClassUseSimplifier: "+clazz.getName()+"."+method.getName(clazz)+method.getDescriptor(clazz)); } int codeLength = codeAttribute.u4codeLength; // Reset the code changes. codeAttributeEditor.reset(codeLength); // Edit the instructions. codeAttribute.instructionsAccept(clazz, method, this); // Apply all accumulated changes to the code. codeAttributeEditor.visitCodeAttribute(clazz, method, codeAttribute); }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { if (DEBUG) { System.out.println("WrapperClassUseSimplifier: "+clazz.getName()+"."+method.getName(clazz)+method.getDescriptor(clazz)); } int codeLength = codeAttribute.u4codeLength; // Reset the code changes. codeAttributeEditor.reset(codeLength); // Edit the instructions. codeAttribute.instructionsAccept(clazz, method, this); // Apply all accumulated changes to the code. codeAttributeEditor.visitCodeAttribute(clazz, method, codeAttribute); }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { if (DEBUG) { System.out.println("WrapperClassUseSimplifier: "+clazz.getName()+"."+method.getName(clazz)+method.getDescriptor(clazz)); } int codeLength = codeAttribute.u4codeLength; // Reset the code changes. codeAttributeEditor.reset(codeLength); // Edit the instructions. codeAttribute.instructionsAccept(clazz, method, this); // Apply all accumulated changes to the code. codeAttributeEditor.visitCodeAttribute(clazz, method, codeAttribute); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // First add the referenced class constant, with its own referenced class. clazz.constantPoolEntryAccept(methodrefConstant.u2classIndex, this); // Then add the actual method reference constant, with its referenced // class and class member. constantIndex = constantPoolEditor.addMethodrefConstant(constantIndex, methodrefConstant.getName(clazz), methodrefConstant.getType(clazz), methodrefConstant.referencedClass, methodrefConstant.referencedMember); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // First add the referenced class constant, with its own referenced class. clazz.constantPoolEntryAccept(methodrefConstant.u2classIndex, this); // Then add the actual method reference constant, with its referenced // class and class member. constantIndex = constantPoolEditor.addMethodrefConstant(constantIndex, methodrefConstant.getName(clazz), methodrefConstant.getType(clazz), methodrefConstant.referencedClass, methodrefConstant.referencedMember); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // First add the referenced class constant, with its own referenced class. clazz.constantPoolEntryAccept(methodrefConstant.u2classIndex, this); // Then add the actual method reference constant, with its referenced // class and class member. constantIndex = constantPoolEditor.addMethodrefConstant(constantIndex, methodrefConstant.getName(clazz), methodrefConstant.getType(clazz), methodrefConstant.referencedClass, methodrefConstant.referencedMember); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { // First add the referenced class constant, with its own referenced class. clazz.constantPoolEntryAccept(methodrefConstant.u2classIndex, this); // Then add the actual method reference constant, with its referenced // class and class member. constantIndex = constantPoolEditor.addMethodrefConstant(constantIndex, methodrefConstant.getName(clazz), methodrefConstant.getType(clazz), methodrefConstant.referencedClass, methodrefConstant.referencedMember); }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { String className = methodrefConstant.getClassName(clazz); if (className.equals(ClassConstants.NAME_JAVA_LANG_CLASS) || className.equals(ClassConstants.NAME_JAVA_LANG_REFLECT_FIELD) || className.equals(ClassConstants.NAME_JAVA_LANG_REFLECT_METHOD)) { String methodName = methodrefConstant.getName(clazz); if (methodName.startsWith(ClassConstants.METHOD_NAME_GET_TYPE_PREFIX) || methodName.startsWith(ClassConstants.METHOD_NAME_GET_GENERIC_PREFIX)) { notePrinter.print(clazz.getName(), "Note: " + ClassUtil.externalClassName(clazz.getName()) + " calls '" + ClassUtil.externalShortClassName(ClassUtil.externalClassName(className)) + "." + methodName + "'"); } } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { String className = methodrefConstant.getClassName(clazz); if (className.equals(ClassConstants.NAME_JAVA_LANG_CLASS)) { String methodName = methodrefConstant.getName(clazz); if (methodName.equals(ClassConstants.METHOD_NAME_CLASS_GET_ENCLOSING_CLASS) || methodName.equals(ClassConstants.METHOD_NAME_CLASS_GET_DECLARING_CLASS)) { notePrinter.print(clazz.getName(), "Note: " + ClassUtil.externalClassName(clazz.getName()) + " calls '" + ClassUtil.externalShortClassName(ClassUtil.externalClassName(className)) + "." + methodName + "'"); } } } }
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) { String className = methodrefConstant.getClassName(clazz); if (className.equals(ClassConstants.NAME_JAVA_LANG_CLASS)) { String methodName = methodrefConstant.getName(clazz); if (methodName.equals(ClassConstants.METHOD_NAME_CLASS_GET_ENCLOSING_CONSTRUCTOR) || methodName.equals(ClassConstants.METHOD_NAME_CLASS_GET_ENCLOSING_METHOD)) { notePrinter.print(clazz.getName(), "Note: " + ClassUtil.externalClassName(clazz.getName()) + " calls '" + ClassUtil.externalShortClassName(ClassUtil.externalClassName(className)) + "." + methodName + "'"); } } } }