Class FieldAccess
java.lang.Object
edu.umd.cs.findbugs.ba.bcp.PatternElement
edu.umd.cs.findbugs.ba.bcp.SingleInstruction
edu.umd.cs.findbugs.ba.bcp.FieldAccess
Base class for Load and Store PatternElements. Handles some of the grunt work
of representing fields and extracting field values from the stack frame.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFieldAccess(String fieldVarName, String valueVarName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected MatchResultcheckConsistent(Variable field, Variable value, BindingSet bindingSet) Check that the Variables determined for the field and the value loaded/stored are consistent with previous variable definitions.protected static booleanisLongOrDouble(org.apache.bcel.generic.FieldInstruction fieldIns, org.apache.bcel.generic.ConstantPoolGen cpg) Return whether the given FieldInstruction accesses a long or double field.protected static VariablesnarfFieldValue(org.apache.bcel.generic.FieldInstruction fieldIns, org.apache.bcel.generic.ConstantPoolGen cpg, ValueNumberFrame frame) Get a Variable representing the stack value which will either be stored into or loaded from a field.Methods inherited from class SingleInstruction
acceptBranch, maxOccur, minOccurMethods inherited from class PatternElement
addOrCheckDefinition, allowTrailingEdges, dominatedBy, getDominatedBy, getLabel, getNext, label, lookup, match, setAllowTrailingEdges, setIndex, setNext, toString
-
Field Details
-
fieldVarName
-
valueVarName
-
-
Constructor Details
-
FieldAccess
-
-
Method Details
-
checkConsistent
Check that the Variables determined for the field and the value loaded/stored are consistent with previous variable definitions.- Parameters:
field- Variable representing the fieldvalue- Variable representing the value loaded/storedbindingSet- previous definitions- Returns:
- a MatchResult containing an updated BindingSet if successful, or null if unsuccessful
-
isLongOrDouble
protected static boolean isLongOrDouble(org.apache.bcel.generic.FieldInstruction fieldIns, org.apache.bcel.generic.ConstantPoolGen cpg) Return whether the given FieldInstruction accesses a long or double field.- Parameters:
fieldIns- the FieldInstructioncpg- the ConstantPoolGen for the method
-
snarfFieldValue
protected static Variable snarfFieldValue(org.apache.bcel.generic.FieldInstruction fieldIns, org.apache.bcel.generic.ConstantPoolGen cpg, ValueNumberFrame frame) throws DataflowAnalysisException Get a Variable representing the stack value which will either be stored into or loaded from a field.- Parameters:
fieldIns- the FieldInstruction accessing the fieldcpg- the ConstantPoolGen for the methodframe- the ValueNumberFrame containing the value to be stored or the value loaded- Throws:
DataflowAnalysisException
-