Project

General

Profile

Actions

bug #9465

closed

Open in ... NameEditor for orphan taxa results in CCE

Added by Katja Luther almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
New
Assignee:
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:

Description

For orphan taxa "open in... " presents the possibility NameEditor but this results in a ClassCastException:

last remote method : http://api.cybertaxonomy.org:80/flora-cuba/remoting/common.service
last remote request client time : 2021-02-10T14:50:24.366
last remote request response header time : Wed, 10 Feb 2021 14:50:24 GMT
client error time : 2021-02-10T14:50:30.556
login : w.berendsohn
editor version : 5.19.0
server : api.cybertaxonomy.org (cybertaxonomy.org) / flora-cuba
schema version : 5.18.6.0.20201124
os : Windows 10 10.0 amd64
java : 1.8.0_251
org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache cannot be cast to eu.etaxonomy.cdm.model.taxon.TaxonBase
                at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
                at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
                at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:288)
                at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
                at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
                at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
                at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
                at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
                at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
                at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:433)
                at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:454)
                at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$3.handleEvent(AbstractContributionItem.java:482)
                at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
                at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
                at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
                at eu.etaxonomy.taxeditor.Application.start(Application.java:20)
                at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.ClassCastException: eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache cannot be cast to eu.etaxonomy.cdm.model.taxon.TaxonBase
                at eu.etaxonomy.taxeditor.editor.handler.defaultHandler.DefaultOpenTaxonEditorForTaxonBaseHandler.open(DefaultOpenTaxonEditorForTaxonBaseHandler.java:1)
                at eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4.execute(DefaultOpenHandlerBaseE4.java:47)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
                ... 37 more


Actions #1

Updated by Katja Luther almost 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #2

Updated by Katja Luther almost 2 years ago

  • Assignee changed from Katja Luther to Andreas Müller
  • % Done changed from 50 to 0

This should be fixed. Please review.

Actions #3

Updated by Katja Luther almost 2 years ago

  • % Done changed from 0 to 50
Actions #4

Updated by Andreas Müller almost 2 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 50 to 100

Is fixed.
Maybe we should think about an interface IHasUuid to avoid having generics like "extends DefaultOpenHandlerBaseE4".

I think it is best praxis to throw exception if none of the 2 if-branches match instead of simply doing nothing. Can you still adapt this.

Actions #5

Updated by Katja Luther almost 2 years ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

Andreas Müller wrote:

Is fixed.
Maybe we should think about an interface IHasUuid to avoid having generics like "extends DefaultOpenHandlerBaseE4".

I think it is best praxis to throw exception if none of the 2 if-branches match instead of simply doing nothing. Can you still adapt this.

now a exception is thrown.

Actions #6

Updated by Andreas Müller almost 2 years ago

  • Status changed from Resolved to Feedback
  • % Done changed from 100 to 80

I can't see that any exception is thrown now ...

Actions #7

Updated by Katja Luther almost 2 years ago

  • Status changed from Feedback to Resolved

Andreas Müller wrote:

I can't see that any exception is thrown now ...

missed to commit DefaultOpenTaxonEditorForTaxonBaseHandler.

Actions #8

Updated by Andreas Müller almost 2 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 80 to 100

Looks ok now

Actions

Also available in: Atom PDF