| Summary: | Adaptable scopes need to be maintained transitively by AdapterInjector. | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF Common | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.0.0 | ||
| Target Milestone: | 5.0.0 (Oxygen) M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Alexander Nyßen
It seems, AdaptableScopes.switchTo already switches to scopes transitively, so this is already covered. However, this is not performed in enter() and further, there should be no necessity within client code to enter scopes. It seems the client code calls are necessary to use adaptable scoping for normal Guice injection (i.e. not adapter injection). This can only be supported in any case, if member injection is used to inject, and the adaptable reference is established before. As such, the use case does not seem to be valid. I pushed the following changes to origin/master: - Ensured AdapterInjector enters and leaves adaptable scopes before and after injecting adapters. - Ensured AdapterScope enter and leave can not be performed by clients (reduced visibility of API). - Removed field injection test, which is no valid use case (it had applied adaptable scoping to a non-adapter instance). We now explicitly limit adaptable scopes to adapters, and this is checked within AdaptableScope. Resolving as fixed in 5.0.0 M3. Reopening, as this still does not seem to be working properly. Within the logo example, the ContentPartPool is not yet properly scoped. Reworked AdaptableScope and AdapterInjector and thereby resolved the following issues in addition: - Fixed that adapter injector did not infer injection until adaptable hierarchy was completely built. - Fixed that adapter injector lost certain bindings due to shadowing by equal keys (in the applicable bindings) - Ensured that adaptable scopes for an adaptable instance's type share the scoped instances. Confirmed that the ContentPartPool is now correctly scoped within the Logo example. Resolving as fixed in 5.0.0 M3. |