Class MethodInfo
java.lang.Object
edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
edu.umd.cs.findbugs.classfile.MethodDescriptor
edu.umd.cs.findbugs.classfile.analysis.MethodInfo
- All Implemented Interfaces:
AccessibleEntity
,ClassMember
,ComparableMethod
,XMethod
,AnnotatedObject
,FieldOrMethodName
,Serializable
,Comparable<ComparableMethod>
- Author:
- pugh
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(AnnotationValue annotationValue) Destructively add an annotation.void
addParameterAnnotation
(int param, AnnotationValue annotationValue) Destructively add a parameter annotation.bridgeTo()
If nonnull, then this method is a synthetic method that overrides a method in a superclass.int
int
Get the entity's access flags.getAnnotation
(ClassDescriptor desc) Get the AnnotationValue of annotation applied directly to the method.Get ClassDescriptors (annotation classes) of annotations applied directly to this method.Get collection of all AnnotationValues applied directly to the method.Get the full (dotted) name of the class (if the object represents a class) or the class the entity is defined in (if a field or method).static IdentityHashMap<MethodInfo,
Void> int
int
Get the (dotted) name of the package in which the entity is defined.getParameterAnnotation
(int param, ClassDescriptor desc) Get the AnnotationValue of annotation applied directly to given parameter.getParameterAnnotationDescriptors
(int param) Get ClassDescriptors (annotation classes) of annotations applied directly to this method's parameters.getParameterAnnotations
(int param) Get collection of all AnnotationValues applied directly to given parameter.Get the signature representing the field/method's type, including generic typeString[]
boolean
boolean
boolean
boolean
isBridge()
Is this a bridge method?boolean
Is the entity deprecated?boolean
isFinal()
Is the entity final?boolean
Is this an identity methodboolean
isNative()
boolean
Is the entity private?boolean
Is the entity protected?boolean
isPublic()
Is the entity public?boolean
Did we find a declaration of this entity?boolean
boolean
isStub()
boolean
boolean
Is the entity synthetic?boolean
boolean
boolean
boolean
isVariableSynthetic
(int param) Is the variable synthetic?static MethodInfo[]
newArray
(int sz) boolean
boolean
Methods inherited from class edu.umd.cs.findbugs.classfile.MethodDescriptor
equals
Methods inherited from class edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
compareTo, compareTo, getClassDescriptor, getName, getNameSigHashCode, getNameSigHashCode, getSignature, getSlashedClassName, hashCode, haveEqualFields, isStatic, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.umd.cs.findbugs.ba.AccessibleEntity
getClassDescriptor, isStatic
Methods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptor
Methods inherited from interface edu.umd.cs.findbugs.ba.ClassMember
getName, getSignature
Methods inherited from interface edu.umd.cs.findbugs.classfile.FieldOrMethodName
getClassDescriptor, isStatic
-
Field Details
-
EMPTY_ARRAY
-
-
Method Details
-
newArray
-
getInvokeDynamicMethods
-
getThrownExceptions
- Specified by:
getThrownExceptions
in interfaceXMethod
- Returns:
- the exceptions this method is declared to throw
-
isUnconditionalThrower
public boolean isUnconditionalThrower()- Specified by:
isUnconditionalThrower
in interfaceXMethod
- Returns:
- does this method unconditionally throw an exception?
-
isIdentity
public boolean isIdentity()Description copied from interface:XMethod
Is this an identity method- Specified by:
isIdentity
in interfaceXMethod
-
usesInvokeDynamic
public boolean usesInvokeDynamic()- Specified by:
usesInvokeDynamic
in interfaceXMethod
-
isUnsupported
public boolean isUnsupported()- Specified by:
isUnsupported
in interfaceXMethod
- Returns:
- does this method unconditionally throw an UnsupportedOperationException?
-
getNumParams
public int getNumParams()- Specified by:
getNumParams
in interfaceXMethod
-
isVariableSynthetic
public boolean isVariableSynthetic(int param) Description copied from interface:XMethod
Is the variable synthetic?- Specified by:
isVariableSynthetic
in interfaceXMethod
-
getMethodCallCount
public int getMethodCallCount() -
isNative
public boolean isNative() -
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceXMethod
-
isSynchronized
public boolean isSynchronized()- Specified by:
isSynchronized
in interfaceXMethod
-
isBridge
public boolean isBridge()Description copied from interface:XMethod
Is this a bridge method? -
isReturnTypeReferenceType
public boolean isReturnTypeReferenceType()- Specified by:
isReturnTypeReferenceType
in interfaceXMethod
- Returns:
- true if method's return type is a reference type, false otherwise
-
getClassName
Description copied from interface:ClassMember
Get the full (dotted) name of the class (if the object represents a class) or the class the entity is defined in (if a field or method).- Specified by:
getClassName
in interfaceClassMember
-
getPackageName
Description copied from interface:ClassMember
Get the (dotted) name of the package in which the entity is defined.- Specified by:
getPackageName
in interfaceClassMember
-
getSourceSignature
Description copied from interface:ClassMember
Get the signature representing the field/method's type, including generic type- Specified by:
getSourceSignature
in interfaceClassMember
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ComparableMethod>
- Overrides:
compareTo
in classMethodDescriptor
-
getAccessFlags
public int getAccessFlags()Description copied from interface:AccessibleEntity
Get the entity's access flags.- Specified by:
getAccessFlags
in interfaceAccessibleEntity
-
isFinal
public boolean isFinal()Description copied from interface:AccessibleEntity
Is the entity final?- Specified by:
isFinal
in interfaceAccessibleEntity
-
isPrivate
public boolean isPrivate()Description copied from interface:AccessibleEntity
Is the entity private?- Specified by:
isPrivate
in interfaceAccessibleEntity
-
isDeprecated
public boolean isDeprecated()Description copied from interface:AccessibleEntity
Is the entity deprecated?- Specified by:
isDeprecated
in interfaceAccessibleEntity
-
isProtected
public boolean isProtected()Description copied from interface:AccessibleEntity
Is the entity protected?- Specified by:
isProtected
in interfaceAccessibleEntity
-
isPublic
public boolean isPublic()Description copied from interface:AccessibleEntity
Is the entity public?- Specified by:
isPublic
in interfaceAccessibleEntity
-
isSynthetic
public boolean isSynthetic()Description copied from interface:AccessibleEntity
Is the entity synthetic?- Specified by:
isSynthetic
in interfaceAccessibleEntity
- Specified by:
isSynthetic
in interfaceAnnotatedObject
-
isResolved
public boolean isResolved()Description copied from interface:ClassMember
Did we find a declaration of this entity?- Specified by:
isResolved
in interfaceClassMember
-
getParameterAnnotationDescriptors
Description copied from interface:XMethod
Get ClassDescriptors (annotation classes) of annotations applied directly to this method's parameters.- Specified by:
getParameterAnnotationDescriptors
in interfaceXMethod
- Parameters:
param
- parameter number (0 for first parameter)- Returns:
- ClassDescriptors of annotations applied directly to this method's parameters
-
hasParameterAnnotations
public boolean hasParameterAnnotations()- Specified by:
hasParameterAnnotations
in interfaceXMethod
-
getParameterAnnotation
Description copied from interface:XMethod
Get the AnnotationValue of annotation applied directly to given parameter.- Specified by:
getParameterAnnotation
in interfaceXMethod
- Parameters:
param
- parameter number (0 for first parameter)desc
- ClassDescriptor of the annotation class- Returns:
- AnnotationValue annotating the parameter, or null if parameter is not annotated with this kind of annotation
-
getParameterAnnotations
Description copied from interface:XMethod
Get collection of all AnnotationValues applied directly to given parameter.- Specified by:
getParameterAnnotations
in interfaceXMethod
- Parameters:
param
- parameter number (0 for first parameter)- Returns:
- Collection of all AnnotationValues applied directly to given parameter
-
getAnnotationDescriptors
Description copied from interface:XMethod
Get ClassDescriptors (annotation classes) of annotations applied directly to this method.- Specified by:
getAnnotationDescriptors
in interfaceAnnotatedObject
- Specified by:
getAnnotationDescriptors
in interfaceXMethod
- Returns:
- ClassDescriptors of annotations applied directly to this method
-
getAnnotation
Description copied from interface:XMethod
Get the AnnotationValue of annotation applied directly to the method.- Specified by:
getAnnotation
in interfaceAnnotatedObject
- Specified by:
getAnnotation
in interfaceXMethod
- Parameters:
desc
- ClassDescriptor of the annotation class- Returns:
- AnnotationValue annotating the method, or null if method is not annotated with this kind of annotation
-
getAnnotations
Description copied from interface:XMethod
Get collection of all AnnotationValues applied directly to the method.- Specified by:
getAnnotations
in interfaceAnnotatedObject
- Specified by:
getAnnotations
in interfaceXMethod
- Returns:
- Collection of all AnnotationValues applied directly to the method
-
addAnnotation
Destructively add an annotation. We do this for "built-in" annotations that might not be directly evident in the code. It's not a great idea in general, but we can get away with it as long as it's done early enough (i.e., before anyone asks what annotations this method has.)- Specified by:
addAnnotation
in interfaceXMethod
- Parameters:
annotationValue
- an AnnotationValue representing a method annotation
-
addParameterAnnotation
Destructively add a parameter annotation.- Specified by:
addParameterAnnotation
in interfaceXMethod
- Parameters:
param
- parameter (0 == first parameter)annotationValue
- an AnnotationValue representing a parameter annotation
-
getMethodDescriptor
- Specified by:
getMethodDescriptor
in interfaceXMethod
- Returns:
- the MethodDescriptor identifying this object
-
getElementType
- Specified by:
getElementType
in interfaceAnnotatedObject
-
getContainingScope
- Specified by:
getContainingScope
in interfaceAnnotatedObject
-
isVarArgs
public boolean isVarArgs() -
usesConcurrency
public boolean usesConcurrency()- Specified by:
usesConcurrency
in interfaceXMethod
- Returns:
- does the method directly make use of concurrency/threads/synchronization?
-
hasBackBranch
public boolean hasBackBranch() -
isStub
public boolean isStub() -
getAccessMethodForMethod
- Specified by:
getAccessMethodForMethod
in interfaceXMethod
-
getAccessMethodForField
- Specified by:
getAccessMethodForField
in interfaceXMethod
-
bridgeFrom
- Specified by:
bridgeFrom
in interfaceXMethod
-
bridgeTo
Description copied from interface:XMethod
If nonnull, then this method is a synthetic method that overrides a method in a superclass. This method simply forwards the call to the method it bridges to, which is a method with an identical name but possibly co-variant arguments and return values. -
resolveAccessMethodForMethod
- Specified by:
resolveAccessMethodForMethod
in interfaceXMethod
-