I get a ClassCastException when comparing files of an egit project in STS. The problem seems to be project specific and unfortunately I cannot share the source for the project. Since I have been unsuccessful in creating a project I can share that reproduces the issue, I am hoping that the information below might be able to uncover what is happening. I believe this is an STS issue since the ClassCastException occurs in an STS specific class and because I cannot seem to reproduce it in Eclipse, but since I am uncertain I am posting on the forum rather than creating a JIRA (I can create one if that is preferred). Any idea what is happening? Below are the steps I take on my specific project to reproduce the issue:
- Start with an egit project in STS
- Open a file that is under egit version control that has multiple revisions
- Right click and select Team->Show in History
- Double click one of the revisions
- The diff appears, but the error below also appears. It produces a number of these errors along with an Unhandled event loop exception w/ the same stacktrace.
- The other information that may be useful is that my project is a multi project Gradle build. I also notice that while STS notices the root of the project is a Git project, the code under it has ? icon even though the code has been committed and is up to date.
The Exception:
Cheers,Code:Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". eclipse.buildId=2.9.0.201201191000-M2 java.version=1.6.0_30 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Framework arguments: -product com.springsource.sts.ide Command-line arguments: -os linux -ws gtk -arch x86 -product com.springsource.sts.ide java.lang.ClassCastException: org.eclipse.egit.ui.internal.GitCompareFileRevisionEditorInput cannot be cast to org.eclipse.ui.part.FileEditorInput at com.springsource.sts.internal.ide.ui.actions.OpenNamespaceConfigWizardCommandHandler.getFile(OpenNamespaceConfigWizardCommandHandler.java:94) at com.springsource.sts.internal.ide.ui.actions.OpenNamespaceConfigWizardCommandHandler.setEnabled(OpenNamespaceConfigWizardCommandHandler.java:79) at org.eclipse.ui.internal.handlers.HandlerProxy.setEnabled(HandlerProxy.java:232) at org.eclipse.core.commands.Command.setEnabled(Command.java:857) at org.eclipse.ui.menus.CommandContributionItem.isEnabled(CommandContributionItem.java:977) at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(CommandContributionItem.java:628) at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:580) at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:569) at org.eclipse.ui.menus.CommandContributionItem$1.bindingManagerChanged(CommandContributionItem.java:998) at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:900) at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2176) at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1742) at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:689) at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:165) at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(ContextManager.java:324) at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(ContextManager.java:83) at org.eclipse.ui.internal.contexts.ContextAuthority.sourceChanged(ContextAuthority.java:673) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:310) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290) at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:401) at org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:300) at org.eclipse.ui.internal.services.WorkbenchSourceProvider$2.windowDeactivated(WorkbenchSourceProvider.java:270) at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1021) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench.fireWindowDeactivated(Workbench.java:1019) at org.eclipse.ui.internal.WorkbenchWindow$28.shellDeactivated(WorkbenchWindow.java:3162) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:111) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263) at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:748) at org.eclipse.swt.widgets.Display.filterProc(Display.java:1543) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2276) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410)


Reply With Quote
