Package edu.umd.cs.findbugs.ba.jsr305
Class TypeQualifierDatabase
java.lang.Object
edu.umd.cs.findbugs.ba.jsr305.TypeQualifierDatabase
Store computed type qualifiers for method parameters and return values. This
allows interprocedural checking of type qualifiers.
- Author:
- David Hovemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final booleanIf true, populate and use interprocedural database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) Get the TypeQualifierAnnotation on a parameter.getReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv) Get the TypeQualifierAnnotation on a method return value.voidsetParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) Set a TypeQualifierAnnotation on a method parameter.voidsetReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) Set a TypeQualifierAnnotation on a method return value.
-
Field Details
-
USE_DATABASE
public static final boolean USE_DATABASEIf true, populate and use interprocedural database. -
DEBUG
public static final boolean DEBUG
-
-
Constructor Details
-
TypeQualifierDatabase
public TypeQualifierDatabase()Constructor.
-
-
Method Details
-
setReturnValue
public void setReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) Set a TypeQualifierAnnotation on a method return value.- Parameters:
methodDesc- the methodtqv- the type qualifiertqa- the type qualifier annotation
-
getReturnValue
public TypeQualifierAnnotation getReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv) Get the TypeQualifierAnnotation on a method return value.- Parameters:
methodDesc- the methodtqv- the type qualifier- Returns:
- the type qualifier annotation on the method return value, or null if no (interesting) type qualifier annotation was computed for this method
-
setParameter
public void setParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) Set a TypeQualifierAnnotation on a method parameter.- Parameters:
methodDesc- the methodparam- the parameter (0 == first parameter)tqv- the type qualifiertqa- the type qualifier annotation
-
getParameter
public TypeQualifierAnnotation getParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) Get the TypeQualifierAnnotation on a parameter.- Parameters:
methodDesc- the methodparam- the parameter (0 == first parameter)tqv- the type qualifier- Returns:
- the type qualifier annotation on the method return value, or null if no (interesting) type qualifier annotation was computed for this method
-