Class ManualFieldPolicy
- java.lang.Object
-
- com.ibm.wala.demandpa.alg.refinepolicy.ManualFieldPolicy
-
- All Implemented Interfaces:
FieldRefinePolicy
- Direct Known Subclasses:
ContainersFieldPolicy
public class ManualFieldPolicy extends Object implements FieldRefinePolicy
Manually annotated policy for refining field accesses.
-
-
Field Summary
Fields Modifier and Type Field Description protected Pattern
refinePattern
-
Constructor Summary
Constructors Constructor Description ManualFieldPolicy(IClassHierarchy cha, Pattern refinePattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHistory()
boolean
nextPass()
boolean
shouldRefine(IField field, PointerKey basePtr, PointerKey val, IFlowLabel label, StateMachine.State state)
-
-
-
Field Detail
-
refinePattern
protected final Pattern refinePattern
-
-
Constructor Detail
-
ManualFieldPolicy
public ManualFieldPolicy(IClassHierarchy cha, Pattern refinePattern)
- Parameters:
refinePattern
- a pattern for detecting which match edges to refine. If the declaring class of the field related to the match edge matches the pattern, the match edge will be refined. For example, the patternPattern.compile("Ljava/util")
will cause all fields of classes in thejava.util
package to be refined.
-
-
Method Detail
-
shouldRefine
public boolean shouldRefine(IField field, PointerKey basePtr, PointerKey val, IFlowLabel label, StateMachine.State state)
- Specified by:
shouldRefine
in interfaceFieldRefinePolicy
- Parameters:
field
- the accessed fieldbasePtr
- the base pointer of the access- Returns:
true
if match edges for the field access should be refined. Otherwise,false
is returned, indicating that the field can be handled with match edges.
-
nextPass
public boolean nextPass()
- Specified by:
nextPass
in interfaceFieldRefinePolicy
- Returns:
true
if more refinement can be done, and hence another pass can be attempted;false
otherwise
-
getHistory
public String getHistory()
- Returns:
- a String representation of the decisions made by this
-
-