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

Is the use of getClass in a final class an instance of LCK02J? #40

Open
reprogrammer opened this issue Nov 1, 2011 · 0 comments
Open
Labels
Milestone

Comments

@reprogrammer
Copy link
Owner

Since final classes cannot be subclassed, the use of the return value of getClass as a lock object inside a final class is safe. Anonymous classes are a special kind of final classes. So, the use of getClass inside an anonymous class is safe. If our detector reports too many false positives in these cases, we can have the detector check for these corner cases.

reprogrammer added a commit that referenced this issue Nov 1, 2011
The detector doesn't report a use of getClass inside an anonymous class as instance of LCK02J. However, it reports the use of getClass inside a final class as an instance of LCK02J.

This commit belongs to issue #40.
reprogrammer added a commit that referenced this issue Nov 5, 2011
This commit belongs to issue #40.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant