Community
Participate
Working Groups
Build Identifier: 4.2M3 I am trying to use the Adapter service but I get a NPE in EclipseAdapter.lookupAdapterManager() From the source code in EclipseAdapter I can see that the contextSet method is never called and that probably the constructor should take the IEclipseContext as a parameter to be injected instead. In E4Application line 477 I can see that the EclipseAdapter is injected using: appContext.set(Adapter.class.getName(), ContextInjectionFactory.make(EclipseAdapter.class, appContext)); Reproducible: Always
The contextSet() was the early (pre-annotation) way to inject context, no longer supported. I changed EclipseAdapter to get context as a constructor argument. Also it turns out that org.eclipse.e4.core.services bundle where this class resides was compiled into Java 1.4 - compatible code removing "@Inject" annotation. That again is a resedue of the early attempts to be Foundation VM compatible. That no longer makes sense as contexts & DI require Java 1.5, so I changed the minimum executable environment of this bundle to 1.5 and updated its version and build properties while I was there. http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=0d6b2ff6c6b06bbd13e82cd6856f72d4f988ec36
Anders, could you verify that this fixed the problem for you?
I looked at your checkin and this will fix my problem. I am using milestone builds so I will work around this until 4.2M4.