Package edu.umd.cs.findbugs.detect
Class CheckRelaxingNullnessAnnotation
- java.lang.Object
-
- org.objectweb.asm.ClassVisitor
-
- org.objectweb.asm.tree.ClassNode
-
- edu.umd.cs.findbugs.asm.ClassNodeDetector
-
- edu.umd.cs.findbugs.detect.CheckRelaxingNullnessAnnotation
-
- All Implemented Interfaces:
Detector2
,Priorities
public class CheckRelaxingNullnessAnnotation extends ClassNodeDetector
Checks that overriding methods do not relaxNonnull
(madeCheckForNull
) on return values orCheckForNull
(madeNonnull
) on parameters. The code accepts also old (deprecated) nullness annotations fromedu.umd.cs.findbugs.annotations
package.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CheckRelaxingNullnessAnnotation.DetectorNode
private class
CheckRelaxingNullnessAnnotation.HierarchyIterator
-
Field Summary
Fields Modifier and Type Field Description (package private) XClass
xclass
-
Fields inherited from class edu.umd.cs.findbugs.asm.ClassNodeDetector
bugReporter
-
Fields inherited from class org.objectweb.asm.tree.ClassNode
access, attrs, fields, innerClasses, interfaces, invisibleAnnotations, invisibleTypeAnnotations, methods, module, name, nestHostClass, nestMembers, outerClass, outerMethod, outerMethodDesc, permittedSubclasses, recordComponents, signature, sourceDebug, sourceFile, superName, version, visibleAnnotations, visibleTypeAnnotations
-
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description CheckRelaxingNullnessAnnotation(BugReporter bugReporter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static boolean
areRelated(java.lang.String sig, java.lang.String superSig)
(package private) static boolean
compatibleParameters(java.lang.String signature, java.lang.String superSignature)
(package private) static boolean
containsNullness(java.util.Collection<AnnotationValue> annotations, NullnessAnnotation nullness)
(package private) static boolean
containsRelaxedNonNull(java.util.List<org.objectweb.asm.tree.AnnotationNode> methodAnnotations)
(package private) XClass
getClassInfo(ClassDescriptor classDescr)
(package private) static java.util.Map<java.lang.Integer,NullnessAnnotation>
getNonnullOrNullableParams(java.util.List<org.objectweb.asm.tree.AnnotationNode>[] parameterAnnotations)
(package private) static NullnessAnnotation
getNullness(java.lang.String annotationDesc)
void
visitClass(ClassDescriptor classDescriptor)
Visit a class.org.objectweb.asm.MethodVisitor
visitMethod(int methodAccess, java.lang.String methodName, java.lang.String desc, java.lang.String methodSignature, java.lang.String[] exceptions)
-
Methods inherited from class edu.umd.cs.findbugs.asm.ClassNodeDetector
finishPass
-
Methods inherited from class org.objectweb.asm.tree.ClassNode
accept, check, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.umd.cs.findbugs.Detector2
getDetectorClassName
-
-
-
-
Field Detail
-
xclass
XClass xclass
-
-
Constructor Detail
-
CheckRelaxingNullnessAnnotation
public CheckRelaxingNullnessAnnotation(BugReporter bugReporter)
-
-
Method Detail
-
visitClass
public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException
Description copied from interface:Detector2
Visit a class.- Specified by:
visitClass
in interfaceDetector2
- Overrides:
visitClass
in classClassNodeDetector
- Parameters:
classDescriptor
- descriptor naming the class to visit- Throws:
CheckedAnalysisException
- if an exception occurs during analysis
-
getClassInfo
@CheckForNull XClass getClassInfo(ClassDescriptor classDescr)
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int methodAccess, java.lang.String methodName, java.lang.String desc, java.lang.String methodSignature, java.lang.String[] exceptions)
- Overrides:
visitMethod
in classorg.objectweb.asm.tree.ClassNode
-
containsRelaxedNonNull
static boolean containsRelaxedNonNull(@CheckForNull java.util.List<org.objectweb.asm.tree.AnnotationNode> methodAnnotations)
-
getNonnullOrNullableParams
@CheckForNull static java.util.Map<java.lang.Integer,NullnessAnnotation> getNonnullOrNullableParams(@CheckForNull java.util.List<org.objectweb.asm.tree.AnnotationNode>[] parameterAnnotations)
-
getNullness
@CheckForNull static NullnessAnnotation getNullness(@SlashedClassName java.lang.String annotationDesc)
-
containsNullness
static boolean containsNullness(java.util.Collection<AnnotationValue> annotations, NullnessAnnotation nullness)
-
compatibleParameters
static boolean compatibleParameters(java.lang.String signature, java.lang.String superSignature)
-
areRelated
static boolean areRelated(java.lang.String sig, java.lang.String superSig)
-
-