Announcement Announcement Module
No announcement yet.
ClassCastException: GitCompareFileRevisionEditorInput cast to FileEditorInput Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassCastException: GitCompareFileRevisionEditorInput cast to FileEditorInput

    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:

    Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
    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(
    	at com.springsource.sts.internal.ide.ui.actions.OpenNamespaceConfigWizardCommandHandler.setEnabled(
    	at org.eclipse.ui.internal.handlers.HandlerProxy.setEnabled(
    	at org.eclipse.core.commands.Command.setEnabled(
    	at org.eclipse.ui.menus.CommandContributionItem.isEnabled(
    	at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(
    	at org.eclipse.ui.menus.CommandContributionItem.update(
    	at org.eclipse.ui.menus.CommandContributionItem.update(
    	at org.eclipse.ui.menus.CommandContributionItem$1.bindingManagerChanged(
    	at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(
    	at org.eclipse.jface.bindings.BindingManager.setActiveBindings(
    	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(
    	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(
    	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(
    	at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(
    	at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(
    	at org.eclipse.ui.internal.contexts.ContextAuthority.sourceChanged(
    	at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(
    	at org.eclipse.ui.internal.Workbench$
    	at org.eclipse.ui.internal.Workbench.fireWindowDeactivated(
    	at org.eclipse.ui.internal.WorkbenchWindow$28.shellDeactivated(
    	at org.eclipse.swt.widgets.TypedListener.handleEvent(
    	at org.eclipse.swt.widgets.EventTable.sendEvent(
    	at org.eclipse.swt.widgets.Widget.sendEvent(
    	at org.eclipse.swt.widgets.Widget.sendEvent(
    	at org.eclipse.swt.widgets.Widget.sendEvent(
    	at org.eclipse.swt.widgets.Shell.filterProc(
    	at org.eclipse.swt.widgets.Display.filterProc(
    	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
    	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(
    	at org.eclipse.swt.widgets.Display.readAndDispatch(
    	at org.eclipse.ui.internal.Workbench.runEventLoop(
    	at org.eclipse.ui.internal.Workbench.runUI(
    	at org.eclipse.ui.internal.Workbench.access$4(
    	at org.eclipse.ui.internal.Workbench$
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    	at java.lang.reflect.Method.invoke(
    	at org.eclipse.equinox.launcher.Main.invokeFramework(
    	at org.eclipse.equinox.launcher.Main.basicRun(
    Last edited by Rob Winch; Feb 8th, 2012, 12:21 PM. Reason: fix typo

  • #2

    This is a bug in the STS implementation of that class, I guess. I created the corresponding JIRA here:

    Should be fixed for the next builds.