/** * Returns whether the two given classes have fields with the same * names and descriptors. */ private boolean haveAnyIdenticalFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the with the same name and descriptor in // the target class. clazz.fieldsAccept(new SimilarMemberVisitor(targetClass, true, false, false, false, counter)); return counter.getCount() > 0; }
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { Clazz targetClass = targetClass(libraryClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedMethodVisitor(libraryMethod.getName(libraryClass), libraryMethod.getDescriptor(libraryClass), memberVisitor)); }
/** * Returns whether the two given classes have fields with the same * names and descriptors. */ private boolean haveAnyIdenticalFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the with the same name and descriptor in // the target class. clazz.fieldsAccept(new SimilarMemberVisitor(targetClass, true, false, false, false, counter)); return counter.getCount() > 0; }
public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField) { Clazz targetClass = targetClass(libraryClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedFieldVisitor(libraryField.getName(libraryClass), libraryField.getDescriptor(libraryClass), memberVisitor)); }
/** * Returns whether the two given classes have fields with the same * names and descriptors. */ private boolean haveAnyIdenticalFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the with the same name and descriptor in // the target class. clazz.fieldsAccept(new SimilarMemberVisitor(targetClass, true, false, false, false, counter)); return counter.getCount() > 0; }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { Clazz targetClass = targetClass(programClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedFieldVisitor(programField.getName(programClass), programField.getDescriptor(programClass), memberVisitor)); }
/** * Returns whether the given class or its subclasses shadow any fields in * the given target class. */ private boolean shadowsAnyFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the ones that are shadowing non-private // fields in the class hierarchy of the target class. clazz.hierarchyAccept(true, false, false, true, new AllFieldVisitor( new SimilarMemberVisitor(targetClass, true, true, true, false, new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, counter)))); return counter.getCount() > 0; }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { Clazz targetClass = targetClass(programClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedFieldVisitor(programField.getName(programClass), programField.getDescriptor(programClass), memberVisitor)); }
/** * Returns whether the two given classes have class members with the same * name and descriptor. */ private boolean haveAnyIdenticalMethods(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all non-abstract methods, counting the ones that are also // present in the target class. clazz.methodsAccept(new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, new SimilarMemberVisitor(targetClass, true, false, false, false, new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, counter)))); return counter.getCount() > 0; }
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { Clazz targetClass = targetClass(libraryClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedMethodVisitor(libraryMethod.getName(libraryClass), libraryMethod.getDescriptor(libraryClass), memberVisitor)); }
/** * Returns whether the two given classes have class members with the same * name and descriptor. */ private boolean haveAnyIdenticalMethods(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all non-abstract methods, counting the ones that are also // present in the target class. clazz.methodsAccept(new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, new SimilarMemberVisitor(targetClass, true, false, false, false, new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, counter)))); return counter.getCount() > 0; }
public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField) { Clazz targetClass = targetClass(libraryClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedFieldVisitor(libraryField.getName(libraryClass), libraryField.getDescriptor(libraryClass), memberVisitor)); }
/** * Returns whether the two given classes have class members with the same * name and descriptor. */ private boolean haveAnyIdenticalMethods(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all non-abstract methods, counting the ones that are also // present in the target class. clazz.methodsAccept(new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, new SimilarMemberVisitor(targetClass, true, false, false, false, new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, counter)))); return counter.getCount() > 0; }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { Clazz targetClass = targetClass(programClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedMethodVisitor(programMethod.getName(programClass), programMethod.getDescriptor(programClass), memberVisitor)); }
/** * Returns whether the given class or its subclasses shadow any fields in * the given target class. */ private boolean shadowsAnyFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the ones that are shadowing non-private // fields in the class hierarchy of the target class. clazz.hierarchyAccept(true, false, false, true, new AllFieldVisitor( new SimilarMemberVisitor(targetClass, true, true, true, false, new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, counter)))); return counter.getCount() > 0; }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { Clazz targetClass = targetClass(programClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedMethodVisitor(programMethod.getName(programClass), programMethod.getDescriptor(programClass), memberVisitor)); }
/** * Returns whether the given class or its subclasses shadow any fields in * the given target class. */ private boolean shadowsAnyFields(Clazz clazz, Clazz targetClass) { MemberCounter counter = new MemberCounter(); // Visit all fields, counting the ones that are shadowing non-private // fields in the class hierarchy of the target class. clazz.hierarchyAccept(true, false, false, true, new AllFieldVisitor( new SimilarMemberVisitor(targetClass, true, true, true, false, new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, counter)))); return counter.getCount() > 0; }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { Clazz targetClass = targetClass(programClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedFieldVisitor(programField.getName(programClass), programField.getDescriptor(programClass), memberVisitor)); }
/** * Returns whether the given class overrides any methods in the given * target class. */ private boolean overridesAnyMethods(Clazz clazz, ProgramClass targetClass) { // It's ok if the target class is never instantiated and does // not have any subclasses except for maybe the source class. if (!InstantiationClassMarker.isInstantiated(targetClass) && (targetClass.subClasses == null || isOnlySubClass(clazz, targetClass))) { return false; } MemberCounter counter = new MemberCounter(); // Visit all non-abstract methods, counting the ones that are // overriding methods in the class hierarchy of the target class. clazz.methodsAccept(new MemberAccessFilter(0, ClassConstants.ACC_ABSTRACT, new InitializerMethodFilter(null, new SimilarMemberVisitor(targetClass, true, true, false, false, new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE | ClassConstants.ACC_STATIC | ClassConstants.ACC_ABSTRACT, counter))))); return counter.getCount() > 0; }
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { Clazz targetClass = targetClass(libraryClass); targetClass.hierarchyAccept(visitThisMember, visitSuperMembers, visitInterfaceMembers, visitOverridingMembers, new NamedMethodVisitor(libraryMethod.getName(libraryClass), libraryMethod.getDescriptor(libraryClass), memberVisitor)); }