/** * 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; }
/** * 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 visitAnyClass(Clazz clazz) { // Check the class itself. if ((clazz.getAccessFlags() & ClassConstants.ACC_PUBLIC) == 0) { setPackageVisibleMembers(clazz); } else { // Check the members. clazz.fieldsAccept(this); clazz.methodsAccept(this); } }
/** * 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 visitAnyClass(Clazz clazz) { // Check the class itself. if ((clazz.getAccessFlags() & ClassConstants.ACC_PUBLIC) == 0) { setPackageVisibleMembers(clazz); } else { // Check the members. clazz.fieldsAccept(this); clazz.methodsAccept(this); } }
public void visitAnyClass(Clazz clazz) { // Check the class itself. if ((clazz.getAccessFlags() & ClassConstants.ACC_PUBLIC) == 0) { setPackageVisibleMembers(clazz); } else { // Check the members. clazz.fieldsAccept(this); clazz.methodsAccept(this); } }
/** * Returns whether the given class would introduce any unwanted fields * in the target class. */ private boolean introducesUnwantedFields(Clazz programClass, 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(programClass, targetClass))) { return false; } MemberCounter counter = new MemberCounter(); // Count all non-static fields in the the source class. programClass.fieldsAccept(new MemberAccessFilter(0, ClassConstants.ACC_STATIC, counter)); return counter.getCount() > 0; }
/** * Returns whether the given class would introduce any unwanted fields * in the target class. */ private boolean introducesUnwantedFields(Clazz programClass, 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(programClass, targetClass))) { return false; } MemberCounter counter = new MemberCounter(); // Count all non-static fields in the the source class. programClass.fieldsAccept(new MemberAccessFilter(0, ClassConstants.ACC_STATIC, counter)); return counter.getCount() > 0; }
/** * Returns whether the given class would introduce any unwanted fields * in the target class. */ private boolean introducesUnwantedFields(Clazz programClass, 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(programClass, targetClass))) { return false; } MemberCounter counter = new MemberCounter(); // Count all non-static fields in the the source class. programClass.fieldsAccept(new MemberAccessFilter(0, ClassConstants.ACC_STATIC, counter)); return counter.getCount() > 0; }