| java.lang.Object edu.umd.cs.findbugs.ba.ch.Subtypes2
Subtypes2 | public class Subtypes2 (Code) | | Class for performing class hierarchy queries.
Does not require JavaClass objects to be in memory.
Instead, uses XClass objects.
author: David Hovemeyer |
Constructor Summary | |
public | Subtypes2() Constructor. |
Method Summary | |
public void | addApplicationClass(XClass appXClass) Add an application class, and its transitive supertypes, to the inheritance graph. | public void | addClass(XClass xclass) Add a class or interface, and its transitive supertypes, to the inheritance graph. | public Set<ClassDescriptor> | getDirectSubtypes(ClassDescriptor classDescriptor) Get known subtypes of given class. | public ReferenceType | getFirstCommonSuperclass(ReferenceType a, ReferenceType b) Get the first common superclass of the given reference types.
Note that an interface type is never returned unless a and b are the
same type. | public ObjectType | getFirstCommonSuperclass(ObjectType a, ObjectType b) Get the first common superclass of the given object types.
Note that an interface type is never returned unless a and b are the
same type. | public InheritanceGraph | getGraph() | public Set<ClassDescriptor> | getSubtypes(ClassDescriptor classDescriptor) Get known subtypes of given class. | public SupertypeQueryResults | getSupertypeQueryResults(ClassDescriptor classDescriptor) Look up or compute the SupertypeQueryResults for class
named by given ClassDescriptor. | public Set<ClassDescriptor> | getTransitiveCommonSubtypes(ClassDescriptor classDescriptor1, ClassDescriptor classDescriptor2) | public Collection<XClass> | getXClassCollection() Get Collection of all XClass objects (resolved classes)
seen so far. | public static boolean | instanceOf(String dottedSubtype, String dottedSupertype) | public static boolean | instanceOf(JavaClass subtype, String dottedSupertype) | public boolean | isApplicationClass(ClassDescriptor descriptor) | public boolean | isSubtype(ReferenceType type, ReferenceType possibleSupertype) Determine whether or not a given ReferenceType is a subtype of another. | public boolean | isSubtype(ClassDescriptor subDesc, ClassDescriptor superDesc) | public boolean | isSubtype(ObjectType type, ObjectType possibleSupertype) Determine whether or not a given ObjectType is a subtype of another. | public void | traverseSupertypes(ClassDescriptor start, InheritanceGraphVisitor visitor) Starting at the class or interface named by the given ClassDescriptor,
traverse the inheritance graph, exploring all paths from
the class or interface to java.lang.Object. |
DEBUG | final public static boolean DEBUG(Code) | | |
DEBUG_QUERIES | final public static boolean DEBUG_QUERIES(Code) | | |
ENABLE_SUBTYPES2 | final public static boolean ENABLE_SUBTYPES2(Code) | | |
ENABLE_SUBTYPES2_FOR_COMMON_SUPERCLASS_QUERIES | final public static boolean ENABLE_SUBTYPES2_FOR_COMMON_SUPERCLASS_QUERIES(Code) | | |
Subtypes2 | public Subtypes2()(Code) | | Constructor.
|
addApplicationClass | public void addApplicationClass(XClass appXClass)(Code) | | Add an application class, and its transitive supertypes, to the inheritance graph.
Parameters: appXClass - application XClass to add to the inheritance graph |
addClass | public void addClass(XClass xclass)(Code) | | Add a class or interface, and its transitive supertypes, to the inheritance graph.
Parameters: xclass - XClass to add to the inheritance graph |
getFirstCommonSuperclass | public ReferenceType getFirstCommonSuperclass(ReferenceType a, ReferenceType b) throws ClassNotFoundException(Code) | | Get the first common superclass of the given reference types.
Note that an interface type is never returned unless a and b are the
same type. Otherwise, we try to return as accurate a type as possible.
This method is used as the meet operator in TypeDataflowAnalysis,
and is intended to follow (more or less) the JVM bytecode verifier
semantics.
This method should be used in preference to the getFirstCommonSuperclass()
method in
ReferenceType .
Parameters: a - a ReferenceType Parameters: b - another ReferenceType the first common superclass of a and b throws: ClassNotFoundException - |
getFirstCommonSuperclass | public ObjectType getFirstCommonSuperclass(ObjectType a, ObjectType b) throws ClassNotFoundException(Code) | | Get the first common superclass of the given object types.
Note that an interface type is never returned unless a and b are the
same type. Otherwise, we try to return as accurate a type as possible.
This method is used as the meet operator in TypeDataflowAnalysis,
and is intended to follow (more or less) the JVM bytecode verifier
semantics.
This method should be used in preference to the getFirstCommonSuperclass()
method in
ReferenceType .
Parameters: a - an ObjectType Parameters: b - another ObjectType the first common superclass of a and b throws: ClassNotFoundException - |
getSupertypeQueryResults | public SupertypeQueryResults getSupertypeQueryResults(ClassDescriptor classDescriptor) throws ClassNotFoundException(Code) | | Look up or compute the SupertypeQueryResults for class
named by given ClassDescriptor.
Parameters: classDescriptor - a ClassDescriptor SupertypeQueryResults for the class named by the ClassDescriptor throws: ClassNotFoundException - |
getXClassCollection | public Collection<XClass> getXClassCollection()(Code) | | Get Collection of all XClass objects (resolved classes)
seen so far.
Collection of all XClass objects |
instanceOf | public static boolean instanceOf(String dottedSubtype, String dottedSupertype)(Code) | | |
instanceOf | public static boolean instanceOf(JavaClass subtype, String dottedSupertype)(Code) | | |
isSubtype | public boolean isSubtype(ReferenceType type, ReferenceType possibleSupertype) throws ClassNotFoundException(Code) | | Determine whether or not a given ReferenceType is a subtype of another.
Throws ClassNotFoundException if the question cannot be answered
definitively due to a missing class.
Parameters: type - a ReferenceType Parameters: possibleSupertype - another Reference type true if type is a subtype of possibleSupertype , false if not throws: ClassNotFoundException - if a missing class prevents a definitive answer |
isSubtype | public boolean isSubtype(ObjectType type, ObjectType possibleSupertype) throws ClassNotFoundException(Code) | | Determine whether or not a given ObjectType is a subtype of another.
Throws ClassNotFoundException if the question cannot be answered
definitively due to a missing class.
Parameters: type - a ReferenceType Parameters: possibleSupertype - another Reference type true if type is a subtype of possibleSupertype , false if not throws: ClassNotFoundException - if a missing class prevents a definitive answer |
traverseSupertypes | public void traverseSupertypes(ClassDescriptor start, InheritanceGraphVisitor visitor) throws ClassNotFoundException(Code) | | Starting at the class or interface named by the given ClassDescriptor,
traverse the inheritance graph, exploring all paths from
the class or interface to java.lang.Object.
Parameters: start - ClassDescriptor naming the class where the traversal should start Parameters: visitor - an InheritanceGraphVisitor throws: ClassNotFoundException - |
|
|