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 class
private static class
private static class
private static class
static class
static class
private static class
private static class
static class
private 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 String
convertNumber
(long val) private static String
convertNumber
(String signature, Number number) 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
private static Location
getLocation
(BasicBlock block) private static Map
<Integer, ValueRangeAnalysisFactory.Value> getParameterTypes
(MethodDescriptor descriptor) void
registerWith
(IAnalysisCache analysisCache) Register the analysis engine with given analysis cache.private static void
walkCFG
(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:IAnalysisEngine
Perform an analysis on class or method named by given descriptor.- Specified by:
analyze
in 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 0
in 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:IAnalysisEngine
Register the analysis engine with given analysis cache.- Specified by:
registerWith
in interfaceIAnalysisEngine<MethodDescriptor,
ValueRangeAnalysisFactory.ValueRangeAnalysis> - Parameters:
analysisCache
- the analysis cache
-