/** * Finds the field with the given name and descriptor in the given * class or its hierarchy. */ public Field findField(Clazz referencingClass, Clazz clazz, String name, String descriptor) { return (Field)findMember(referencingClass, clazz, name, descriptor, true); }
/** * Returns whether an accessor method is needed to access * the invoked method from the lambda class. */ public boolean needsAccessorMethod() { // We assume unknown classes don't need an accessor method. return referencedInvokedClass != null && new MemberFinder().findMethod(lambdaClass, referencedInvokedClass, invokedMethodName, invokedMethodDesc) == null; }
/** * Finds the field with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Field findField(Clazz clazz, String name, String descriptor) { return findField(null, clazz, name, descriptor); }
/** * Fills out the link to the referenced class member. */ public void visitStringConstant(Clazz clazz, StringConstant stringConstant) { if (referencedClass != null) { String name = stringConstant.getString(clazz); // See if we can find the referenced class member locally, or // somewhere in the hierarchy. Member referencedMember = isDeclared ? isField ? (Member)referencedClass.findField(name, null) : (Member)referencedClass.findMethod(name, null) : (Member)memberFinder.findMember(clazz, referencedClass, name, null, isField); if (referencedMember != null) { stringConstant.referencedMember = referencedMember; stringConstant.referencedClass = isDeclared ? referencedClass : memberFinder.correspondingClass(); } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { String name = programMethod.getName(programClass); // If the method is not already private/static/final/abstract, // and it is not a constructor, // and its class is final, // or it is not being kept and it is not overridden, // then make it final. if ((programMethod.u2accessFlags & (ClassConstants.INTERNAL_ACC_PRIVATE | ClassConstants.INTERNAL_ACC_STATIC | ClassConstants.INTERNAL_ACC_FINAL | ClassConstants.INTERNAL_ACC_ABSTRACT)) == 0 && !name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT) && ((programClass.u2accessFlags & ClassConstants.INTERNAL_ACC_FINAL) != 0 || (!KeepMarker.isKept(programMethod) && (programClass.subClasses == null || !memberFinder.isOverriden(programClass, programMethod))))) { programMethod.u2accessFlags |= ClassConstants.INTERNAL_ACC_FINAL; // Visit the method, if required. if (extraMemberVisitor != null) { extraMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
/** * Finds the method with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Method findMethod(Clazz clazz, String name, String descriptor) { return findMethod(null, clazz, name, descriptor); }
referencedMemberFinder.findMember(referencedClass, memberName, memberDescriptor, referencedClass = referencedMemberFinder.correspondingClass();
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { String name = programMethod.getName(programClass); // If the method is not already private/static/final/abstract, // and it is not a constructor, // and its class is final, // or it is not being kept and it is not overridden, // then make it final. if ((programMethod.u2accessFlags & (ClassConstants.ACC_PRIVATE | ClassConstants.ACC_STATIC | ClassConstants.ACC_FINAL | ClassConstants.ACC_ABSTRACT)) == 0 && !name.equals(ClassConstants.METHOD_NAME_INIT) && ((programClass.u2accessFlags & ClassConstants.ACC_FINAL) != 0 || (!KeepMarker.isKept(programMethod) && (programClass.subClasses == null || !memberFinder.isOverriden(programClass, programMethod))))) { programMethod.u2accessFlags |= ClassConstants.ACC_FINAL; // Visit the method, if required. if (extraMemberVisitor != null) { extraMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
/** * Finds the method with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Method findMethod(Clazz clazz, String name, String descriptor) { return findMethod(null, clazz, name, descriptor); }
referencedMemberFinder.findMember(referencedClass, memberName, memberDescriptor, referencedClass = referencedMemberFinder.correspondingClass();
/** * Finds the field with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Field findField(Clazz referencingClass, Clazz clazz, String name, String descriptor) { return (Field)findMember(referencingClass, clazz, name, descriptor, true); }
/** * Returns whether an accessor method is needed to access * the invoked method from the lambda class. */ public boolean needsAccessorMethod() { // We assume unknown classes don't need an accessor method. return referencedInvokedClass != null && new MemberFinder().findMethod(lambdaClass, referencedInvokedClass, invokedMethodName, invokedMethodDesc) == null; }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { String name = programMethod.getName(programClass); // If the method is not already private/static/final/abstract, // and it is not a constructor, // and its class is final, // or it is not being kept and it is not overridden, // then make it final. if ((programMethod.u2accessFlags & (ClassConstants.ACC_PRIVATE | ClassConstants.ACC_STATIC | ClassConstants.ACC_FINAL | ClassConstants.ACC_ABSTRACT)) == 0 && !name.equals(ClassConstants.METHOD_NAME_INIT) && ((programClass.u2accessFlags & ClassConstants.ACC_FINAL) != 0 || (!KeepMarker.isKept(programMethod) && (programClass.subClasses == null || !memberFinder.isOverriden(programClass, programMethod))))) { programMethod.u2accessFlags |= ClassConstants.ACC_FINAL; // Visit the method, if required. if (extraMemberVisitor != null) { extraMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
/** * Finds the field with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Field findField(Clazz clazz, String name, String descriptor) { return findField(null, clazz, name, descriptor); }
/** * Finds the method with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Method findMethod(Clazz clazz, String name, String descriptor) { return findMethod(null, clazz, name, descriptor); }
referencedMemberFinder.findMember(referencedClass, memberName, memberDescriptor, referencedClass = referencedMemberFinder.correspondingClass();
/** * Finds the method with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Method findMethod(Clazz referencingClass, Clazz clazz, String name, String descriptor) { return (Method)findMember(referencingClass, clazz, name, descriptor, false); }
/** * Returns whether an accessor method is needed to access * the invoked method from the lambda class. */ public boolean needsAccessorMethod() { // We assume unknown classes don't need an accessor method. return referencedInvokedClass != null && new MemberFinder().findMethod(lambdaClass, referencedInvokedClass, invokedMethodName, invokedMethodDesc) == null; }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { String name = programMethod.getName(programClass); // If the method is not already private/static/final/abstract, // and it is not a constructor, // and its class is final, // or it is not being kept and it is not overridden, // then make it final. if ((programMethod.u2accessFlags & (ClassConstants.ACC_PRIVATE | ClassConstants.ACC_STATIC | ClassConstants.ACC_FINAL | ClassConstants.ACC_ABSTRACT)) == 0 && !name.equals(ClassConstants.METHOD_NAME_INIT) && ((programClass.u2accessFlags & ClassConstants.ACC_FINAL) != 0 || (!KeepMarker.isKept(programMethod) && (programClass.subClasses == null || !memberFinder.isOverriden(programClass, programMethod))))) { programMethod.u2accessFlags |= ClassConstants.ACC_FINAL; // Visit the method, if required. if (extraMemberVisitor != null) { extraMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
/** * Finds the field with the given name and descriptor in the given * class or its hierarchy. The name and descriptor may contain wildcards. */ public Field findField(Clazz clazz, String name, String descriptor) { return findField(null, clazz, name, descriptor); }