Package edu.umd.cs.findbugs.detect
Class RedundantConditions
- java.lang.Object
-
- edu.umd.cs.findbugs.detect.RedundantConditions
-
- All Implemented Interfaces:
Detector
,Priorities
public class RedundantConditions extends java.lang.Object implements Detector
-
-
Field Summary
Fields Modifier and Type Field Description private BugAccumulator
bugAccumulator
private BugReporter
bugReporter
-
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description RedundantConditions(BugReporter bugReporter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.apache.bcel.generic.InstructionHandle
getConsumer(org.apache.bcel.generic.MethodGen methodGen, org.apache.bcel.generic.InstructionHandle start)
private int
getIntValue(org.apache.bcel.generic.InstructionHandle handle)
private int
getPriority(MethodDescriptor methodDescriptor, ValueRangeAnalysisFactory.RedundantCondition condition)
private java.lang.String
normalize(java.lang.String condition)
void
report()
This method is called after all classes to be visited.void
visitClassContext(ClassContext classContext)
Visit the ClassContext for a class which should be analyzed for instances of bug patterns.
-
-
-
Field Detail
-
bugAccumulator
private final BugAccumulator bugAccumulator
-
bugReporter
private final BugReporter bugReporter
-
-
Constructor Detail
-
RedundantConditions
public RedundantConditions(BugReporter bugReporter)
-
-
Method Detail
-
visitClassContext
public void visitClassContext(ClassContext classContext)
Description copied from interface:Detector
Visit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContext
in interfaceDetector
- Parameters:
classContext
- the ClassContext
-
normalize
private java.lang.String normalize(java.lang.String condition)
-
getPriority
private int getPriority(MethodDescriptor methodDescriptor, ValueRangeAnalysisFactory.RedundantCondition condition)
-
getConsumer
private org.apache.bcel.generic.InstructionHandle getConsumer(org.apache.bcel.generic.MethodGen methodGen, org.apache.bcel.generic.InstructionHandle start)
- Parameters:
methodGen
- methodstart
- instruction to scan- Returns:
- instruction which consumes value which was on top of stack before start instruction or null if cannot be determined
-
getIntValue
private int getIntValue(org.apache.bcel.generic.InstructionHandle handle)
-
-