Class ClassHierarchy
java.lang.Object
com.ibm.wala.shrike.shrikeBT.analysis.ClassHierarchy
This class takes the raw information from a ClassHierarchyProvider and computes type operations
(subtype check, type union). All operations are static.
Because ClassHierarchyProvider sometimes only provides partial information, these routines sometimes answer "don't know".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnalysisResultEquals Constants.MAYBEstatic final AnalysisResultEquals Constants.NOstatic final AnalysisResultEquals Constants.YES -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfindCommonSupertype(ClassHierarchyProvider hierarchy, String t1, String t2) Compute the most specific common supertype.static AnalysisResultisSubtypeOf(ClassHierarchyProvider hierarchy, String t1, String t2) Perform subtype check.
-
Field Details
-
NO
Equals Constants.NO -
YES
Equals Constants.YES -
MAYBE
Equals Constants.MAYBE
-
-
Method Details
-
isSubtypeOf
Perform subtype check.- Parameters:
hierarchy- the hierarchy information to use for the decisiont1- a type in JVM formatt2- a type in JVM format- Returns:
- whether t1 is a subtype of t2 (YES, NO, MAYBE)
-
findCommonSupertype
Compute the most specific common supertype.- Parameters:
hierarchy- the hierarchy information to use for the decisiont1- a type in JVM formatt2- a type in JVM format- Returns:
- the most specific common supertype of t1 and t2, or TYPE_unknown if it cannot be determined or cannot be represented as a Java type, or null if there is no common supertype
-