Community
Participate
Working Groups
We are not properly intializing the BindingSystem in a pure e4 application: org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:828) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:108) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:310) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:237) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:153) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:64) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:231) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:120) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: java.lang.NullPointerException at org.eclipse.e4.ui.bindings.internal.BindingCopies.isUserBinding(BindingCopies.java:64) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.createBinding(BindingProcessingAddon.java:247) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBinding(BindingProcessingAddon.java:212) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBindingTable(BindingProcessingAddon.java:202) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBindingTables(BindingProcessingAddon.java:185) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.init(BindingProcessingAddon.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) ... 23 more
... and because we are at it. This class is violating one of the highest design principles we've defined: Singleons and statics are evil! If there should be only one of this BindingCopies in a running instance I think we should push the thing into the IEclipseContext from the MApplication but we need to get rid of those statics!
Tom, this was a temporary class to get Keys preference page started. Jesse, I'll try and look at your patch tonight, but we have to get this bug fixed asap ... Please remove the init() calls from within head, and replace them with something like: list getUserBindings() { if (userBindings==null) { userBindings = new list; } return userBindings; } PW
Created attachment 191591 [details] Avoid the init call v01
Released to HEAD
Paul, is there a defect to remove this class completely or to get rid of the statics in it?
To remove it completely: bug 335985 PW
BindingCopies was temporary...and yes I know, it's a VERY bad design decision. It's been completely removed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=335985 but as it stands right now, only the default scheme will work.