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

Bug 252218

Summary: ClasscastException for Toolchainoption CDT Build -> Settings-> "all configurations"
Product: [Tools] CDT Reporter: Benjamin Müller <home>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: elaskavaia.cdt, jamesblackburn+eclipse
Version: 5.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
screenshot tricore extension
none
screenshot avr extension none

Description Benjamin Müller CLA 2008-10-27 12:05:14 EDT
Build ID: M20080911-1700

Steps To Reproduce:
1. Create a new CDT-Extension
2. Create a Projecttype, Configurations (>2) with Tools and Toolchainoptions
3. Create a new project (with this new Projecttype)
4. Visit Project-Properties
5. C/C++ Build -> Settings -> select "all configurations" -> select the Toolchain option -> ClassCastException (IToolchain -> ITool)


More information:
If a Project with more than 2 configurations exist and this Project have toolchain options, the view of build-settings for all configurations will throw a ClassCastException IToolchain -> ITool).
The view of a single configuration works fine and the backend works fine also. The view of multiple configurations works too. Just in the view "all configurations" exist this problem.




Stacktrace (my TriCore CDT-Extension):

!ENTRY org.eclipse.jface 4 2 2008-10-27 13:48:19.223
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.ClassCastException: org.eclipse.cdt.managedbuilder.internal.core.ToolChain cannot be cast to org.eclipse.cdt.managedbuilder.core.ITool
	at org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionSettingsUI.<init>(BuildOptionSettingsUI.java:72)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.displayOptionsForCategory(ToolSettingsTab.java:178)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.handleOptionSelection(ToolSettingsTab.java:389)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.access$1(ToolSettingsTab.java:373)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab$2.selectionChanged(ToolSettingsTab.java:131)
	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.setSelection(StructuredViewer.java:1638)
	at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1104)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.setValues(ToolSettingsTab.java:334)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.updateData(ToolSettingsTab.java:606)
	at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.configChanged(AbstractCPropertyTab.java:223)
	at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:533)
	at org.eclipse.cdt.ui.newui.AbstractPage.forEach(AbstractPage.java:865)
	at org.eclipse.cdt.ui.newui.AbstractPage.cfgChanged(AbstractPage.java:824)
	at org.eclipse.cdt.ui.newui.AbstractPage.handleConfigSelection(AbstractPage.java:410)
	at org.eclipse.cdt.ui.newui.AbstractPage.access$0(AbstractPage.java:381)
	at org.eclipse.cdt.ui.newui.AbstractPage$1.handleEvent(AbstractPage.java:258)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	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:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	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: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:386)
	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)








Stacktrace: (AVR-Plugin 2.3.0 Beta 1) http://sourceforge.net/project/showfiles.php?group_id=189165 (Last visit 27.October 2008)

!ENTRY org.eclipse.ui 4 0 2008-10-27 15:01:38.841
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ClassCastException: org.eclipse.cdt.managedbuilder.internal.core.ToolChain cannot be cast to org.eclipse.cdt.managedbuilder.core.ITool
	at org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionSettingsUI.<init>(BuildOptionSettingsUI.java:72)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.displayOptionsForCategory(ToolSettingsTab.java:178)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.handleOptionSelection(ToolSettingsTab.java:389)
	at org.eclipse.cdt.managedbuilder.ui.properties.ToolSettingsTab.updateData(ToolSettingsTab.java:607)
	at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.configChanged(AbstractCPropertyTab.java:223)
	at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:533)
	at org.eclipse.cdt.ui.newui.AbstractPage.forEach(AbstractPage.java:865)
	at org.eclipse.cdt.ui.newui.AbstractPage.cfgChanged(AbstractPage.java:824)
	at org.eclipse.cdt.ui.newui.AbstractPage.handleConfigSelection(AbstractPage.java:410)
	at org.eclipse.cdt.ui.newui.AbstractPage.access$0(AbstractPage.java:381)
	at org.eclipse.cdt.ui.newui.AbstractPage$1.handleEvent(AbstractPage.java:258)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	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:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	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: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:386)
	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)
Comment 1 Benjamin Müller CLA 2008-10-27 12:06:30 EDT
Created attachment 116192 [details]
screenshot tricore extension
Comment 2 Benjamin Müller CLA 2008-10-27 12:07:09 EDT
Created attachment 116193 [details]
screenshot avr extension
Comment 3 James Blackburn CLA 2008-10-27 12:16:09 EDT
I believe this is a duplicate of bug242403.

Try the patch there and do say whether it resolves your problem.
Comment 4 Benjamin Müller CLA 2008-10-27 16:13:10 EDT
Yes youre right.

this patch fix the problem.

thx
Comment 5 Elena Laskavaia CLA 2008-12-11 11:06:32 EST

*** This bug has been marked as a duplicate of bug 242403 ***