Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339787 - BindingServiceImpl.deactivateBinding produces a NPE
Summary: BindingServiceImpl.deactivateBinding produces a NPE
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 4.1 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-12 07:40 EST by Thomas Schindl CLA
Modified: 2011-03-12 12:50 EST (History)
2 users (show)

See Also:


Attachments
Patch (832 bytes, patch)
2011-03-12 07:41 EST, Thomas Schindl CLA
no flags Details | Diff
Patch (1.03 KB, patch)
2011-03-12 07:49 EST, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2011-03-12 07:40:03 EST
!ENTRY org.eclipse.e4.ui.workbench 2 0 2011-03-12 13:32:49.306
!MESSAGE Exception occurred during CocoaUI processing
!STACK 0
java.lang.NullPointerException
	at org.eclipse.e4.ui.bindings.internal.BindingServiceImpl.deactivateBinding(BindingServiceImpl.java:91)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.addCloseDialogBinding(CocoaUIHandler.java:432)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.access$8(CocoaUIHandler.java:424)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler$1.run(CocoaUIHandler.java:319)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4599)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.init(CocoaUIHandler.java:285)
	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)
	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.ui.internal.Workbench$3.run(Workbench.java:531)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:524)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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)
Comment 1 Thomas Schindl CLA 2011-03-12 07:41:29 EST
Created attachment 191044 [details]
Patch

There is already a null check but and we log informations but we then proceed which is not correct because this MUST by defintion lead to a NPE. This patch adds a return
Comment 2 Thomas Schindl CLA 2011-03-12 07:49:10 EST
Same is true for activate:


!ENTRY org.eclipse.e4.ui.workbench 2 0 2011-03-12 13:48:05.679
!MESSAGE Exception occurred during CocoaUI processing
!STACK 0
java.lang.NullPointerException
	at org.eclipse.e4.ui.bindings.internal.BindingServiceImpl.activateBinding(BindingServiceImpl.java:75)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.addCloseDialogBinding(CocoaUIHandler.java:433)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.access$8(CocoaUIHandler.java:424)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler$1.run(CocoaUIHandler.java:319)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4599)
	at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.init(CocoaUIHandler.java:285)
	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)
	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.ui.internal.Workbench$3.run(Workbench.java:531)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:524)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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)
Comment 3 Thomas Schindl CLA 2011-03-12 07:49:29 EST
Created attachment 191045 [details]
Patch
Comment 4 Thomas Schindl CLA 2011-03-12 11:26:00 EST
i released the fix to head
Comment 5 Brian de Alwis CLA 2011-03-12 12:50:55 EST
I fixed this issue on February 16, but it was removed in Paul's change for bug 335985 committed on March 8.  I'm guessing Paul didn't update before making the fix?