Package edu.umd.cs.findbugs.ba
Class UnresolvedXMethod
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.AbstractClassMember
-
- edu.umd.cs.findbugs.ba.AbstractMethod
-
- edu.umd.cs.findbugs.ba.UnresolvedXMethod
-
- All Implemented Interfaces:
AccessibleEntity
,ClassMember
,ComparableMethod
,XMethod
,AnnotatedObject
,FieldOrMethodName
,java.io.Serializable
,java.lang.Comparable<ComparableMethod>
class UnresolvedXMethod extends AbstractMethod
XMethod implementation for unresolvable methods. Returns some kind of reasonable default answer to questions that can't be answered (e.g., what are the access flags).
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<ClassDescriptor,AnnotationValue>
methodAnnotations
(package private) java.util.Map<java.lang.Integer,java.util.Map<ClassDescriptor,AnnotationValue>>
methodParameterAnnotations
-
Constructor Summary
Constructors Modifier Constructor Description protected
UnresolvedXMethod(MethodDescriptor m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(AnnotationValue annotationValue)
Destructively add an annotation.void
addParameterAnnotation(int param, AnnotationValue annotationValue)
Destructively add a parameter annotation.XMethod
bridgeFrom()
XMethod
bridgeTo()
If nonnull, then this method is a synthetic method that overrides a method in a superclass.int
compareTo(ComparableMethod o)
FieldDescriptor
getAccessMethodForField()
MethodDescriptor
getAccessMethodForMethod()
AnnotationValue
getAnnotation(ClassDescriptor desc)
Get the AnnotationValue of annotation applied directly to the method.java.util.Collection<ClassDescriptor>
getAnnotationDescriptors()
Get ClassDescriptors (annotation classes) of annotations applied directly to this method.java.util.Collection<AnnotationValue>
getAnnotations()
Get collection of all AnnotationValues applied directly to the method.AnnotatedObject
getContainingScope()
java.lang.annotation.ElementType
getElementType()
AnnotationValue
getParameterAnnotation(int param, ClassDescriptor desc)
Get the AnnotationValue of annotation applied directly to given parameter.java.util.Collection<ClassDescriptor>
getParameterAnnotationDescriptors(int param)
Get ClassDescriptors (annotation classes) of annotations applied directly to this method's parameters.java.util.Collection<AnnotationValue>
getParameterAnnotations(int param)
Get collection of all AnnotationValues applied directly to given parameter.java.lang.String
getSourceSignature()
Get the signature representing the field/method's type, including generic typejava.lang.String[]
getThrownExceptions()
boolean
hasParameterAnnotations()
boolean
hasPolymorphicSignature()
Seejava.lang.invoke.MethodHandle.PolymorphicSignature
boolean
isAbstract()
boolean
isDeprecated()
Is the entity deprecated?boolean
isIdentity()
Is this an identity methodboolean
isReturnTypeReferenceType()
boolean
isStub()
boolean
isSynthetic()
Is the entity synthetic?boolean
isUnconditionalThrower()
boolean
isUnsupported()
boolean
isVarArgs()
boolean
isVariableSynthetic(int param)
Is the variable synthetic?boolean
usesConcurrency()
boolean
usesInvokeDynamic()
-
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractMethod
getMethodDescriptor, getNumParams, isBridge, isNative, isSynchronized, resolveAccessMethodForMethod, toString
-
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractClassMember
equals, getAccessFlags, getClassDescriptor, getClassName, getName, getPackageName, getSignature, hashCode, isFinal, isPrivate, isProtected, isPublic, isReferenceType, isResolved, isStatic, markAsResolved
-
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
getAccessFlags, getClassDescriptor, isFinal, isPrivate, isProtected, isPublic, isStatic
-
Methods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptor
-
Methods inherited from interface edu.umd.cs.findbugs.ba.ClassMember
getClassName, getName, getPackageName, getSignature, isResolved
-
Methods inherited from interface edu.umd.cs.findbugs.classfile.FieldOrMethodName
getClassDescriptor, isStatic
-
-
-
-
Field Detail
-
methodParameterAnnotations
java.util.Map<java.lang.Integer,java.util.Map<ClassDescriptor,AnnotationValue>> methodParameterAnnotations
-
methodAnnotations
java.util.Map<ClassDescriptor,AnnotationValue> methodAnnotations
-
-
Constructor Detail
-
UnresolvedXMethod
protected UnresolvedXMethod(MethodDescriptor m)
-
-
Method Detail
-
isReturnTypeReferenceType
public boolean isReturnTypeReferenceType()
- Returns:
- true if method's return type is a reference type, false otherwise
-
compareTo
public int compareTo(ComparableMethod o)
-
getElementType
public java.lang.annotation.ElementType getElementType()
-
getContainingScope
@CheckForNull public AnnotatedObject getContainingScope()
-
getThrownExceptions
public java.lang.String[] getThrownExceptions()
- Returns:
- the exceptions this method is declared to throw
-
isUnconditionalThrower
public boolean isUnconditionalThrower()
- Returns:
- does this method unconditionally throw an exception?
-
isUnsupported
public boolean isUnsupported()
- Returns:
- does this method unconditionally throw an UnsupportedOperationException?
-
isAbstract
public boolean isAbstract()
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:AccessibleEntity
Is the entity synthetic?
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:AccessibleEntity
Is the entity deprecated?
-
isVarArgs
public boolean isVarArgs()
- Returns:
- is this a var args method?
-
usesConcurrency
public boolean usesConcurrency()
- Returns:
- does the method directly make use of concurrency/threads/synchronization?
-
getSourceSignature
@CheckForNull public java.lang.String getSourceSignature()
Description copied from interface:ClassMember
Get the signature representing the field/method's type, including generic type
-
isStub
public boolean isStub()
- Returns:
- is the method a synthetic stub method?
-
isIdentity
public boolean isIdentity()
Description copied from interface:XMethod
Is this an identity method
-
addParameterAnnotation
public void addParameterAnnotation(int param, AnnotationValue annotationValue)
Description copied from interface:XMethod
Destructively add a parameter annotation.- Parameters:
param
- parameter (0 == first parameter)annotationValue
- an AnnotationValue representing a parameter annotation
-
getParameterAnnotationDescriptors
public java.util.Collection<ClassDescriptor> getParameterAnnotationDescriptors(int param)
Description copied from interface:XMethod
Get ClassDescriptors (annotation classes) of annotations applied directly to this method's parameters.- Parameters:
param
- parameter number (0 for first parameter)- Returns:
- ClassDescriptors of annotations applied directly to this method's parameters
-
hasParameterAnnotations
public boolean hasParameterAnnotations()
-
getParameterAnnotation
@Nullable public AnnotationValue getParameterAnnotation(int param, ClassDescriptor desc)
Description copied from interface:XMethod
Get the AnnotationValue of annotation applied directly to given parameter.- 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
public java.util.Collection<AnnotationValue> getParameterAnnotations(int param)
Description copied from interface:XMethod
Get collection of all AnnotationValues applied directly to given parameter.- Parameters:
param
- parameter number (0 for first parameter)- Returns:
- Collection of all AnnotationValues applied directly to given parameter
-
addAnnotation
public void addAnnotation(AnnotationValue annotationValue)
Description copied from interface:XMethod
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.)- Parameters:
annotationValue
- an AnnotationValue representing a method annotation
-
getAnnotationDescriptors
public java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
Description copied from interface:XMethod
Get ClassDescriptors (annotation classes) of annotations applied directly to this method.- Returns:
- ClassDescriptors of annotations applied directly to this method
-
getAnnotation
public AnnotationValue getAnnotation(ClassDescriptor desc)
Description copied from interface:XMethod
Get the AnnotationValue of annotation applied directly to the method.- 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
public java.util.Collection<AnnotationValue> getAnnotations()
Description copied from interface:XMethod
Get collection of all AnnotationValues applied directly to the method.- Returns:
- Collection of all AnnotationValues applied directly to the method
-
bridgeFrom
public XMethod bridgeFrom()
-
bridgeTo
public XMethod 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.
-
getAccessMethodForMethod
public MethodDescriptor getAccessMethodForMethod()
-
getAccessMethodForField
public FieldDescriptor getAccessMethodForField()
-
isVariableSynthetic
public boolean isVariableSynthetic(int param)
Description copied from interface:XMethod
Is the variable synthetic?
-
usesInvokeDynamic
public boolean usesInvokeDynamic()
-
hasPolymorphicSignature
public boolean hasPolymorphicSignature()
Description copied from interface:XMethod
Seejava.lang.invoke.MethodHandle.PolymorphicSignature
- Returns:
- is this method polymorphic as defined in
MethodHandle
-
-