|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.Hierarchy
public class Hierarchy
Facade for class hierarchy queries.
These typically access the class hierarchy using
the Repository
class. Callers should generally
expect to handle ClassNotFoundException for when referenced
classes can't be found.
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. |
protected static boolean |
DEBUG_METHOD_LOOKUP
|
static org.apache.bcel.generic.ObjectType |
ERROR_TYPE
Type of java.lang.Error. |
static org.apache.bcel.generic.ObjectType |
EXCEPTION_TYPE
Type of java.lang.Exception. |
static JavaClassAndMethodChooser |
INSTANCE_METHOD
JavaClassAndMethodChooser which accepts only instance methods. |
static org.apache.bcel.generic.ObjectType |
RUNTIME_EXCEPTION_TYPE
Type of java.lang.RuntimeException. |
static JavaClassAndMethodChooser |
STATIC_METHOD
JavaClassAndMethodChooser which accepts only static methods. |
Constructor Summary | |
---|---|
Hierarchy()
|
Method Summary | |
---|---|
static boolean |
accessFlagsAreConcrete(int accessFlags)
|
static JavaClassAndMethod |
findConcreteMethod(org.apache.bcel.classfile.JavaClass javaClass,
java.lang.String methodName,
java.lang.String methodSig)
Deprecated. |
static org.apache.bcel.generic.ObjectType[] |
findDeclaredExceptions(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
Deprecated. Use Hierarchy2.findDeclaredExceptions(InvokeInstruction,ConstantPoolGen) instead |
static JavaClassAndMethod |
findExactMethod(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
Look up the method referenced by given InvokeInstruction. |
static JavaClassAndMethod |
findExactMethod(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg,
JavaClassAndMethodChooser chooser)
Look up the method referenced by given InvokeInstruction. |
static org.apache.bcel.classfile.Field |
findField(java.lang.String className,
java.lang.String fieldName)
Find a field with given name defined in given class. |
static JavaClassAndMethod |
findInvocationLeastUpperBound(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
Find the least upper bound method in the class hierarchy which could be called by the given InvokeInstruction. |
static JavaClassAndMethod |
findInvocationLeastUpperBound(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg,
JavaClassAndMethodChooser methodChooser)
|
static JavaClassAndMethod |
findInvocationLeastUpperBound(org.apache.bcel.classfile.JavaClass jClass,
java.lang.String methodName,
java.lang.String methodSig,
JavaClassAndMethodChooser methodChooser,
boolean invokeInterface)
|
static XMethod |
findMethod(ClassDescriptor classDesc,
java.lang.String methodName,
java.lang.String methodSig,
boolean isStatic)
Find a method in given class. |
static JavaClassAndMethod |
findMethod(org.apache.bcel.classfile.JavaClass[] classList,
java.lang.String methodName,
java.lang.String methodSig)
Deprecated. |
static JavaClassAndMethod |
findMethod(org.apache.bcel.classfile.JavaClass[] classList,
java.lang.String methodName,
java.lang.String methodSig,
JavaClassAndMethodChooser chooser)
Find a method in given list of classes, searching the classes in order. |
static JavaClassAndMethod |
findMethod(org.apache.bcel.classfile.JavaClass javaClass,
java.lang.String methodName,
java.lang.String methodSig)
Find a method in given class. |
static JavaClassAndMethod |
findMethod(org.apache.bcel.classfile.JavaClass javaClass,
java.lang.String methodName,
java.lang.String methodSig,
JavaClassAndMethodChooser chooser)
|
static XField |
findXField(org.apache.bcel.generic.FieldInstruction fins,
org.apache.bcel.generic.ConstantPoolGen cpg)
Look up the field referenced by given FieldInstruction, returning it as an XField object. |
static XField |
findXField(java.lang.String className,
java.lang.String fieldName,
java.lang.String fieldSig,
boolean isStatic)
Look up a field with given name and signature in given class, returning it as an XField object. |
static XMethod |
findXMethod(org.apache.bcel.classfile.JavaClass[] classList,
java.lang.String methodName,
java.lang.String methodSig)
Deprecated. |
static XMethod |
findXMethod(org.apache.bcel.classfile.JavaClass[] classList,
java.lang.String methodName,
java.lang.String methodSig,
JavaClassAndMethodChooser chooser)
Deprecated. |
static XMethod |
findXMethod(org.apache.bcel.classfile.JavaClass javaClass,
java.lang.String methodName,
java.lang.String methodSig,
JavaClassAndMethodChooser chooser)
Deprecated. |
static InnerClassAccess |
getInnerClassAccess(org.apache.bcel.generic.INVOKESTATIC inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
Get the InnerClassAccess for access method called by given INVOKESTATIC. |
static boolean |
isConcrete(XMethod xmethod)
Deprecated. |
static boolean |
isInnerClassAccess(org.apache.bcel.generic.INVOKESTATIC inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine whether the given INVOKESTATIC instruction is an inner-class field accessor method. |
static boolean |
isMonitorNotify(org.apache.bcel.generic.Instruction ins,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine if given Instruction is a monitor wait. |
static boolean |
isMonitorNotify(java.lang.String methodName,
java.lang.String methodSig)
Determine if method whose name and signature is specified is a monitor notify operation. |
static boolean |
isMonitorWait(org.apache.bcel.generic.Instruction ins,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine if given Instruction is a monitor wait. |
static boolean |
isMonitorWait(java.lang.String methodName,
java.lang.String methodSig)
Determine if method whose name and signature is specified is a monitor wait operation. |
static boolean |
isSubtype(org.apache.bcel.generic.ReferenceType t,
org.apache.bcel.generic.ReferenceType possibleSupertype)
Determine if one reference type is a subtype of another. |
static boolean |
isSubtype(java.lang.String clsName,
java.lang.String possibleSupertypeClassName)
Determine whether one class (or reference type) is a subtype of another. |
static boolean |
isUncheckedException(org.apache.bcel.generic.ObjectType type)
Determine if the given ObjectType refers to an unchecked exception (RuntimeException or Error). |
static boolean |
isUniversalExceptionHandler(org.apache.bcel.generic.ObjectType catchType)
Determine if the given ObjectType reference represents a universal exception handler. |
static java.util.Set<JavaClassAndMethod> |
resolveMethodCallTargets(org.apache.bcel.generic.InvokeInstruction invokeInstruction,
TypeFrame typeFrame,
org.apache.bcel.generic.ConstantPoolGen cpg)
Resolve possible method call targets. |
static java.util.Set<JavaClassAndMethod> |
resolveMethodCallTargets(org.apache.bcel.generic.ReferenceType receiverType,
org.apache.bcel.generic.InvokeInstruction invokeInstruction,
org.apache.bcel.generic.ConstantPoolGen cpg)
Resolve possible instance method call targets. |
static java.util.Set<JavaClassAndMethod> |
resolveMethodCallTargets(org.apache.bcel.generic.ReferenceType receiverType,
org.apache.bcel.generic.InvokeInstruction invokeInstruction,
org.apache.bcel.generic.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEBUG_METHOD_LOOKUP
public static final org.apache.bcel.generic.ObjectType EXCEPTION_TYPE
public static final org.apache.bcel.generic.ObjectType ERROR_TYPE
public static final org.apache.bcel.generic.ObjectType RUNTIME_EXCEPTION_TYPE
public static final JavaClassAndMethodChooser ANY_METHOD
public static final JavaClassAndMethodChooser CONCRETE_METHOD
public static final JavaClassAndMethodChooser STATIC_METHOD
public static final JavaClassAndMethodChooser INSTANCE_METHOD
Constructor Detail |
---|
public Hierarchy()
Method Detail |
---|
public static boolean isSubtype(java.lang.String clsName, java.lang.String possibleSupertypeClassName) throws java.lang.ClassNotFoundException
clsName
- the name of the class or reference typepossibleSupertypeClassName
- the name of the possible superclass
java.lang.ClassNotFoundException
public static boolean isSubtype(org.apache.bcel.generic.ReferenceType t, org.apache.bcel.generic.ReferenceType possibleSupertype) throws java.lang.ClassNotFoundException
t
- a reference typepossibleSupertype
- the possible supertype
java.lang.ClassNotFoundException
public static boolean isUniversalExceptionHandler(org.apache.bcel.generic.ObjectType catchType)
catchType
- the ObjectType of the exception handler
public static boolean isUncheckedException(org.apache.bcel.generic.ObjectType type) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static boolean isMonitorWait(java.lang.String methodName, java.lang.String methodSig)
methodName
- name of the methodmethodSig
- signature of the method
public static boolean isMonitorWait(org.apache.bcel.generic.Instruction ins, org.apache.bcel.generic.ConstantPoolGen cpg)
ins
- the Instructioncpg
- the ConstantPoolGen for the Instruction
public static boolean isMonitorNotify(java.lang.String methodName, java.lang.String methodSig)
methodName
- name of the methodmethodSig
- signature of the method
public static boolean isMonitorNotify(org.apache.bcel.generic.Instruction ins, org.apache.bcel.generic.ConstantPoolGen cpg)
ins
- the Instructioncpg
- the ConstantPoolGen for the Instruction
public static JavaClassAndMethod findExactMethod(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
inv
- the InvokeInstructioncpg
- the ConstantPoolGen used by the class the InvokeInstruction belongs to
java.lang.ClassNotFoundException
public static JavaClassAndMethod findExactMethod(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg, JavaClassAndMethodChooser chooser) throws java.lang.ClassNotFoundException
inv
- the InvokeInstructioncpg
- the ConstantPoolGen used by the class the InvokeInstruction belongs tochooser
- JavaClassAndMethodChooser to use to pick the method from among the candidates
java.lang.ClassNotFoundException
public static JavaClassAndMethod visitSuperClassMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser) throws java.lang.ClassNotFoundException
method
- the methodchooser
- chooser which visits each superclass method
java.lang.ClassNotFoundException
public static JavaClassAndMethod visitSuperInterfaceMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser) throws java.lang.ClassNotFoundException
method
- the methodchooser
- chooser which visits each superinterface method
java.lang.ClassNotFoundException
@CheckForNull public static JavaClassAndMethod findInvocationLeastUpperBound(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
inv
- the InvokeInstructioncpg
- the ConstantPoolGen used by the class the InvokeInstruction belongs to
java.lang.ClassNotFoundException
@CheckForNull public static JavaClassAndMethod findInvocationLeastUpperBound(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg, JavaClassAndMethodChooser methodChooser) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
@CheckForNull public static JavaClassAndMethod findInvocationLeastUpperBound(org.apache.bcel.classfile.JavaClass jClass, java.lang.String methodName, java.lang.String methodSig, JavaClassAndMethodChooser methodChooser, boolean invokeInterface) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
@Deprecated public static org.apache.bcel.generic.ObjectType[] findDeclaredExceptions(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
Hierarchy2.findDeclaredExceptions(InvokeInstruction,ConstantPoolGen)
instead
inv
- the InvokeInstructioncpg
- the ConstantPoolGen used by the class the InvokeInstruction belongs to
java.lang.ClassNotFoundException
@CheckForNull public static JavaClassAndMethod findMethod(org.apache.bcel.classfile.JavaClass javaClass, java.lang.String methodName, java.lang.String methodSig)
javaClass
- the classmethodName
- the name of the methodmethodSig
- the signature of the method
@CheckForNull public static JavaClassAndMethod findMethod(org.apache.bcel.classfile.JavaClass javaClass, java.lang.String methodName, java.lang.String methodSig, JavaClassAndMethodChooser chooser)
@CheckForNull public static XMethod findMethod(ClassDescriptor classDesc, java.lang.String methodName, java.lang.String methodSig, boolean isStatic)
classDesc
- the class descriptormethodName
- the name of the methodmethodSig
- the signature of the methodisStatic
- are we looking for a static method?
@Deprecated @CheckForNull public static JavaClassAndMethod findConcreteMethod(org.apache.bcel.classfile.JavaClass javaClass, java.lang.String methodName, java.lang.String methodSig)
javaClass
- the classmethodName
- the name of the methodmethodSig
- the signature of the method
@Deprecated @CheckForNull public static XMethod findXMethod(org.apache.bcel.classfile.JavaClass javaClass, java.lang.String methodName, java.lang.String methodSig, JavaClassAndMethodChooser chooser)
javaClass
- the classmethodName
- the name of the methodmethodSig
- the signature of the methodchooser
- the JavaClassAndMethodChooser to use to screen possible candidates
public static boolean accessFlagsAreConcrete(int accessFlags)
@Deprecated public static JavaClassAndMethod findMethod(org.apache.bcel.classfile.JavaClass[] classList, java.lang.String methodName, java.lang.String methodSig)
classList
- list of classes in which to searchmethodName
- the name of the methodmethodSig
- the signature of the method
public static JavaClassAndMethod findMethod(org.apache.bcel.classfile.JavaClass[] classList, java.lang.String methodName, java.lang.String methodSig, JavaClassAndMethodChooser chooser)
classList
- list of classes in which to searchmethodName
- the name of the methodmethodSig
- the signature of the methodchooser
- JavaClassAndMethodChooser to select which methods are considered;
it must return true for a method to be returned
@Deprecated public static XMethod findXMethod(org.apache.bcel.classfile.JavaClass[] classList, java.lang.String methodName, java.lang.String methodSig)
classList
- list of classes in which to searchmethodName
- the name of the methodmethodSig
- the signature of the method
@Deprecated public static XMethod findXMethod(org.apache.bcel.classfile.JavaClass[] classList, java.lang.String methodName, java.lang.String methodSig, JavaClassAndMethodChooser chooser)
classList
- list of classes in which to searchmethodName
- the name of the methodmethodSig
- the signature of the methodchooser
- JavaClassAndMethodChooser to select which methods are considered;
it must return true for a method to be returned
public static java.util.Set<JavaClassAndMethod> resolveMethodCallTargets(org.apache.bcel.generic.InvokeInstruction invokeInstruction, TypeFrame typeFrame, org.apache.bcel.generic.ConstantPoolGen cpg) throws DataflowAnalysisException, java.lang.ClassNotFoundException
invokeInstruction
- the InvokeInstructiontypeFrame
- the TypeFrame containing the types of stack valuescpg
- the ConstantPoolGen
DataflowAnalysisException
java.lang.ClassNotFoundException
public static java.util.Set<JavaClassAndMethod> resolveMethodCallTargets(org.apache.bcel.generic.ReferenceType receiverType, org.apache.bcel.generic.InvokeInstruction invokeInstruction, org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
receiverType
- type of the receiver objectinvokeInstruction
- the InvokeInstructioncpg
- the ConstantPoolGen
java.lang.ClassNotFoundException
public static java.util.Set<JavaClassAndMethod> resolveMethodCallTargets(org.apache.bcel.generic.ReferenceType receiverType, org.apache.bcel.generic.InvokeInstruction invokeInstruction, org.apache.bcel.generic.ConstantPoolGen cpg, boolean receiverTypeIsExact) throws java.lang.ClassNotFoundException
receiverType
- type of the receiver objectinvokeInstruction
- the InvokeInstructioncpg
- the ConstantPoolGenreceiverTypeIsExact
- if true, the receiver type is known exactly,
which should allow a precise result
java.lang.ClassNotFoundException
@Deprecated public static boolean isConcrete(XMethod xmethod)
xmethod
- the method
public static org.apache.bcel.classfile.Field findField(java.lang.String className, java.lang.String fieldName) throws java.lang.ClassNotFoundException
className
- the name of the classfieldName
- the name of the field
java.lang.ClassNotFoundException
public static XField findXField(java.lang.String className, java.lang.String fieldName, java.lang.String fieldSig, boolean isStatic) throws java.lang.ClassNotFoundException
XField
object.
If a field can't be found in the immediate class,
its superclass is search, and so forth.
className
- name of the class through which the field
is referencedfieldName
- name of the fieldfieldSig
- signature of the fieldisStatic
- true if field is static, false otherwise
java.lang.ClassNotFoundException
public static XField findXField(org.apache.bcel.generic.FieldInstruction fins, @NonNull org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
XField
object.
fins
- the FieldInstructioncpg
- the ConstantPoolGen used by the class containing the instruction
java.lang.ClassNotFoundException
public static boolean isInnerClassAccess(org.apache.bcel.generic.INVOKESTATIC inv, org.apache.bcel.generic.ConstantPoolGen cpg)
inv
- the INVOKESTATIC instructioncpg
- the ConstantPoolGen for the method
public static InnerClassAccess getInnerClassAccess(org.apache.bcel.generic.INVOKESTATIC inv, org.apache.bcel.generic.ConstantPoolGen cpg) throws java.lang.ClassNotFoundException
inv
- the INVOKESTATIC instructioncpg
- the ConstantPoolGen for the method
java.lang.ClassNotFoundException
|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |