Adapt all Dependent injections in Application scoped types + builders
- Dominant language
- Java
- Stars
- 7.4k
- Forks
- 538
- PR merge metrics
- No merged PRs in 30d
Description
Background: https://rmannibucau.wordpress.com/2015/03/02/cdi-and-instance-3-pitfalls-you-need-to-know/
A recent example of the problem can be found in f1da92e8fc8fca95339a154792b15607c353e8e5 - Where `AntiDecompilationSummarizer` defines a `Instance`
- The `AntiDecompilationSummarizer` class is `ApplicationScoped`
- Generated values from the `Instance` were not being "destroyed" in the container, thus leading to leakage issues
- Calling `generatorPaneProvider.destroy(value)` addresses the issue, but this needs to be handled in all similar cases. Something more automatic would be ideal. In our usage of dependent. If we can automatically call destroy so that the CDI won't prevent garbage collection, while still ensuring the generated beans have access to injected services that would be great. Otherwise we can probably re-create the `Dependent` scope.
Contributor guide
Assessment
This issue has not been assessed yet.