Community
Participate
Working Groups
Build Identifier: M20100909-0800 It gives me a Null Pointer Exception Reproducible: Always Steps to Reproduce: 1.Select two classes from package A 2.Drag-n-drop them to package B
This works fine for me. Can you please provide the .log with the NPE.
Created attachment 182601 [details] Screenshots and log
!ENTRY org.eclipse.ui.workbench 4 2 2010-11-08 10:12:27.592!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".!STACK 0java.lang.NullPointerException at org.eclipse.jface.viewers.AbstractTreeViewer.getSelection(AbstractTreeViewer.java:2892) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$8.getShowInContext(PackageExplorerPart.java:1253) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.getContext(WorkbenchSourceProvider.java:412) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActivePart(WorkbenchSourceProvider.java:478) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:305) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:300) at org.eclipse.ui.internal.services.WorkbenchSourceProvider$2.windowDeactivated(WorkbenchSourceProvider.java:270) at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1018) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench.fireWindowDeactivated(Workbench.java:1016) at org.eclipse.ui.internal.WorkbenchWindow$28.shellDeactivated(WorkbenchWindow.java:3125) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:111) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1669) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1693) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1674) at org.eclipse.swt.widgets.Shell.kEventWindowDeactivated(Shell.java:1174) at org.eclipse.swt.widgets.Shell.kEventWindowDeactivated(Shell.java:1164) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2211) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4427) at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3216) 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 org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) 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(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:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
I can't reproduce this. Looking at the code: Widget[] items = getSelection(getControl()); ArrayList list = new ArrayList(items.length); for (int i = 0; i < items.length; i++) { Widget item = items[i]; if (item.getData() != null) { NPE is at item.getData(). This is possible only if the getSelection() returns an array with a null element in it. By any chance, PackageExplorer overriding the TreeViewer.getSelection(Control)? If not, then this could be a SWT bug.
Guillaume, are you using the Cocoa or the Carbon version of Eclipse? What's your Mac OS X version? > By any chance, PackageExplorer overriding the TreeViewer.getSelection(Control)? Nope (would be quite hard to do, since that method is protected). Moving to SWT.
Could be related to bug 148051.
Hi Markus, I'm using OSX 10.6.4 It's the Carbon 32 bit version. I don't know about you, but the 64 bit Cocoa was really unstable ( Debuger not working at all and various other problems ). (In reply to comment #5) > Guillaume, are you using the Cocoa or the Carbon version of Eclipse? > What's your Mac OS X version? > > > By any chance, PackageExplorer overriding the TreeViewer.getSelection(Control)? > Nope (would be quite hard to do, since that method is protected). > > Moving to SWT.
The chances of it being fixed on Carbon are pretty low at this point. Please give the 32-bit Cocoa version a try, at the very least. If other problems are keeping you from moving to Cocoa, let us know (via new bugs) and we'll try to address them for 3.7.
Moving to triaged, as this is Carbon. If you can move to Cocoa, please do so; we will not be fixing any 3.7 Carbon bugs.
This is fixed in 3.7 *** This bug has been marked as a duplicate of bug 341895 ***