Project

General

Profile

Actions

bug #9590

closed

ObjectDeletedException when swap synonym and accepted taxon

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

Status:
Closed
Priority:
Highest
Assignee:
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
Severity:
normal
Found in Version:

Description

mail Nadja Korotkova:

das passierte eben beim Vertauschen von Synonym und accepted

Viele Grüße
Nadja


last remote method : http://api.cybertaxonomy.org:80/caryophyllales_spp/remoting/taxon.service
last remote request client time : 2021-04-23T13:30:57.822
last remote request response header time : Fri, 23 Apr 2021 13:30:57 GMT
client error time : 2021-04-23T13:31:09.953
login : n.korotkova
editor version : 5.22.0
server : api.cybertaxonomy.org (cybertaxonomy.org) / caryophyllales_spp
schema version : 5.22.0.0.20210315
os : Mac OS X 10.16 x86_64
java : 1.8.0_121
org.eclipse.swt.SWTException: Failed to execute runnable (org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [eu.etaxonomy.cdm.model.taxon.SecundumSource#192788])
                at org.eclipse.swt.SWT.error(SWT.java:4533)
                at org.eclipse.swt.SWT.error(SWT.java:4448)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
                at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4032)
                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3708)
                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(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:673)
                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [eu.etaxonomy.cdm.model.taxon.SecundumSource#192788]
                at org.hibernate.internal.SessionImpl.forceFlush(SessionImpl.java:1314)
                at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:170)
                at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:97)
                at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
                at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:651)
                at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:643)
                at org.hibernate.engine.spi.CascadingActions$5.cascade(CascadingActions.java:218)
                at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:423)
                at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:348)
                at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:187)
                at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:136)
                at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:150)
                at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:141)
                at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:74)
                at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
                at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1264)
                at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1780)
                at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:426)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:413)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:67)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:36)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.load(CdmEntityDaoBase.java:758)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:93)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:36)
                at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:190)
                at eu.etaxonomy.cdm.api.service.TaxonServiceImpl.isDeletable(TaxonServiceImpl.java:3033)
                at eu.etaxonomy.cdm.api.service.TaxonServiceImpl.deleteSynonym(TaxonServiceImpl.java:1250)
                at eu.etaxonomy.cdm.api.service.TaxonServiceImpl.swapSynonymAndAcceptedTaxon(TaxonServiceImpl.java:325)
                at eu.etaxonomy.cdm.api.service.TaxonServiceImpl.swapSynonymAndAcceptedTaxon(TaxonServiceImpl.java:3392)
                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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
                at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
                at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:283)
                at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
                at com.sun.proxy.$Proxy752.swapSynonymAndAcceptedTaxon(Unknown Source)
                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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
                at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:78)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
                at com.sun.proxy.$Proxy1191.swapSynonymAndAcceptedTaxon(Unknown Source)
                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.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:212)
                at eu.etaxonomy.cdm.api.remoting.DebuggingRemoteInvocationExecutor.invoke(DebuggingRemoteInvocationExecutor.java:52)
                at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
                at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
                at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:80)
                at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51)
                at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
                at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
                at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
                at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
                at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
                at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1395)
                at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
                at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
                at eu.etaxonomy.cdm.servlet.DateHeaderFilter.doFilter(DateHeaderFilter.java:55)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
                at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
                at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
                at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
                at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
                at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
                at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
                at eu.etaxonomy.cdm.server.logging.InstanceLogWrapper.handle(InstanceLogWrapper.java:47)
                at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
                at org.eclipse.jetty.server.Server.handle(Server.java:500)
                at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
                at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
                at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
                at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
                at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
                at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
                at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
                at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
                at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
                at java.lang.Thread.run(Thread.java:748)
                at org.springframework.remoting.support.RemoteInvocationUtils.fillInClientStackTraceIfPossible(RemoteInvocationUtils.java:45)
                at org.springframework.remoting.support.RemoteInvocationResult.recreate(RemoteInvocationResult.java:149)
                at org.springframework.remoting.support.RemoteInvocationBasedAccessor.recreateRemoteInvocationResult(RemoteInvocationBasedAccessor.java:85)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:158)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
                at com.sun.proxy.$Proxy93.swapSynonymAndAcceptedTaxon(Unknown Source)
                at eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation.execute(SwapSynonymAndAcceptedOperation.java:75)
                at eu.etaxonomy.taxeditor.model.AbstractUtility.lambda$3(AbstractUtility.java:146)
                at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:162)
                at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:154)
                at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)


Related issues

Related to EDIT - bug #9620: Add a preference which defines whether a new uuid is wanted for swap synoym and acceptedNewKatja Luther

Actions
Actions #1

Updated by Katja Luther almost 3 years ago

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

The method is adapted so that the taxon and the synonym keep the same, only the names are swaped, this also matches the strategy that the taxon concept does not change if a synonym of the taxon is swaped with the accepted taxon.

Please review.

Actions #2

Updated by Andreas Müller almost 3 years ago

The original problem (re-save) is fixed with d4149686.

Actions #3

