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

Fix some spotbugs findings #6442

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

chrisrueger
Copy link
Contributor

I just ran spotbugs on libg and bndlib and checked for a few low hanging fruits like dead store variables.

Bug: aQute.bnd.osgi.Processor$Bracket needs to be _static_ to avoid a deadly embrace with aQute.bnd.osgi.Processor.bracket
This class is an inner class, but should probably be a static inner class. As it is, there is a serious danger of a deadly embrace between the inner class and the thread local in the outer class. Because the inner class isn't static, it retains a reference to the outer class. If the thread local contains a reference to an instance of the inner class, the inner and outer instance will both be reachable and not eligible for garbage collection.

Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
@chrisrueger chrisrueger marked this pull request as ready for review January 23, 2025 18:36
@pkriens pkriens merged commit 43d9fe8 into bndtools:master Jan 24, 2025
9 checks passed
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 this pull request may close these issues.

2 participants