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

synchronized should be considered a dereference #1103

Closed
agrieve opened this issue Dec 20, 2024 · 0 comments · Fixed by #1106
Closed

synchronized should be considered a dereference #1103

agrieve opened this issue Dec 20, 2024 · 0 comments · Fixed by #1106

Comments

@agrieve
Copy link

agrieve commented Dec 20, 2024

(not very important bug figured it's worth an issue).

For the following code snippet:

        synchronized (sInstances) {
            manager = sInstances.get(registry);
            ...
        }

NullAway complains about the sInstances.get(), but it should complain about the synchronized (sInstances), since that's the first line that would throw a NPE if sInstances were null.

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

Successfully merging a pull request may close this issue.

1 participant