ClassCastException when running DockerBuild [message #1792630] |
Fri, 20 July 2018 07:02  |
Eclipse User |
|
|
|
Hi all,
I am Runnning Run AS->Docker Image Build in an Eclipse RCP on a Dockerfile and seeing this strack trace:
java.lang.ClassCastException: org.eclipse.jface.viewers.TreeSelection cannot be cast to org.eclipse.core.runtime.IAdaptable
at org.eclipse.linuxtools.internal.docker.ui.launch.BaseResourceAwareLaunchShortcut.getResourceFromSelection(BaseResourceAwareLaunchShortcut.java:82)
at org.eclipse.linuxtools.internal.docker.ui.launch.BaseResourceAwareLaunchShortcut.launch(BaseResourceAwareLaunchShortcut.java:54)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:431)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runInternal(LaunchShortcutAction.java:85)
The related code is:
if (selectedElement instanceof IResource) {
return (IResource) selectedElement;
} else if (selectedElement instanceof IAdaptable) {
// may return null, which will be dealt with in the caller method
return ((IAdaptable) selection).getAdapter(IResource.class);
}
Two things:
* I am confused that the instanceof IResource if-statement is not being executed, since a file is an IResource, is it not?
* There actually seems to be a bug in the code, the last line should read, return ((IAdaptable) selectedElement).getAdapter(IResource.class); (selectedElement instead of selection, should it not)?
Thanks for any help
Andreas
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03803 seconds