Class FindUnrelatedTypesInGenericContainer
java.lang.Object
edu.umd.cs.findbugs.detect.FindUnrelatedTypesInGenericContainer
- All Implemented Interfaces:
Detector, Priorities
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugReporterprivate final MultiMap<String, FindUnrelatedTypesInGenericContainer.Info> Map classname, methodname and signature to an int [].private static final booleanFields inherited from interface Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddCheckedCall(String className, String methodName, int typeParameterIndex) private voidaddCheckedCall(String className, String methodName, String sig, int argumentParameterIndex, int typeParameterIndex) private voidanalyzeMethod(ClassContext classContext, org.apache.bcel.classfile.Method method) private IncompatibleTypescompareTypeParameters(GenericObjectType parmGeneric, GenericObjectType argGeneric) private IncompatibleTypescompareTypes(org.apache.bcel.generic.Type expectedType, org.apache.bcel.generic.Type actualType, boolean ignoreBaseType) Compare to see if the argumentargTypepassed to the method matches the type of the corresponding parameter.private booleancompareTypesOld(org.apache.bcel.generic.Type parmType, org.apache.bcel.generic.Type argType) private booleanisGenericCollection(ClassDescriptor operandClass) private booleanisSynthetic(org.apache.bcel.classfile.Method m) Methods marked with the "Synthetic" attribute do not appear in the source codebooleanprescreen(ClassContext classContext, org.apache.bcel.classfile.Method method) Use this to screen out methods that do not contain invocations.voidreport()EmptyvoidvisitClassContext(ClassContext classContext) Visit the class context
-
Field Details
-
bugReporter
-
DEBUG
private static final boolean DEBUG -
callMap
Map classname, methodname and signature to an int []. Each position in the int [] corresponds to an argument in the methodSignature. For each argument i, the value at position i corresponds to the index of the corresponding type in the class type parameters. If the argument has no correspondence, then the value is -1.Get the String key by calling getCollectionsMapKey()
-
baseGenericTypes
-
-
Constructor Details
-
FindUnrelatedTypesInGenericContainer
-
-
Method Details
-
addCheckedCall
private void addCheckedCall(@DottedClassName String className, String methodName, String sig, int argumentParameterIndex, int typeParameterIndex) -
addCheckedCall
private void addCheckedCall(@DottedClassName String className, String methodName, int typeParameterIndex) -
visitClassContext
Visit the class context- Specified by:
visitClassContextin interfaceDetector- Parameters:
classContext- the ClassContext- See Also:
-
prescreen
Use this to screen out methods that do not contain invocations. -
isSynthetic
private boolean isSynthetic(org.apache.bcel.classfile.Method m) Methods marked with the "Synthetic" attribute do not appear in the source code -
isGenericCollection
-
analyzeMethod
private void analyzeMethod(ClassContext classContext, org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException -
compareTypes
private IncompatibleTypes compareTypes(org.apache.bcel.generic.Type expectedType, org.apache.bcel.generic.Type actualType, boolean ignoreBaseType) Compare to see if the argumentargTypepassed to the method matches the type of the corresponding parameter. The simplest case is when both are equal.This is a conservative comparison - returns true if it cannot decide. If the parameter type is a type variable (e.g.
T) then we don't know enough (yet) to decide if they do not match so return true.- Parameters:
ignoreBaseType- TODO
-
compareTypeParameters
private IncompatibleTypes compareTypeParameters(GenericObjectType parmGeneric, GenericObjectType argGeneric) -
compareTypesOld
private boolean compareTypesOld(org.apache.bcel.generic.Type parmType, org.apache.bcel.generic.Type argType) -
report
-