Project: Eclipse_Platform_UI
Bug 137384 [Presentations] ClassCastException in org.eclipse.ui.internal.PartStack line 1305
Reported: 2006-04-18 17:40:59 | Status: resolved fixed

Our RCP application has a IPerspectiveFactory that creates 2 IFolderLayout's for other plugins to add views to. This was working in eclipse 3.1.0, when we tried to migrate to eclipse 3.2RC1 we received a ClassCastException on startup, even with a clean workspace. Eclipse 3.2RC1 org.eclipse.ui.internal.PartStack line 1305 The offending line of code looks like this: PartPane pane = (PartPane)part; The part variable is actually an instance of org.eclipse.ui.internal.ViewStack. That stack at this point: Thread [main] (Suspended (exception java.lang.ClassCastException)) org.eclipse.ui.internal.ViewStack(org.eclipse.ui.internal.PartStack).showPart(org.eclipse.ui.internal.LayoutPart, java.lang.Object, boolean) line: 1305 org.eclipse.ui.internal.ViewStack(org.eclipse.ui.internal.PartStack).createControl(org.eclipse.swt.widgets.Composite, org.eclipse.ui.presentations.StackPresentation) line: 603 org.eclipse.ui.internal.ViewStack(org.eclipse.ui.internal.PartStack).createControl(org.eclipse.swt.widgets.Composite) line: 531 org.eclipse.ui.internal.ViewSashContainer(org.eclipse.ui.internal.PartSashContainer).createControl(org.eclipse.swt.widgets.Composite) line: 562 org.eclipse.ui.internal.PerspectiveHelper.activate(org.eclipse.swt.widgets.Composite) line: 244 org.eclipse.ui.internal.Perspective.onActivate() line: 832 org.eclipse.ui.internal.WorkbenchPage.onActivate() line: 2378 org.eclipse.ui.internal.WorkbenchWindow$6.run() line: 2612 org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 69 org.eclipse.ui.internal.WorkbenchWindow.setActivePage(org.eclipse.ui.IWorkbenchPage) line: 2593 org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(java.lang.String, org.eclipse.core.runtime.IAdaptable) line: 657 org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(java.lang.String, org.eclipse.core.runtime.IAdaptable) line: 795 org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow() line: 1437

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageLayout.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java