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

Bug 263682

Summary: XLC Compiler Property Page Class Cast Exception
Product: [Tools] CDT Reporter: James Blackburn <jamesblackburn+eclipse>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: RESOLVED DUPLICATE QA Contact: Chris Recoskie <recoskie>
Severity: normal    
Priority: P3    
Version: 6.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description James Blackburn CLA 2009-02-04 14:11:34 EST
Build ID: M5

Steps To Reproduce:
I installed the XLC feature in the M5 candidate build. Clicking on it in the Properties Page gave this exception:

java.lang.ClassCastException: org.eclipse.cdt.internal.core.model.TranslationUnit
at org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCompilerPropertyPage.createFieldEditors(XLCompilerPropertyPage.java:69)
at org.eclipse.jface.preference.FieldEditorPreferencePage.createContents(FieldEditorPreferencePage.java:227)
at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:235)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1468)
at org.eclipse.jface.preference.PreferenceDialog$14.run(PreferenceDialog.java:1225)
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.preference.PreferenceDialog.showPage(PreferenceDialog.java:1219)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:570)
at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:702)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:698)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842)
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.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153)
at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250)


More information:
Comment 1 Chris Recoskie CLA 2009-02-04 14:32:58 EST
I can't reproduce this with HEAD.  I assume from the stack trace that you selected a source file from the Project Explorer and then opened the properties, but this works for me.
Comment 2 James Blackburn CLA 2009-02-04 14:42:17 EST
I've installed the M5 bits with all Features in a clean Eclipse configuration.
1) Create Hello World ANSI C Project
2) 

(In reply to comment #1)
> I can't reproduce this with HEAD.  I assume from the stack trace that you
> selected a source file from the Project Explorer and then opened the
> properties, but this works for me.

Indeed. This is using Vivian's M5 candidate:
cdt-master-6.0.0-I200902031437

On MacOS:
1) I installed all the features from the update site to a clean configuration
2) I created the HelloWorld C ANSI program
3) Properties on hw.c
4) Try to access the XL C/C++ page

It works at the project root, but not at the file level.

Here's another exception from the same area (having pressed OK on that page):

java.lang.ClassCastException: org.eclipse.cdt.internal.core.model.TranslationUnit
at org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCompilerPropertyPage.performOk(XLCompilerPropertyPage.java:155)
at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:931)
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.preference.PreferenceDialog.okPressed(PreferenceDialog.java:911)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:440)

Comment 3 Chris Recoskie CLA 2009-02-04 15:06:43 EST
Ah ok... I only fixed it this morning, so it wouldn't be in yesterday's build.

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