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 protectedUnresolvedXMethod(MethodDescriptor m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(AnnotationValue annotationValue)Destructively add an annotation.voidaddParameterAnnotation(int param, AnnotationValue annotationValue)Destructively add a parameter annotation.XMethodbridgeFrom()XMethodbridgeTo()If nonnull, then this method is a synthetic method that overrides a method in a superclass.intcompareTo(ComparableMethod o)FieldDescriptorgetAccessMethodForField()MethodDescriptorgetAccessMethodForMethod()AnnotationValuegetAnnotation(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.AnnotatedObjectgetContainingScope()java.lang.annotation.ElementTypegetElementType()AnnotationValuegetParameterAnnotation(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.StringgetSourceSignature()Get the signature representing the field/method's type, including generic typejava.lang.String[]getThrownExceptions()booleanhasParameterAnnotations()booleanhasPolymorphicSignature()Seejava.lang.invoke.MethodHandle.PolymorphicSignaturebooleanisAbstract()booleanisDeprecated()Is the entity deprecated?booleanisIdentity()Is this an identity methodbooleanisReturnTypeReferenceType()booleanisStub()booleanisSynthetic()Is the entity synthetic?booleanisUnconditionalThrower()booleanisUnsupported()booleanisVarArgs()booleanisVariableSynthetic(int param)Is the variable synthetic?booleanusesConcurrency()booleanusesInvokeDynamic()-
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
-
Methods inherited from interface edu.umd.cs.findbugs.ba.XMethod
isAccessMethod
-
-
-
-
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:AccessibleEntityIs the entity synthetic?
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:AccessibleEntityIs 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:ClassMemberGet 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:XMethodIs this an identity method
-
addParameterAnnotation
public void addParameterAnnotation(int param, AnnotationValue annotationValue)Description copied from interface:XMethodDestructively 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:XMethodGet 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:XMethodGet 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:XMethodGet 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:XMethodDestructively 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:XMethodGet 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:XMethodGet 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:XMethodGet 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:XMethodIf 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:XMethodIs the variable synthetic?
-
usesInvokeDynamic
public boolean usesInvokeDynamic()
-
hasPolymorphicSignature
public boolean hasPolymorphicSignature()
Description copied from interface:XMethodSeejava.lang.invoke.MethodHandle.PolymorphicSignature- Returns:
- is this method polymorphic as defined in
MethodHandle
-
-