Updated by Andreas Müller almost 3 years ago

Instead of having a new methode I added a new parameter (boolean newUuidForAcceptedTaxon) to the method and unified the 2 methods from the "public" perspective.

Actions #4

Updated by Andreas Müller almost 3 years ago

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

I do not understand why we need the lines

        acceptedTaxon.setTitleCache(null, true);
        acceptedTaxon.getTitleCache();
    synonym.setTitleCache(null, true);
    synonym.getTitleCache();

First of all setting the titleCaches to protected is definetely wrong and should be reverted.
But also in general it is not needed because setName will set the titleCache internally to null anyway (if aspectj is switched on which should be the case if compiled by maven).

Actions #5

Updated by Andreas Müller almost 3 years ago

Also there is a looot of commented code still in the methods. Also some warning.
Can you please remove those parts of the (commented) code that are not needed anymore?

Actions #6

Updated by Andreas Müller almost 3 years ago

To me it looks like the code commented with "//Move descriptions to new taxon" is fully redundant in both methods. If this is true (please check carefully as I did check only on the surface) we should put it in 1 common method to avoid redundant code.

Actions #7

Updated by Andreas Müller almost 3 years ago

As the 2 methods are now distinguished only by a boolean parameter we should add a ticket to define by preferences if a new uuid should be created or not. This may also be interesting for a new name usage strategy which may come in future.

Actions #8

Updated by Katja Luther almost 3 years ago

Andreas Müller wrote:

To me it looks like the code commented with "//Move descriptions to new taxon" is fully redundant in both methods. If this is true (please check carefully as I did check only on the surface) we should put it in 1 common method to avoid redundant code.

in the first method (without new uuid) the descriptions are not moved, but the text is adapted and if wanted the name used in source is set.

Actions #9

Updated by Katja Luther almost 3 years ago

  • Related to bug #9620: Add a preference which defines whether a new uuid is wanted for swap synoym and accepted added
Actions #10

Updated by Katja Luther almost 3 years ago

Andreas Müller wrote:

As the 2 methods are now distinguished only by a boolean parameter we should add a ticket to define by preferences if a new uuid should be created or not. This may also be interesting for a new name usage strategy which may come in future.

done -> #9620

Actions #11

Updated by Katja Luther almost 3 years ago

Andreas Müller wrote:

Also there is a looot of commented code still in the methods. Also some warning.
Can you please remove those parts of the (commented) code that are not needed anymore?

I cleaned up the code.

Actions #12

Updated by Katja Luther almost 3 years ago

  • Assignee changed from Katja Luther to Andreas Müller

I think this ticket can be closed?

Actions #13

Updated by Andreas Müller almost 3 years ago

  • Assignee changed from Andreas Müller to Katja Luther

Katja Luther wrote:

Andreas Müller wrote:

To me it looks like the code commented with "//Move descriptions to new taxon" is fully redundant in both methods. If this is true (please check carefully as I did check only on the surface) we should put it in 1 common method to avoid redundant code.

in the first method (without new uuid) the descriptions are not moved, but the text is adapted and if wanted the name used in source is set.

but the code

        for(TaxonDescription description : descriptions){
            String message = "Description copied from former accepted taxon: %s (Old title: %s)";
            message = String.format(message, acceptedTaxon.getTitleCache(), description.getTitleCache());
            description.setTitleCache(message, true);
            if(setNameInSource){
                for (DescriptionElementBase element: description.getElements()){
                    for (DescriptionElementSource source: element.getSources()){
                        if (source.getNameUsedInSource() == null){
                            source.setNameUsedInSource(taxonName);
                        }
                    }
                }
            }
        }

is exactly the same except for irrelevant issues . The movement of the descriptions is done much before and therefore not really related. The above code is only about updating the nameUsedInSource which does not differ in both methods. But I agree that the comment "//Move descriptions to new taxon" is misleading for this part of the code, as it is not about moving descriptions but about nameUsedInSource setting only.
Also the warning for concurrent modification is not correct here because it is only relevant at the place were actually the descriptions are moved.

I updated the code according to what I think it could look like if not being redundant. Can you please review?

Actions #14

Updated by Andreas Müller almost 3 years ago

Katja Luther wrote:

Andreas Müller wrote:

Also there is a looot of commented code still in the methods. Also some warning.
Can you please remove those parts of the (commented) code that are not needed anymore?

I cleaned up the code.

There is still a warning for "boolean sameHomotypicGroup". Can this line be removed?

Actions #15

Updated by Andreas Müller almost 3 years ago

  • Target version changed from Release 5.25 to Release 5.23
Actions #16

Updated by Katja Luther almost 3 years ago

  • Status changed from Feedback to Closed

Andreas Müller wrote:

Katja Luther wrote:

Andreas Müller wrote:

Also there is a looot of commented code still in the methods. Also some warning.
Can you please remove those parts of the (commented) code that are not needed anymore?

I cleaned up the code.

There is still a warning for "boolean sameHomotypicGroup". Can this line be removed?

removed this line and the updated code seems to be correct.

Actions

Also available in: Atom PDF