Community
Participate
Working Groups
I20111004-2000 !ENTRY org.eclipse.e4.ui.workbench 4 0 2011-10-06 08:18:30.742 !MESSAGE Internal Error !STACK 0 java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3$1.run(DnDManager.java:172) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3.handleEvent(DnDManager.java:156) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Tracker.wmMouse(Tracker.java:1169) at org.eclipse.swt.widgets.Tracker.open(Tracker.java:582) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.startDrag(DnDManager.java:199) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$1$1.dragDetected(DnDManager.java:109) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:127) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:972) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:888) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:90) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:565) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:520) 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:352) 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:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579) at org.eclipse.equinox.launcher.Main.run(Main.java:1431) at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
Happened while dragging the Package Explorer around in a new workspace.
Can you remember where the cursor was when the NPE occurred (in the shared area, another stack, outside the WBW) ? I'm just trying to gather enough info to reproduce this, I've been unsuccessful so far...
(In reply to comment #2) > Can you remember where the cursor was when the NPE occurred (in the shared > area, another stack, outside the WBW) ? No, sorry. I also quickly tried to reproduce it now - but no "luck".
Created attachment 206033 [details] Stack from when I encountered this problem I just ran into the same NPE myself when using I20111025-2000. The stack trace looks similar and is attached. In my case I had two stacked Java editors and dragged one of the editors to be to the left of the other so that after the operation each editor would be half the size it was before and tiled instead of stacked. The NPE showed up after I released the mouse. I tried again a few times and could not reproduce.
I have some more information about this bug, which I started to look into in the debugger and by adding trace statements. It is not easy to reproduce but if you attempt enough window moves you will hit it sooner or later. The NPE in DnDManager.java line 172 is happening because dragAgent is null. I added some println statements and determined that dragAgent is being set to null on the third line of DnDManager.startDrag(DragDetectEvent): protected void startDrag(DragDetectEvent e) { info.update(e); dragAgent = getDragAgent(info); After dragAgent has been set to null the anonymous listener for the SWT.Move event gets an NPE when it tries to handle an event. So the sequence was 1. startDrag() is called and getDragAgent() returns a non null value. 2. startDrag() is called again and getDragAgent() returns a null value. 3. The EventHandler created during the first call to startDrag recieves an event and dragAgent is now null, causing an NPE. The underlying problem is that startDrag() is using instance variables rather than local variables, and referencing those instance variables in a handler. I will attach a patch with a suggested fix
Created attachment 206089 [details] Suggested fix This patch will eliminate this NPE by using a local variable rather than an instance variable for dragAgent. Someone who is familiar with this code should review this to see if this is the correct solution. Note that there are other instance variables in DnDManager which should be checked to see if they could cause reentrancy problems.
Chris, thanks (a lot!) for looking into this, we've had this spurious effect for some time... I'll take a look at the patch once M3 goes out (actually after I get back next week...'-)
I20111205-2330 Line numbers are different but I guess it's the same problem. java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3$1.run(DnDManager.java:170) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$3.handleEvent(DnDManager.java:154) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Tracker.wmMouse(Tracker.java:1169) at org.eclipse.swt.widgets.Tracker.open(Tracker.java:582) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.startDrag(DnDManager.java:197) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$1$1.dragDetected(DnDManager.java:109) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:127)
Sheesh, sorry folks...this dropped off my radar. I've tagged it for M5 and thanks again for the patch !
I'm seeing this too in a recent 4.2 build.
(In reply to comment #9) > Sheesh, sorry folks...this dropped off my radar. I've tagged it for M5 and > thanks again for the patch ! I encountered this dragging around the debug view in I20120125-2200
Just encountered in 4.2M6.
Sheesh...was hoping that this had been fixed by the changes I made for dragging trim...Brian, any particulars about what you were doing? I'm trying to get a handle on how I can consistently repro this one...
(In reply to comment #13) > Sheesh...was hoping that this had been fixed by the changes I made for dragging > trim...Brian, any particulars about what you were doing? I'm trying to get a > handle on how I can consistently repro this one... Just reproduced in: Version: 4.2.0 Build id: I20120321-0610 java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$4$1.run(DnDManager.java:183) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$4.handleEvent(DnDManager.java:180) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Tracker.wmMouse(Tracker.java:1169) at org.eclipse.swt.widgets.Tracker.open(Tracker.java:582) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager.startDrag(DnDManager.java:200) at org.eclipse.e4.ui.workbench.addons.dndaddon.DnDManager$1.dragDetected(DnDManager.java:83) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:127) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1016) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:910) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:580)
Steps to reproduce: 1. open Java perspective or reset it 2. Click + drag in the editor area like you were selecting a block of text (but no editor is open) 3. grab the Package Explorer and drag it over to the editor area 4. drop it and immediately start another click+drag like step 2. You will then get the NPE I pasted in comment #14
Mike, when you dragged the Package Explorer where did you drop it in the editor area (i.e. split to the left, above ...? or into the tabs area of the stack ? I just tried to repro this and couldn't get it to happen (but I've been working on the DnD for a few days now so MMMV...
(In reply to comment #16) > Mike, when you dragged the Package Explorer where did you drop it in the editor > area (i.e. split to the left, above ...? or into the tabs area of the stack ? > > I just tried to repro this and couldn't get it to happen (but I've been working > on the DnD for a few days now so MMMV... I dropped it in the editor area, it didn't matter where. The key to reproduce is to start another drag really fast after you drop the view.
Thanks Mike, once I get the 'edge' dragging working (finally!) I'll take a look at this. I think I have a possible solution; I'll 'defer' the execution of the actual 'drop' operation until after the previous DnD has been completely torn down (so you won't be able to start another drag while a previous one is finishing).
I'll defer this for now. I'll be beating on the DnD over the M7 testing period and if I trip over it I may move it back to an RC milestone...
*** Bug 367948 has been marked as a duplicate of this bug. ***
*** Bug 367127 has been marked as a duplicate of this bug. ***
(In reply to Michael Rennie from comment #15) > Steps to reproduce: > > 1. open Java perspective or reset it > 2. Click + drag in the editor area like you were selecting a block of text > (but no editor is open) > 3. grab the Package Explorer and drag it over to the editor area > 4. drop it and immediately start another click+drag like step 2. > > You will then get the NPE I pasted in comment #14 I tried this an was unable to get the NPE in Luna. Can you please retest and see if you still get this error with NPE?
(In reply to Lars Vogel from comment #22) > (In reply to Michael Rennie from comment #15) > > Steps to reproduce: > > > > 1. open Java perspective or reset it > > 2. Click + drag in the editor area like you were selecting a block of text > > (but no editor is open) > > 3. grab the Package Explorer and drag it over to the editor area > > 4. drop it and immediately start another click+drag like step 2. > > > > You will then get the NPE I pasted in comment #14 > > I tried this an was unable to get the NPE in Luna. Can you please retest and > see if you still get this error with NPE? I can no longer reproduce it in 4.4 or 4.5.