/** * Returns the set of superclasses that are caught as exceptions. */ private Set caughtSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses, collecting the ones that are caught. clazz.hierarchyAccept(true, true, false, false, new CaughtClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // static initializers. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are used in * 'instanceof' tests. */ private Set instanceofedSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that are // used in an 'instanceof' test. clazz.hierarchyAccept(true, true, true, false, new InstanceofClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // static initializers. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are used in * 'instanceof' tests. */ private Set instanceofedSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that are // used in an 'instanceof' test. clazz.hierarchyAccept(true, true, true, false, new InstanceofClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // static initializers. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are used in * 'instanceof' tests. */ private Set instanceofedSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that are // used in an 'instanceof' test. clazz.hierarchyAccept(true, true, true, false, new InstanceofClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private static Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // side effects when they are initialized. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; } }
/** * Returns the set of superclasses and interfaces that are initialized. */ private static Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // side effects when they are initialized. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; } }
/** * Returns the set of superclasses and interfaces that are used in * 'instanceof' tests. */ private Set instanceofedSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that are // used in an 'instanceof' test. clazz.hierarchyAccept(true, true, true, false, new InstanceofClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private static Set sideEffectSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // side effects when they are initialized. clazz.hierarchyAccept(true, true, true, false, new SideEffectClassFilter( new ClassCollector(set))); return set; } }
/** * Returns the set of interface subclasses, not including the given class. */ private Set subInterfaces(Clazz clazz, Clazz exceptClass) { Set set = new HashSet(); // Visit all subclasses, collecting the interface classes. clazz.hierarchyAccept(false, false, false, true, new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ExceptClassesFilter(new Clazz[] { exceptClass }, new ClassCollector(set)))); return set; }
/** * Returns the set of interface subclasses, not including the given class. */ private Set subInterfaces(Clazz clazz, Clazz exceptClass) { Set set = new HashSet(); // Visit all subclasses, collecting the interface classes. clazz.hierarchyAccept(false, false, false, true, new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ExceptClassesFilter(new Clazz[] { exceptClass }, new ClassCollector(set)))); return set; }
/** * Returns the set of interface subclasses, not including the given class. */ private Set subInterfaces(Clazz clazz, Clazz exceptClass) { Set set = new HashSet(); // Visit all subclasses, collecting the interface classes. clazz.hierarchyAccept(false, false, false, true, new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ExceptClassesFilter(new Clazz[] { exceptClass }, new ClassCollector(set)))); return set; }
/** * Returns the set of superclasses and interfaces that are initialized. */ private Set initializedSuperClasses(Clazz clazz) { Set set = new HashSet(); // Visit all superclasses and interfaces, collecting the ones that have // static initializers. clazz.hierarchyAccept(true, true, true, false, new NamedMethodVisitor(ClassConstants.INTERNAL_METHOD_NAME_CLINIT, ClassConstants.INTERNAL_METHOD_TYPE_INIT, new MemberToClassVisitor( new ClassCollector(set)))); return set; }
/** * Returns the set of superclasses that are caught as exceptions. */ private Set caughtSuperClasses(Clazz clazz) { // Don't bother if this isn't an exception at all. if (!clazz.extends_(ClassConstants.NAME_JAVA_LANG_THROWABLE)) { return Collections.EMPTY_SET; } // Visit all superclasses, collecting the ones that are caught // (plus java.lang.Object, in the current implementation). Set set = new HashSet(); clazz.hierarchyAccept(true, true, false, false, new CaughtClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of superclasses that are caught as exceptions. */ private Set caughtSuperClasses(Clazz clazz) { // Don't bother if this isn't an exception at all. if (!clazz.extends_(ClassConstants.NAME_JAVA_LANG_THROWABLE)) { return Collections.EMPTY_SET; } // Visit all superclasses, collecting the ones that are caught // (plus java.lang.Object, in the current implementation). Set set = new HashSet(); clazz.hierarchyAccept(true, true, false, false, new CaughtClassFilter( new ClassCollector(set))); return set; }
/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Returns the set of superclasses that are caught as exceptions. */ private Set caughtSuperClasses(Clazz clazz) { // Don't bother if this isn't an exception at all. if (!clazz.extends_(ClassConstants.NAME_JAVA_LANG_THROWABLE)) { return Collections.EMPTY_SET; } // Visit all superclasses, collecting the ones that are caught // (plus java.lang.Object, in the current implementation). Set set = new HashSet(); clazz.hierarchyAccept(true, true, false, false, new CaughtClassFilter( new ClassCollector(set))); return set; }