| Summary: | AdaptableTypeListener$AdaptableMembersInjector may be exercised before having been injected | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF MVC | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Changed that the injector gets passed in to the AdaptableTypeListener via method injection rather than field injection (which alone seems to fix the problem related to the FXRootPart injection). In addition implemented that member injection is deferred until the injector is eventually available. Pushed changes to origin/master. Resolving as fixed. |
In certain cases it might happen that the AdaptableMemberInjector within the AdaptableTypeListener has to inject members before the AdaptableTypeListener itself is injected (via the requestInjection() within the MvcModule). In such cases, the AdaptableMembersInjector has not obtained the Injector and may thus not retrieve any adapter bindings (an NPE is the result). This can be easily reproduced by changing MvcFxModule#bindFXRootPart() as follows: protected void bindFXRootPart() { FXRootPart rootPart = new FXRootPart(); binder().bind(new TypeLiteral<IRootPart<Node>>() {}).toInstance(rootPart); } It seems, the root cause for this is the following Guice issue: https://code.google.com/p/google-guice/issues/detail?id=409 A potential workaround is discussed here: https://groups.google.com/forum/#!topic/google-guice/gNMvh7oXvWs