Community
Participate
Eclipse IDE
I get the following NPE after doing these steps: - open the Java perspective - make a view a fastview - start dragging it, try to drop it on the bottom of the window so it takes the full width of the window. - NPE Looks related to the changes for standalone views, this part may not have a stack. We should check all other callers of this once we find the NPE. !ENTRY org.eclipse.ui 4 0 2005-09-22 14:09:47.664 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.PartSashContainer.drag(PartSashContainer.java :1034) at org.eclipse.ui.internal.dnd.DragUtil.getDropTarget(DragUtil.java:338) at org.eclipse.ui.internal.dnd.DragUtil.getDropTarget(DragUtil.java:361) at org.eclipse.ui.internal.dnd.DragUtil$2.run(DragUtil.java:217) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:152) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:2 8) at org.eclipse.swt.widgets.Display.syncExec(Display.java:3527) at org.eclipse.ui.internal.dnd.DragUtil$1.handleEvent(DragUtil.java:211) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:884) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:908) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:893) at org.eclipse.swt.widgets.Tracker.wmMouse(Tracker.java:1030) at org.eclipse.swt.widgets.Tracker.open(Tracker.java:509) at org.eclipse.ui.internal.dnd.DragUtil.dragToTarget(DragUtil.java:292) at org.eclipse.ui.internal.dnd.DragUtil.performDrag(DragUtil.java:124) at org.eclipse.ui.internal.FastViewBar.startDrag(FastViewBar.java:551) at org.eclipse.ui.internal.FastViewBar.startDraggingFastView(FastViewBar .java:527) at org.eclipse.ui.internal.FastViewBar$1.handleEvent(FastViewBar.java:10 6) at org.eclipse.ui.presentations.PresentationUtil.handleMouseMove(Present ationUtil.java:96) at org.eclipse.ui.presentations.PresentationUtil.access$4(PresentationUt il.java:89) at org.eclipse.ui.presentations.PresentationUtil$2.handleEvent(Presentat ionUtil.java:61) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:884) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3194) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2823) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1755) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1719) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a:368) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:10 6) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct ivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:377) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
I added 2 calls to PartPane#getStack() and didn't check for null. PW
This needs to be fixed for 3.1.1. It causes Linux to leave the mouse cursor as a drag cursor and the drag does not end. Requires killing the X Server.
Released for 3.1.1 >20050927. PW
Released to HEAD >20050927 PW
*** Bug 110761 has been marked as a duplicate of this bug. ***
Verified in M20050928-1055. PW
*** Bug 111682 has been marked as a duplicate of this bug. ***
I am getting a NPE in a similar case which seems to be introduced in 3.6M4 (3.5 works fine). I debugged a little bit and this could be a hint: In org.eclipse.ui.internal.FastViewPane.hideView(): [...] // Hide it completely. getPresentation().setVisible(false); site.dispose(); //currentPane.setFastViewSash(null); ctrl.setEnabled(false); // Remove focus support. currentPane.dispose(); currentPane = null; The call to getPresentation().setVisible(false) causes hideView to be called twice. The first time, everything goes fine, but the second time, currentPane is null and currentPane.dispose() will raise a NPE.
This is the stack trace: java.lang.NullPointerException at org.eclipse.ui.internal.FastViewPane.hideView(FastViewPane.java:582) at org.eclipse.ui.internal.Perspective.hideFastView(Perspective.java:571) at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1933) at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1952) at org.eclipse.ui.internal.Perspective.toggleFastView(Perspective.java:2355) at org.eclipse.ui.internal.WorkbenchPage.toggleFastView(WorkbenchPage.java:3873) at org.eclipse.ui.internal.WorkbenchPage.hideFastView(WorkbenchPage.java:3861) at org.eclipse.ui.internal.FastViewPane$2.setState(FastViewPane.java:95) at org.eclipse.ui.internal.FastViewPane$3.handleEvent(FastViewPane.java:306) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1240) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1049) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3931) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2407) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2371) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2220) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) 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:367) 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:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:611) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:566) at org.eclipse.equinox.launcher.Main.run(Main.java:1363) at org.eclipse.equinox.launcher.Main.main(Main.java:1339)
Created attachment 157881 [details] fast view bug project I have just run the mail demo and made the message view available as a fast view in the fast view bar: it cannot be moved due to this NPE. Just import the the project and run the INCLUDED launch as this will use the workbench ide.
Just downloaded 3.6M5 and imported the attached project and run the included launch config: bug persists.
Paul, since the stack trace is different, I guess maybe we should open a new bug instead of reopening this one?
(In reply to comment #12) > Paul, since the stack trace is different, I guess maybe we should open a new > bug instead of reopening this one? Yes, there have been changes in this code, please open a new bug. PW
I can also reproduce this bug in the final release of 3.6. Just try to drug a visible fast view. Is there a new bug for this? I couldn't find.
Check if (and make sure that) the view's setFocus method sets the focus to a control that is in your view... at least, leaving setFocus empty will lead to this bug in 3.6...
+1 for reopen. Tested in Eclipse 3.6.1. When setFocus() view's method is empty and after doing these steps: 1. Open Show View Dialog. 2. Open a View with a setFocus() method that is empty. 3. Try to drag it and it will "disappear".because of the NPE. The stack trace is: !ENTRY org.eclipse.ui 4 0 2011-01-10 15:39:59.769 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.FastViewPane.hideView(FastViewPane.java:582) at org.eclipse.ui.internal.Perspective.hideFastView(Perspective.java:571) at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1933) at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1952) at org.eclipse.ui.internal.Perspective.toggleFastView(Perspective.java:2365) at org.eclipse.ui.internal.WorkbenchPage.toggleFastView(WorkbenchPage.java:3873) at org.eclipse.ui.internal.WorkbenchPage.hideFastView(WorkbenchPage.java:3861) at org.eclipse.ui.internal.FastViewPane$2.dragStart(FastViewPane.java:156) at org.eclipse.ui.internal.FastViewPane$2.dragStart(FastViewPane.java:136) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:118) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:282) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.handleDragStarted(AbstractTabFolder.java:366) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder$2.handleEvent(AbstractTabFolder.java:67) at org.eclipse.ui.presentations.PresentationUtil.handleMouseMove(PresentationUtil.java:110) at org.eclipse.ui.presentations.PresentationUtil.access$4(PresentationUtil.java:95) at org.eclipse.ui.presentations.PresentationUtil$2.handleEvent(PresentationUtil.java:63) 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:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at net.sf.rcpforms.example.moons.core.Application.start(Application.java:20) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
(In reply to comment #16) > +1 for reopen. > > Tested in Eclipse 3.6.1. > When setFocus() view's method is empty and after doing these steps: > > 1. Open Show View Dialog. > 2. Open a View with a setFocus() method that is empty. Clients are expected to assign focus to one of its controls. Leaving this blank is going against the API.
(In reply to comment #16) > +1 for reopen. Different bug ... if this is a problem please open a new bug (as I mentioned). PW
(In reply to comment #17) > Clients are expected to assign focus to one of its controls. Leaving this blank > is going against the API. This makes sense! Thank you for the information!