Community
Participate
Working Groups
If you paste some text to the Scratchpad and double click on it you will get a ClassCastException. Steps to Reproduce: 1. Copy some text from some file. 2. Right click in the empty space in the Remote Scratchpad and select Paste. 3. Double click on the text. Error Dialog Shows: An error has occurred. See error log for more details. java.lang.String cannot be cast to org.eclipse.core.runtime.IAdaptable Log File Contains: !ENTRY org.eclipse.jface 4 2 2007-06-18 13:39:18.984 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.ClassCastException: java.lang.String cannot be cast to org.eclipse.core.runtime.IAdaptable at org.eclipse.rse.internal.ui.view.scratchpad.SystemScratchpadViewPart.handleDoubleClick(SystemScratchpadViewPart.java:184) at org.eclipse.rse.internal.ui.view.scratchpad.SystemScratchpadViewPart.access$0(SystemScratchpadViewPart.java:176) at org.eclipse.rse.internal.ui.view.scratchpad.SystemScratchpadViewPart$1.doubleClick(SystemScratchpadViewPart.java:122) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1384) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) 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:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:504) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443) at org.eclipse.equinox.launcher.Main.run(Main.java:1169) -----------Enter bugs above this line----------- TM 2.0RC3 Testing installation : eclipse-SDK-3.3RC4 RSE install : RSE 2.0 RC3 java.runtime : Sun 1.5.0_11-b03 os.name: : Windows XP, Service Pack 2 ------------------------------------------------
I guess we need to decide what to do with Strings in the Scratchpad. Strings are not RSE Objects, so we should probably not allow any operations on them, and at the place where we get the ClassCastException we should first check whether the thing is a proper RSE object. But there is another bug open regarding Strings in the Scratchpad.
See bug #193158 regarding the general decision what to do with Strings.
Created attachment 73581 [details] Added a check to see if element is IAdaptable Legal Message: I, Kevin Doyle, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL.
I've committed the fix for this.
Verified with I20070713-0605.