Class PurityChecker.PurityResult
java.lang.Object
org.checkerframework.dataflow.util.PurityChecker.PurityResult
- Enclosing class:
- PurityChecker
Result of the
PurityChecker
. Can be queried regarding whether a given tree was
side-effect-free, deterministic, or both; also gives reasons if the answer is "no".-
Field Summary
Modifier and TypeFieldDescriptionContains all the varieties of purity that the expression has.Reasons that the referenced method is not side-effect-free and deterministic.Reasons that the referenced method is not deterministic.Reasons that the referenced method is not side-effect-free. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotBothReason
(Tree t, String msgId) Add a reason why the method is not both side-effect-free and deterministic.void
addNotDetReason
(Tree t, String msgId) Add a reason why the method is not deterministic.void
addNotSEFreeReason
(Tree t, String msgId) Add a reason why the method is not side-effect-free.getKinds()
Return the kinds of purity that the method has.Get the reasons why the method is not both side-effect-free and deterministic.Get the reasons why the method is not deterministic.Get the reasons why the method is not side-effect-free.boolean
Is the method pure w.r.t.toString()
-
Field Details
-
notSEFreeReasons
Reasons that the referenced method is not side-effect-free. -
notDetReasons
Reasons that the referenced method is not deterministic. -
notBothReasons
Reasons that the referenced method is not side-effect-free and deterministic. -
kinds
Contains all the varieties of purity that the expression has. Starts out with all varieties, and elements are removed from it as violations are found.
-
-
Constructor Details
-
PurityResult
public PurityResult()
-
-
Method Details
-
getKinds
Return the kinds of purity that the method has.- Returns:
- the kinds of purity that the method has
-
isPure
Is the method pure w.r.t. a given set of kinds?- Parameters:
otherKinds
- the varieties of purity to check- Returns:
- true if the method is pure with respect to all the given kinds
-
getNotSEFreeReasons
Get the reasons why the method is not side-effect-free.- Returns:
- the reasons why the method is not side-effect-free
-
addNotSEFreeReason
Add a reason why the method is not side-effect-free.- Parameters:
t
- a treemsgId
- why the tree is not side-effect-free
-
getNotDetReasons
Get the reasons why the method is not deterministic.- Returns:
- the reasons why the method is not deterministic
-
addNotDetReason
Add a reason why the method is not deterministic.- Parameters:
t
- a treemsgId
- why the tree is not deterministic
-
getNotBothReasons
Get the reasons why the method is not both side-effect-free and deterministic.- Returns:
- the reasons why the method is not both side-effect-free and deterministic
-
addNotBothReason
Add a reason why the method is not both side-effect-free and deterministic.- Parameters:
t
- treemsgId
- why the tree is not deterministic and side-effect-free
-
toString
-