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

Further clean up qualifierdefaults #755

Open
Ao-senXiong opened this issue Apr 30, 2024 · 0 comments
Open

Further clean up qualifierdefaults #755

Ao-senXiong opened this issue Apr 30, 2024 · 0 comments

Comments

@Ao-senXiong
Copy link
Member

Ao-senXiong commented Apr 30, 2024

Resource leak checker is failing during the clean up in this PR #746
We used a ugly hacky way to make resource leak checker happy, see 56afa4e

Here is the minimal test case for it.

public class Test<S> {
    public S foo() {
        S s = joo(new A());
        return null;
    }

    public S joo(A b) {
        return null;
    }
}

class A{}
java -jar checker/dist/checker.jar -processor resourceleak Test.java
Test.java:3: error: [required.method.not.known] The checker cannot determine the must call methods of s or any of its aliases, so it could not determine if they were called. Typically, this error indicates that you need to write an @MustCall annotation (often on an unconstrained generic type).
        S s = joo(new A());
          ^
  The type of object is: S.
  Reason for going out of scope: regular method exit
1 error

Think about how to clean it up and why resource leak checker is failing by the change.

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