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

Bug 330901

Summary: IllegalArgumentException at local Task > Copy Details > ID
Product: z_Archived Reporter: Dennis Grabow <grabow.dennis>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: 3.4.3   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix
none
mylyn/context/zip none

Description Dennis Grabow CLA 2010-11-23 06:07:17 EST
Build Identifier: 

If I try to copy the ID or URL of a local task, an IllegalArgumentException is thrown. In Eclipse the exception is caught by the eventLoopException() method in the WorkbenchAdvisor class, so no error dialog appears.
In Eclipse RCP projects this exception results in an error message for the user, unless the WorkbenchAdvisor class is adjusted to catch the exception as well.

Reproducible: Always

Steps to Reproduce:
1. Create a new Task.
2. Copy the task ID to the clipboard by select "Copy Deatils > ID" in the menu
Comment 1 Steffen Pingel CLA 2010-11-23 12:09:10 EST
Can you attach a stack trace? What kind of task are you seeing this with?
Comment 2 Dennis Grabow CLA 2010-11-30 05:32:37 EST
eclipse.buildId=unknown
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.reporting.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.reporting.product


Error
Tue Nov 30 11:25:05 CET 2010
Unhandled event loop exception

java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:3865)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.dnd.DND.error(DND.java:282)
at org.eclipse.swt.dnd.DND.error(DND.java:228)
at org.eclipse.swt.dnd.Clipboard.setContents(Clipboard.java:448)
at org.eclipse.swt.dnd.Clipboard.setContents(Clipboard.java:379)
at org.eclipse.mylyn.internal.tasks.ui.util.ClipboardCopier.copy(ClipboardCopier.java:72)
at org.eclipse.mylyn.internal.tasks.ui.util.ClipboardCopier.copy(ClipboardCopier.java:61)
at org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction.run(CopyTaskDetailsAction.java:64)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
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:368)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Comment 3 Steffen Pingel CLA 2010-12-09 10:26:55 EST
Created attachment 184858 [details]
fix
Comment 4 Steffen Pingel CLA 2010-12-09 10:34:45 EST
Thanks for the bug reports. I have committed the attached fix to head and the e_3_6_m_3_4_x branch which avoids the exception. Since local tasks do not have an ID the menu item will not have any effect on local tasks.
Comment 5 Steffen Pingel CLA 2010-12-09 10:34:59 EST
Created attachment 184861 [details]
mylyn/context/zip