Recaf
Recaf copied to clipboard
Adapt all Dependent injections in Application/Workspace scoped types
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<MappingGeneratorPane>
- The
AntiDecompilationSummarizerclass isApplicationScoped - Generated values from the
Instance<MappingGeneratorPane>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 theDependentscope.