Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359539

Summary: NPE in TaskAttachmentDropListener.drop
Product: z_Archived Reporter: Robert Munteanu <robert.munteanu>
Component: MylynAssignee: Robert Munteanu <robert.munteanu>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 Keywords: contributed
Version: 3.6   
Target Milestone: 3.7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch
steffen.pingel: iplog+
mylyn/context/zip none

Description Robert Munteanu CLA 2011-09-30 05:28:14 EDT
What steps will reproduce the problem?
1. Drag the 'Install' badge from an Eclipse marketplace entry, e.g. http://marketplace.eclipse.org/content/mylyn-mantis-connector 
2. Drop the badge to a Mylyn task attachment part 
3. A NPE is logged

The toString() of the event is DropTargetEvent{DropTarget {} time=238147315 data=null x=2116 y=329 item=null operations=1 operation=0 feedback=1 dataTypes={ 119 } currentDataType=119}

One unpleasant side effect of the NPE is that drag-and-drop no longer works from Firefox afterwards.

-- Error Details --
Date: Fri Sep 30 11:56:08 EEST 2011
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse 1.4.1.20110909-0613 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.ui
Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.mylyn.internal.tasks.ui.editors.TaskAttachmentDropListener.drop(TaskAttachmentDropListener.java:94)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061)
	at org.eclipse.swt.dnd.DropTarget.drag_data_received(DropTarget.java:371)
	at org.eclipse.swt.dnd.DropTarget.Drag_Data_Received(DropTarget.java:251)
	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:8422)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1245)
	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:2276)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	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: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: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)
Comment 1 Robert Munteanu CLA 2011-09-30 05:30:06 EDT
Created attachment 204357 [details]
patch
Comment 2 Robert Munteanu CLA 2011-09-30 05:30:08 EDT
Created attachment 204358 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2011-09-30 10:32:17 EDT
Thanks! I have applied the patch.