edu.umd.cs.findbugs.ba
public class Hierarchy extends Object
Field Summary | |
---|---|
static JavaClassAndMethodChooser | ANY_METHOD
JavaClassAndMethodChooser which accepts any method. |
static JavaClassAndMethodChooser | CONCRETE_METHOD
JavaClassAndMethodChooser which accepts only concrete (not abstract or native) methods. |
static ObjectType | ERROR_TYPE
Type of java.lang.Error. |
static ObjectType | EXCEPTION_TYPE
Type of java.lang.Exception. |
static JavaClassAndMethodChooser | INSTANCE_METHOD
JavaClassAndMethodChooser which accepts only instance methods. |
static ObjectType | RUNTIME_EXCEPTION_TYPE
Type of java.lang.RuntimeException. |
static JavaClassAndMethodChooser | STATIC_METHOD
JavaClassAndMethodChooser which accepts only static methods. |
Method Summary | |
---|---|
static boolean | accessFlagsAreConcrete(int accessFlags) |
static ObjectType[] | findDeclaredExceptions(InvokeInstruction inv, ConstantPoolGen cpg)
Find the declared exceptions for the method called
by given instruction.
|
static JavaClassAndMethod | findExactMethod(InvokeInstruction inv, ConstantPoolGen cpg)
Look up the method referenced by given InvokeInstruction.
|
static JavaClassAndMethod | findExactMethod(InvokeInstruction inv, ConstantPoolGen cpg, JavaClassAndMethodChooser chooser)
Look up the method referenced by given InvokeInstruction.
|
static Field | findField(String className, String fieldName)
Find a field with given name defined in given class.
|
static JavaClassAndMethod | findInvocationLeastUpperBound(InvokeInstruction inv, ConstantPoolGen cpg)
Find the least upper bound method in the class hierarchy
which could be called by the given InvokeInstruction.
|
static JavaClassAndMethod | findInvocationLeastUpperBound(InvokeInstruction inv, ConstantPoolGen cpg, JavaClassAndMethodChooser methodChooser) |
static JavaClassAndMethod | findMethod(JavaClass[] classList, String methodName, String methodSig)
Find a method in given list of classes,
searching the classes in order.
|
static JavaClassAndMethod | findMethod(JavaClass[] classList, String methodName, String methodSig, JavaClassAndMethodChooser chooser)
Find a method in given list of classes,
searching the classes in order.
|
static XField | findXField(String className, String fieldName, String fieldSig)
Look up a field with given name and signature in given class,
returning it as an XField object.
|
static XField | findXField(FieldInstruction fins, ConstantPoolGen cpg)
Look up the field referenced by given FieldInstruction,
returning it as an XField object.
|
static XMethod | findXMethod(JavaClass[] classList, String methodName, String methodSig)
Find XMethod for method in given list of classes,
searching the classes in order.
|
static XMethod | findXMethod(JavaClass[] classList, String methodName, String methodSig, JavaClassAndMethodChooser chooser)
Find XMethod for method in given list of classes,
searching the classes in order.
|
static InnerClassAccess | getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg)
Get the InnerClassAccess for access method called
by given INVOKESTATIC. |
static boolean | isInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg)
Determine whether the given INVOKESTATIC instruction
is an inner-class field accessor method. |
static boolean | isMonitorNotify(String methodName, String methodSig)
Determine if method whose name and signature is specified
is a monitor notify operation.
|
static boolean | isMonitorNotify(Instruction ins, ConstantPoolGen cpg)
Determine if given Instruction is a monitor wait.
|
static boolean | isMonitorWait(String methodName, String methodSig)
Determine if method whose name and signature is specified
is a monitor wait operation.
|
static boolean | isMonitorWait(Instruction ins, ConstantPoolGen cpg)
Determine if given Instruction is a monitor wait.
|
static boolean | isSubtype(String clsName, String possibleSupertypeClassName)
Determine whether one class (or reference type) is a subtype
of another.
|
static boolean | isSubtype(ReferenceType t, ReferenceType possibleSupertype)
Determine if one reference type is a subtype of another.
|
static boolean | isUncheckedException(ObjectType type)
Determine if the given ObjectType refers to an unchecked
exception (RuntimeException or Error). |
static boolean | isUniversalExceptionHandler(ObjectType catchType)
Determine if the given ObjectType reference represents
a universal exception handler. |
static Set<JavaClassAndMethod> | resolveMethodCallTargets(InvokeInstruction invokeInstruction, TypeFrame typeFrame, ConstantPoolGen cpg)
Resolve possible method call targets.
|
static Set<JavaClassAndMethod> | resolveMethodCallTargets(ReferenceType receiverType, InvokeInstruction invokeInstruction, ConstantPoolGen cpg)
Resolve possible instance method call targets.
|
static Set<JavaClassAndMethod> | resolveMethodCallTargets(ReferenceType receiverType, InvokeInstruction invokeInstruction, ConstantPoolGen cpg, boolean receiverTypeIsExact)
Resolve possible instance method call targets.
|
static JavaClassAndMethod | visitSuperClassMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
Visit all superclass methods which the given method overrides.
|
static JavaClassAndMethod | visitSuperInterfaceMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
Visit all superinterface methods which the given method implements.
|
Parameters: inv the InvokeInstruction cpg the ConstantPoolGen used by the class the InvokeInstruction belongs to
Returns: array of ObjectTypes of thrown exceptions, or null if we can't find the list of declared exceptions
Parameters: inv the InvokeInstruction cpg the ConstantPoolGen used by the class the InvokeInstruction belongs to
Returns: the JavaClassAndMethod, or null if no such method is defined in the class
Parameters: inv the InvokeInstruction cpg the ConstantPoolGen used by the class the InvokeInstruction belongs to chooser JavaClassAndMethodChooser to use to pick the method from among the candidates
Returns: the JavaClassAndMethod, or null if no such method is defined in the class
Parameters: className the name of the class fieldName the name of the field
Returns: the Field, or null if no such field could be found
Parameters: inv the InvokeInstruction cpg the ConstantPoolGen used by the class the InvokeInstruction belongs to
Returns: the JavaClassAndMethod, or null if no matching method can be found
Parameters: classList list of classes in which to search methodName the name of the method methodSig the signature of the method
Returns: the JavaClassAndMethod, or null if no such method exists in the class
Parameters: classList list of classes in which to search methodName the name of the method methodSig the signature of the method chooser JavaClassAndMethodChooser to select which methods are considered; it must return true for a method to be returned
Returns: the JavaClassAndMethod, or null if no such method exists in the class
XField
object.
If a field can't be found in the immediate class,
its superclass is search, and so forth.
Parameters: className name of the class through which the field is referenced fieldName name of the field fieldSig signature of the field
Returns: an XField object representing the field, or null if no such field could be found
XField
object.
Parameters: fins the FieldInstruction cpg the ConstantPoolGen used by the class containing the instruction
Returns: an XField object representing the field, or null if no such field could be found
Parameters: classList list of classes in which to search methodName the name of the method methodSig the signature of the method
Returns: the XMethod, or null if no such method exists in the class
Parameters: classList list of classes in which to search methodName the name of the method methodSig the signature of the method chooser JavaClassAndMethodChooser to select which methods are considered; it must return true for a method to be returned
Returns: the XMethod, or null if no such method exists in the class
Parameters: inv the INVOKESTATIC instruction cpg the ConstantPoolGen for the method
Returns: the InnerClassAccess, or null if the instruction is not an inner-class access
Parameters: inv the INVOKESTATIC instruction cpg the ConstantPoolGen for the method
Returns: true if the instruction is an inner-class field accessor, false if not
Parameters: methodName name of the method methodSig signature of the method
Returns: true if the method is a monitor notify, false if not
Parameters: ins the Instruction cpg the ConstantPoolGen for the Instruction
Returns: true if the instruction is a monitor wait, false if not
Parameters: methodName name of the method methodSig signature of the method
Returns: true if the method is a monitor wait, false if not
Parameters: ins the Instruction cpg the ConstantPoolGen for the Instruction
Returns: true if the instruction is a monitor wait, false if not
Parameters: clsName the name of the class or reference type possibleSupertypeClassName the name of the possible superclass
Returns: true if clsName is a subtype of possibleSupertypeClassName, false if not
Parameters: t a reference type possibleSupertype the possible supertype
Returns: true if t is a subtype of possibleSupertype, false if not
Parameters: catchType the ObjectType of the exception handler
Returns: true if catchType is null, or if catchType is java.lang.Throwable
Parameters: invokeInstruction the InvokeInstruction typeFrame the TypeFrame containing the types of stack values cpg the ConstantPoolGen
Returns: Set of methods which might be called
Throws: DataflowAnalysisException ClassNotFoundException
Parameters: receiverType type of the receiver object invokeInstruction the InvokeInstruction cpg the ConstantPoolGen
Returns: Set of methods which might be called
Throws: ClassNotFoundException
Parameters: receiverType type of the receiver object invokeInstruction the InvokeInstruction cpg the ConstantPoolGen receiverTypeIsExact if true, the receiver type is known exactly, which should allow a precise result
Returns: Set of methods which might be called
Throws: ClassNotFoundException
Parameters: method the method chooser chooser which visits each superclass method
Returns: the chosen method, or null if no method is chosen
Throws: ClassNotFoundException
Parameters: method the method chooser chooser which visits each superinterface method
Returns: the chosen method, or null if no method is chosen
Throws: ClassNotFoundException