Bug 231977 - copying multiple extensions triggers java.lang.ClassCastException
Summary: copying multiple extensions triggers java.lang.ClassCastException
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC1   Edit
Assignee: Benjamin Cabé CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-13 21:19 EDT by Mike Frysinger CLA
Modified: 2008-05-14 15:22 EDT (History)
1 user (show)

See Also:


Attachments
Patch (1.14 KB, patch)
2008-05-14 04:24 EDT, Benjamin Cabé CLA
no flags Details | Diff
mylyn/context/zip (1.79 KB, application/octet-stream)
2008-05-14 04:24 EDT, Benjamin Cabé CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger CLA 2008-05-13 21:19:58 EDT
Build ID: 3.4m7

Steps To Reproduce:
if you view the plugin manifest and click on the extensions tab, and then select multiple items and copy them (ctrl+c), clicking any extensions after that results in:

java.lang.ClassCastException
An error has occurred. See error log for more details.
[Ljava.lang.Object; cannot be cast to [Lorg.eclipse.pde.core.plugin.IPluginElement;

More information:
copying & pasting one extension at a time seems to work OK

ive seen this with every plugin ive happened to test, but specifically i tested with org.eclipse.cdt.managedbuilder.gnu.ui and select all the GCC children of the org.eclipse.cdt.managedbuilder.core.buildDefinitions tree and copy those
Comment 1 Benjamin Cabé CLA 2008-05-14 04:15:38 EDT
Here is the full stacktrace

Comment 2 Benjamin Cabé CLA 2008-05-14 04:16:35 EDT
Here is the full stacktrace ; the error occurs when you select many children of an extension.

!ENTRY org.eclipse.jface 4 2 2008-05-14 09:55:45.531
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lorg.eclipse.pde.core.plugin.IPluginElement;
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection.canPaste(ExtensionsSection.java:899)
	at org.eclipse.pde.internal.ui.editor.StructuredViewerSection.canPaste(StructuredViewerSection.java:117)
	at org.eclipse.pde.internal.ui.editor.PDEFormPage.canPaste(PDEFormPage.java:207)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditor.canPasteFromClipboard(PDEFormEditor.java:879)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditorContributor$PasteAction.selectionChanged(PDEFormEditorContributor.java:120)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditorContributor.updateSelectableActions(PDEFormEditorContributor.java:283)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditor.setSelection(PDEFormEditor.java:710)
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection.selectionChanged(ExtensionsSection.java:262)
	at org.eclipse.pde.internal.ui.editor.TreeSection$PartAdapter.selectionChanged(TreeSection.java:33)
	at org.eclipse.pde.internal.ui.parts.TreePart$1.selectionChanged(TreePart.java:45)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
	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.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2062)
	at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1138)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1168)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:227)
	at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:221)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:388)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3782)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3381)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2394)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2358)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2210)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:489)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112)
	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:379)
	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: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 3 Benjamin Cabé CLA 2008-05-14 04:24:43 EDT
Created attachment 100127 [details]
Patch

Here is the fix for this invalid array cast
Comment 4 Benjamin Cabé CLA 2008-05-14 04:24:48 EDT
Created attachment 100128 [details]
mylyn/context/zip
Comment 5 Chris Aniszczyk CLA 2008-05-14 12:16:30 EDT
Thanks Ben!

Holy crap, welcome to my world Spanky :)

Are you still in Boston :)?
Comment 6 Benjamin Cabé CLA 2008-05-14 12:39:06 EDT
Boston?
Comment 7 Mike Frysinger CLA 2008-05-14 12:56:31 EDT
for the time being

i dont suppose you do CDT at all ?  i'm trying to get stuff fixed there wrt gdb mi ;)
Comment 8 Chris Aniszczyk CLA 2008-05-14 15:14:59 EDT
Thanks for the patch Ben!

> 20080514
Comment 9 Benjamin Cabé CLA 2008-05-14 15:22:52 EDT
You're welcome Chris! :)