Package edu.umd.cs.findbugs.ba.jsr305
Class TypeQualifierDatabase
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.jsr305.TypeQualifierDatabase
-
public class TypeQualifierDatabase extends java.lang.ObjectStore computed type qualifiers for method parameters and return values. This allows interprocedural checking of type qualifiers.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEBUGprivate DualKeyHashMap<MethodDescriptor,java.lang.Integer,java.util.Map<TypeQualifierValue<?>,TypeQualifierAnnotation>>parameterMapprivate java.util.Map<MethodDescriptor,java.util.Map<TypeQualifierValue<?>,TypeQualifierAnnotation>>returnValueMapstatic booleanUSE_DATABASEIf true, populate and use interprocedural database.
-
Constructor Summary
Constructors Constructor Description TypeQualifierDatabase()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeQualifierAnnotationgetParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv)Get the TypeQualifierAnnotation on a parameter.TypeQualifierAnnotationgetReturnValue(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 Detail
-
USE_DATABASE
public static final boolean USE_DATABASE
If true, populate and use interprocedural database.
-
DEBUG
public static final boolean DEBUG
-
returnValueMap
private final java.util.Map<MethodDescriptor,java.util.Map<TypeQualifierValue<?>,TypeQualifierAnnotation>> returnValueMap
-
parameterMap
private final DualKeyHashMap<MethodDescriptor,java.lang.Integer,java.util.Map<TypeQualifierValue<?>,TypeQualifierAnnotation>> parameterMap
-
-
Method Detail
-
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
-
-