Community
Participate
Working Groups
I ended up in a drag state with the green cursor prepared to drop my view in the same stack (different location). I hit ESC to cancel the drag operation. It NPEed. eclipse.buildId=I20110307-2200 java.fullversion=JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr9-20101124_69295 (JIT enabled, AOT enabled) J9VM - 20101124_069295 JIT - r9_20101028_17488ifx2 GC - 20101027_AA BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 -data /opt/pwebster/workspaces/e4 Error Wed Mar 09 08:58:06 EST 2011 Internal Error java.lang.NullPointerException at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1271) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294) at org.eclipse.swt.widgets.Widget.gtk_key_release_event(Widget.java:736) at org.eclipse.swt.widgets.Tracker.open(Tracker.java:728) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.startDrag(DnDManager.java:232) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3.handleEvent(DnDManager.java:110) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1525) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3568) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3189) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:842) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:758) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:542) 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:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) 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)
I can investigate this problem.
Created attachment 190856 [details] Proposed patch for Windows While trying to reproduce this on Windows, I encountered different NPE stack when a view is dropped and Esc key is pressed immediately. ------------------- java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.finishDrag(DnDManager.java:261) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.startDrag(DnDManager.java:233) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3.handleEvent(DnDManager.java:110) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:842) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:758) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) ------------------- We have 2 events here - view is dropped, and Esc key is pressed. After the 1st event, SplitDropAgent accepts the drop and calls for dndManager.update() while docking the view. Due to the above update call, it tries to process the pending Esc key on tracker and thus, it set the dragAgent to null after it finishes the drag. Thus, the remaining 1st event encounters NPE due to the null value of dragAgent. The fix is to remove the keyFilter after the tracker is dropped/opened. Add the filter back after we perform the dragFinish. The attached patch contain these changes to fix this problem.
Created attachment 191016 [details] Slight revision to your patch Praveen, welcome !! and thanks for the patch... Here's a minor revision based on the idea that the ESC listener is not necessary unless we're in the dragging loop. What do you think ?
Note that either fix is better than what's there I think but we're going to be reviewing this post-M6. Right now we're breaking the API contract with the SWT Tracker by spinning the event loop while the tracker is open (almost certainly the cause of Paul's issue). It spins a specialized event loop and will capture ESC and return false but we've already eaten the char in our listener. We should either stop using the tracker or stop spinning the event loop...
Created attachment 191297 [details] Patch for Linux In Linux, tracker has its own event loop to process the events based on it. Due to this, Esc key is processed by tracker and then it is disposed. The existing mouseMoveListener unaware of this, tries to finish the processing of the existing drag event and then, hits with NPE. The proposed fix is to check null for tracker after tracker.open is returned.
I am using direct editing of text within the GEF framework under Eclipse 3.6.1. I got a NPE here: java.lang.NullPointerException at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1271) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263) at org.eclipse.swt.widgets.Control.setBounds(Control.java:881) at org.eclipse.swt.widgets.Control.setSize(Control.java:1065) I get this only under Linux. Under Windows it works fine.
WORKSFORME in Luna. Please reopen if you still see this issue.