Bug 579353 - ClassCastException in "Open in editor" repository view command
Summary: ClassCastException in "Open in editor" repository view command
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 6.1   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 6.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-21 10:29 EDT by Michael Keppler CLA
Modified: 2022-03-30 16:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keppler CLA 2022-03-21 10:29:49 EDT
I have seen the below exception 2 times now when trying to open a file directly from the working tree in the repo view, but I cannot reproduce it on demand. I _guess_ the problem appears if the "Open in editor" command changes the active workbench part at a bad time, such that the egit command then wrongly gets the new editor instead of the previously active repository view.



org.eclipse.core.commands.ExecutionException: Error executing 'org.eclipse.egit.ui.RepositoriesViewOpen': java.lang.ClassCastException: class org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor cannot be cast to class org.eclipse.egit.ui.internal.repository.RepositoriesView (org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2ab9cb10; org.eclipse.egit.ui.internal.repository.RepositoriesView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @40ecfc73)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:170)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommandInContext(LegacyHandlerService.java:440)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:218)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:182)
	at org.eclipse.egit.ui.internal.repository.RepositoriesView.executeOpenCommand(RepositoriesView.java:892)
	at org.eclipse.egit.ui.internal.repository.RepositoriesView$7.open(RepositoriesView.java:514)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:800)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:797)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1116)
	at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:454)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:296)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:331)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4243)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1063)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4060)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3632)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: class org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor cannot be cast to class org.eclipse.egit.ui.internal.repository.RepositoriesView (org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2ab9cb10; org.eclipse.egit.ui.internal.repository.RepositoriesView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @40ecfc73)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	... 42 more
Caused by: java.lang.ClassCastException: class org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor cannot be cast to class org.eclipse.egit.ui.internal.repository.RepositoriesView (org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2ab9cb10; org.eclipse.egit.ui.internal.repository.RepositoriesView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @40ecfc73)
	at org.eclipse.egit.ui.internal.repository.tree.command.RepositoriesViewCommandHandler.getView(RepositoriesViewCommandHandler.java:56)
	at org.eclipse.egit.ui.internal.repository.tree.command.OpenInEditorCommand.getView(OpenInEditorCommand.java:1)
	at org.eclipse.egit.ui.internal.repository.tree.command.OpenInEditorCommand.execute(OpenInEditorCommand.java:31)
	at org.eclipse.egit.ui.internal.repository.tree.command.OpenCommand.execute(OpenCommand.java:46)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	... 46 more
Comment 1 Eclipse Genie CLA 2022-03-21 10:37:14 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/192093