Class ValueRangeAnalysisFactory
java.lang.Object
edu.umd.cs.findbugs.classfile.engine.bcel.ValueRangeAnalysisFactory
- All Implemented Interfaces:
IAnalysisEngine<MethodDescriptor, ValueRangeAnalysisFactory.ValueRangeAnalysis>, IMethodAnalysisEngine<ValueRangeAnalysisFactory.ValueRangeAnalysis>
public class ValueRangeAnalysisFactory
extends Object
implements IMethodAnalysisEngine<ValueRangeAnalysisFactory.ValueRangeAnalysis>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classstatic classstatic classprivate static classprivate static classstatic classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<String, ValueRangeAnalysisFactory.TypeLongRange> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanalyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) Perform an analysis on class or method named by given descriptor.private static StringconvertNumber(long val) private static StringconvertNumber(String signature, Number number) private intfindEndOfAssertBlock(org.apache.bcel.generic.InstructionHandle ih) Expecting an assert block to look like this:6 getstatic ghIssues.Issue608.$assertionsDisabled : boolean [7]
9 ifne 0
12 iload_1 [i] // Loading some variable named "i"
13 bipush 12 // Loading a constant 12
15 if_icmplt 0 // Comparing i and 12
18 new java.lang.AssertionError [13]
21 dup
22 ldc invalid input: '<'String "assertion failure message"> [15]
24 invokespecial java.lang.AssertionError(java.lang.Object) [17]
27 athrow
private static LocationgetLocation(BasicBlock block) private static Map<Integer, ValueRangeAnalysisFactory.Value> getParameterTypes(MethodDescriptor descriptor) voidregisterWith(IAnalysisCache analysisCache) Register the analysis engine with given analysis cache.private static voidwalkCFG(CFG cfg, ValueRangeAnalysisFactory.LongRangeSet subRange, Map<Edge, ValueRangeAnalysisFactory.Branch> edges, BitSet reachedBlocks)
-
Field Details
-
typeRanges
-
-
Constructor Details
-
ValueRangeAnalysisFactory
public ValueRangeAnalysisFactory()
-
-
Method Details
-
analyze
public ValueRangeAnalysisFactory.ValueRangeAnalysis analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException Description copied from interface:IAnalysisEnginePerform an analysis on class or method named by given descriptor.- Specified by:
analyzein interfaceIAnalysisEngine<MethodDescriptor, ValueRangeAnalysisFactory.ValueRangeAnalysis>- Parameters:
analysisCache- the analysis cachedescriptor- the descriptor of the class or method to be analyzed- Returns:
- the result of the analysis of the class or method
- Throws:
CheckedAnalysisException
-
findEndOfAssertBlock
private int findEndOfAssertBlock(org.apache.bcel.generic.InstructionHandle ih) Expecting an assert block to look like this:6 getstatic ghIssues.Issue608.$assertionsDisabled : boolean [7]
9 ifne 0
12 iload_1 [i] // Loading some variable named "i"
13 bipush 12 // Loading a constant 12
15 if_icmplt 0 // Comparing i and 12
18 new java.lang.AssertionError [13]
21 dup
22 ldc invalid input: '<'String "assertion failure message"> [15]
24 invokespecial java.lang.AssertionError(java.lang.Object) [17]
27 athrow
- Parameters:
ih- The InstructionHandle corresponding to theifne 0in the above sample- Returns:
- The position for the final
athrow
-
getLocation
-
convertNumber
-
convertNumber
-
getParameterTypes
private static Map<Integer, ValueRangeAnalysisFactory.Value> getParameterTypes(MethodDescriptor descriptor) -
walkCFG
private static void walkCFG(CFG cfg, ValueRangeAnalysisFactory.LongRangeSet subRange, Map<Edge, ValueRangeAnalysisFactory.Branch> edges, BitSet reachedBlocks) -
registerWith
Description copied from interface:IAnalysisEngineRegister the analysis engine with given analysis cache.- Specified by:
registerWithin interfaceIAnalysisEngine<MethodDescriptor, ValueRangeAnalysisFactory.ValueRangeAnalysis>- Parameters:
analysisCache- the analysis cache
-