Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 439949

Summary: AdaptableTypeListener$AdaptableMembersInjector may be exercised before having been injected
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2014-07-20 05:35:59 EDT
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
Comment 1 Alexander Nyßen CLA 2014-07-20 06:17:06 EDT
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.