Skip to content

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 <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
@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