Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Purity checker] Purity checker does not run as expected #760

Open
Ao-senXiong opened this issue May 5, 2024 · 0 comments
Open

[Purity checker] Purity checker does not run as expected #760

Ao-senXiong opened this issue May 5, 2024 · 0 comments

Comments

@Ao-senXiong
Copy link
Member

commands:

java -jar checker/dist/checker.jar -processor org.checkerframework.framework.util.PurityChecker Demo.java

Input:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant