Package edu.umd.cs.findbugs
Class SloppyBugComparator
- java.lang.Object
-
- edu.umd.cs.findbugs.SloppyBugComparator
-
- All Implemented Interfaces:
WarningComparator
,java.io.Serializable
,java.util.Comparator<BugInstance>
public class SloppyBugComparator extends java.lang.Object implements WarningComparator
Very sloppy bug comparator: if the warnings are of the same type, and in the same class/method/field, assume they are the same.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ClassNameRewriter
classNameRewriter
private static boolean
DEBUG
-
Constructor Summary
Constructors Constructor Description SloppyBugComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(BugInstance lhs, BugInstance rhs)
private int
compareClassesAllowingNull(ClassAnnotation lhs, ClassAnnotation rhs)
Compare class annotations.private int
compareFieldsAllowingNull(FieldAnnotation lhs, FieldAnnotation rhs)
private int
compareMethodsAllowingNull(MethodAnnotation lhs, MethodAnnotation rhs)
private int
compareNullElements(java.lang.Object lhs, java.lang.Object rhs)
private FieldAnnotation
convertField(FieldAnnotation fieldAnnotation)
private MethodAnnotation
convertMethod(MethodAnnotation methodAnnotation)
void
setClassNameRewriter(ClassNameRewriter classNameRewriter)
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
-
classNameRewriter
private ClassNameRewriter classNameRewriter
-
-
Method Detail
-
setClassNameRewriter
public void setClassNameRewriter(ClassNameRewriter classNameRewriter)
- Specified by:
setClassNameRewriter
in interfaceWarningComparator
-
compareNullElements
private int compareNullElements(java.lang.Object lhs, java.lang.Object rhs)
-
compareClassesAllowingNull
private int compareClassesAllowingNull(ClassAnnotation lhs, ClassAnnotation rhs)
Compare class annotations.- Parameters:
lhs
- left hand class annotationrhs
- right hand class annotation- Returns:
- comparison of the class annotations
-
compareMethodsAllowingNull
private int compareMethodsAllowingNull(MethodAnnotation lhs, MethodAnnotation rhs)
-
compareFieldsAllowingNull
private int compareFieldsAllowingNull(FieldAnnotation lhs, FieldAnnotation rhs)
-
convertMethod
private MethodAnnotation convertMethod(MethodAnnotation methodAnnotation)
-
convertField
private FieldAnnotation convertField(FieldAnnotation fieldAnnotation)
-
compare
public int compare(BugInstance lhs, BugInstance rhs)
- Specified by:
compare
in interfacejava.util.Comparator<BugInstance>
- Specified by:
compare
in interfaceWarningComparator
-
-