Bug 562109 - CCE during clone
Summary: CCE during clone
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.8   Edit
Assignee: Alexander Nittka CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-14 09:42 EDT by Lars Vogel CLA
Modified: 2020-04-17 03:18 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2020-04-14 09:42:01 EDT
I tried to clone platform.ui repo under Window in a workspace using http with my user. URL: git clone https://lvogel@git.eclipse.org/r/a/platform/eclipse.platform.ui

I get:

Error executing 'org.eclipse.egit.ui.RepositoriesViewClone': java.lang.ClassCastException: class org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to class org.eclipse.egit.ui.internal.repository.RepositoriesView (org.eclipse.ui.navigator.resources.ProjectExplorer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @a5f6d77; org.eclipse.egit.ui.internal.repository.RepositoriesView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71003a7e)
Error executing 'org.eclipse.egit.ui.RepositoriesViewClone': java.lang.ClassCastException: class org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to class org.eclipse.egit.ui.internal.repository.RepositoriesView (org.eclipse.ui.navigator.resources.ProjectExplorer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @a5f6d77; org.eclipse.egit.ui.internal.repository.RepositoriesView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71003a7e)

I did not open any EGit view yet.
After opening the Git repository view, cloning works fine.
Comment 1 Thomas Wolf CLA 2020-04-14 09:59:50 EDT
Stack trace, please. I bet this is because of the repository groups' node expansion.
Comment 2 Andrey Loskutov CLA 2020-04-14 10:21:41 EDT
Yep, was reported in our R&D too for 5.7 egit release:

Steps to reproduce:

Hit Ctrl+3 and choose Clone a Git Repository.
In the field URI enter some url
Press Next
Press Next again
Check the check box "Import all existing Eclipse projects after the clone finishes".

org.eclipse.core.commands.ExecutionException: Error executing 'org.eclipse.egit.ui.RepositoriesViewClone': java.lang.ClassCastException: org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to org.eclipse.egit.ui.internal.repository.RepositoriesVieworg.eclipse.core.commands.ExecutionException: Error executing 'org.eclipse.egit.ui.RepositoriesViewClone': java.lang.ClassCastException: org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to org.eclipse.egit.ui.internal.repository.RepositoriesView 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.ui.internal.quickaccess.providers.CommandElement.execute(CommandElement.java:61) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4930) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4451) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) at org.eclipse.equinox.launcher.Main.run(Main.java:1447) at org.eclipse.equinox.launcher.Main.main(Main.java:1420)Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to org.eclipse.egit.ui.internal.repository.RepositoriesView at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156) ... 31 moreCaused by: java.lang.ClassCastException: org.eclipse.ui.navigator.resources.ProjectExplorer cannot be cast to org.eclipse.egit.ui.internal.repository.RepositoriesView at org.eclipse.egit.ui.internal.repository.tree.command.RepositoriesViewCommandHandler.getView(RepositoriesViewCommandHandler.java:58) at org.eclipse.egit.ui.internal.repository.tree.command.CloneCommand.getView(CloneCommand.java:1) at org.eclipse.egit.ui.internal.repository.tree.command.CloneCommand.execute(CloneCommand.java:60) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) ... 35 more
Comment 3 Thomas Wolf CLA 2020-04-14 10:32:13 EDT
Suspicion confirmed. Regression from https://git.eclipse.org/r/#/c/157762/ . Alex, could you take a look, please?

AddCommand, CloneCommand, and CreateRepositoryCommand must also work if invoked from some other view; they're default handlers. And that must stay that way, otherwise the buttons in the repo view's toolbar will be shown disabled when some other part is active, but will still react on clicks.
Comment 4 Eclipse Genie CLA 2020-04-14 13:48:03 EDT
New Gerrit change created: https://git.eclipse.org/r/160931
Comment 5 Eclipse Genie CLA 2020-04-17 03:06:29 EDT
Gerrit change https://git.eclipse.org/r/160931 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=1dc6de219906fe50164434d6d1964c16e71a227b