Bug 223979 - [DND] NPE in PluginDropAdapter when dragging Java class to JRE System Library Folder
Summary: [DND] NPE in PluginDropAdapter when dragging Java class to JRE System Library...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 17:01 EDT by Francis Upton IV CLA
Modified: 2019-09-06 15:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Upton IV CLA 2008-03-25 17:01:40 EDT
Build ID: I20080325-0100

Steps To Reproduce:
1. Create a Java class.
2. Drag the class from Navigator view to Package Explorer view on the JRE System Library Folder
3. You will get the NPE

Various other combinations of views for this seem to work fine.

More information:
java.lang.NullPointerException
	at org.eclipse.ui.part.PluginDropAdapter.getPluginAdapter(PluginDropAdapter.java:94)
	at org.eclipse.ui.part.PluginDropAdapter.drop(PluginDropAdapter.java:64)
	at org.eclipse.jface.util.DelegatingDropAdapter$3.run(DelegatingDropAdapter.java:211)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:880)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.util.DelegatingDropAdapter.drop(DelegatingDropAdapter.java:209)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:83)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1145)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1169)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1154)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:995)
	at org.eclipse.swt.dnd.DropTarget.drag_data_received(DropTarget.java:364)
	at org.eclipse.swt.dnd.DropTarget.Drag_Data_Received(DropTarget.java:245)
	at org.eclipse.swt.internal.gtk.OS._gtk_drag_get_data(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_drag_get_data(OS.java:4459)
	at org.eclipse.swt.dnd.DropTarget.drag_drop(DropTarget.java:409)
	at org.eclipse.swt.dnd.DropTarget.Drag_Drop(DropTarget.java:252)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:5728)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1163)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1504)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2980)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2375)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2339)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2205)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:478)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:473)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	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:362)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
	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:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Comment 1 Eric Moffatt CLA 2008-03-26 14:18:41 EDT
Interesting, if you start and end the drag inside the Package Explorer it won't let you drop the result into the JRE folder (which is really the defect, the operation shouldn't be possible). But if you drag from either the Project or Navigator view it will allow the drop and you get the NPE.

My suspicion is that the 'transfer type' of the source (i.e. the thingie being dragged) is different in the nav/project explorers than it is when you start a drag in the package explorer.

Could you check this for me? I'd place a breakpoint in the project explorer's drop handler and wee whats coming in in a 'local' dnd versus dragging from the package explorer into the project.
Comment 2 Francis Upton IV CLA 2008-03-26 14:58:28 EDT
(In reply to comment #1)
> Interesting, if you start and end the drag inside the Package Explorer it won't
> let you drop the result into the JRE folder (which is really the defect, the
> operation shouldn't be possible). But if you drag from either the Project or
> Navigator view it will allow the drop and you get the NPE.
> 
> My suspicion is that the 'transfer type' of the source (i.e. the thingie being
> dragged) is different in the nav/project explorers than it is when you start a
> drag in the package explorer.
> 
> Could you check this for me? I'd place a breakpoint in the project explorer's
> drop handler and wee whats coming in in a 'local' dnd versus dragging from the
> package explorer into the project.
> 

I can only make the NPE happen from the Navigator to the Package Explorer; the Project Explorer properly rejects the drop.  The event.data is null in this case.  When I set a breakpoint there from the Project Explorer for example, the event.data has a PluginTransferData object.

Does this answer your question?
Comment 3 Eclipse Webmaster CLA 2019-09-06 15:38:15 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.