Package edu.umd.cs.findbugs.detect
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 BugReporter
private final MultiMap
<String, FindUnrelatedTypesInGenericContainer.Info> Map classname, methodname and signature to an int [].private static final boolean
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addCheckedCall
(String className, String methodName, int typeParameterIndex) private void
addCheckedCall
(String className, String methodName, String sig, int argumentParameterIndex, int typeParameterIndex) private void
analyzeMethod
(ClassContext classContext, org.apache.bcel.classfile.Method method) private IncompatibleTypes
compareTypeParameters
(GenericObjectType parmGeneric, GenericObjectType argGeneric) private IncompatibleTypes
compareTypes
(org.apache.bcel.generic.Type expectedType, org.apache.bcel.generic.Type actualType, boolean ignoreBaseType) Compare to see if the argumentargType
passed to the method matches the type of the corresponding parameter.private boolean
compareTypesOld
(org.apache.bcel.generic.Type parmType, org.apache.bcel.generic.Type argType) private boolean
isGenericCollection
(ClassDescriptor operandClass) private boolean
isSynthetic
(org.apache.bcel.classfile.Method m) Methods marked with the "Synthetic" attribute do not appear in the source codeboolean
prescreen
(ClassContext classContext, org.apache.bcel.classfile.Method method) Use this to screen out methods that do not contain invocations.void
report()
Emptyvoid
visitClassContext
(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:
visitClassContext
in 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 argumentargType
passed 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
public void report()Empty
-