import org.checkerframework.dataflow.qual.Pure;
public class Demo {
Object field;;
@Pure
public void impureMethod() {
field = new Object();
}
@Pure
public Object pureMethod() {
return field;
}
}
Outputs:
Pass without issue error
Expectation:
Error on impuremethod.
Apply -AcheckPurityAnnotations will successfully issue the error. However, run PurityChecker directly should not need the flag.
Think about how to enable it by default and add some test suite.
commands:
Input:
Outputs: Pass without issue error
Expectation: Error on impuremethod.
Apply
-AcheckPurityAnnotations
will successfully issue the error. However, run PurityChecker directly should not need the flag. Think about how to enable it by default and add some test suite.