https://dev.e-taxonomy.eu/redmine/https://dev.e-taxonomy.eu/redmine/redmine/favicon.ico?14691914852021-04-27T12:54:00ZEDIT Project ManagementEDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=603862021-04-27T12:54:00ZKatja Luther
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> changed from <i>Katja Luther</i> to <i>Andreas Müller</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>50</i></li></ul><p>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.</p>
<p>Please review.</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606912021-05-11T20:23:16ZAndreas Müller
<ul></ul><p>The original problem (re-save) is fixed with d4149686. </p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606922021-05-11T20:24:50ZAndreas Müller
<ul></ul><p>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. </p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606932021-05-11T20:27:36ZAndreas Müller
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Feedback</i></li><li><strong>Assignee</strong> changed from <i>Andreas Müller</i> to <i>Katja Luther</i></li></ul><p>I do not understand why we need the lines</p>
<pre> acceptedTaxon.setTitleCache(null, true);
acceptedTaxon.getTitleCache();
synonym.setTitleCache(null, true);
synonym.getTitleCache();
</pre>
<p>First of all setting the titleCaches to protected is definetely wrong and should be reverted.<br>
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). </p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606942021-05-11T20:33:39ZAndreas Müller
<ul></ul><p>Also there is a looot of commented code still in the methods. Also some warning.<br>
Can you please remove those parts of the (commented) code that are not needed anymore?</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606952021-05-11T20:36:13ZAndreas Müller
<ul></ul><p>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.</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=606962021-05-11T20:38:42ZAndreas Müller
<ul></ul><p>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.</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607292021-05-12T12:27:55ZKatja Luther
<ul></ul><p>Andreas Müller wrote:</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>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. </p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607302021-05-12T12:30:39ZKatja Luther
<ul><li><strong>Related to</strong> <i><a class="issue tracker-4 status-1 priority-11 priority-default" href="/redmine/issues/9620">bug #9620</a>: Add a preference which defines whether a new uuid is wanted for swap synoym and accepted</i> added</li></ul> EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607322021-05-12T12:31:04ZKatja Luther
<ul></ul><p>Andreas Müller wrote:</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>done -> <a class="issue tracker-4 status-1 priority-11 priority-default" title="bug: Add a preference which defines whether a new uuid is wanted for swap synoym and accepted (New)" href="https://dev.e-taxonomy.eu/redmine/issues/9620">#9620</a></p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607332021-05-12T12:51:13ZKatja Luther
<ul></ul><p>Andreas Müller wrote:</p>
<blockquote>
<p>Also there is a looot of commented code still in the methods. Also some warning.<br>
Can you please remove those parts of the (commented) code that are not needed anymore?</p>
</blockquote>
<p>I cleaned up the code.</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607352021-05-12T12:52:47ZKatja Luther
<ul><li><strong>Assignee</strong> changed from <i>Katja Luther</i> to <i>Andreas Müller</i></li></ul><p>I think this ticket can be closed?</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607472021-05-12T15:00:28ZAndreas Müller
<ul><li><strong>Assignee</strong> changed from <i>Andreas Müller</i> to <i>Katja Luther</i></li></ul><p>Katja Luther wrote:</p>
<blockquote>
<p>Andreas Müller wrote:</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>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.</p>
</blockquote>
<p>but the code </p>
<pre> 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);
}
}
}
}
}
</pre>
<p>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.<br>
Also the warning for concurrent modification is not correct here because it is only relevant at the place were actually the descriptions are moved.</p>
<p>I updated the code according to what I think it could look like if not being redundant. Can you please review?</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=607482021-05-12T15:01:43ZAndreas Müller
<ul></ul><p>Katja Luther wrote:</p>
<blockquote>
<p>Andreas Müller wrote:</p>
<blockquote>
<p>Also there is a looot of commented code still in the methods. Also some warning.<br>
Can you please remove those parts of the (commented) code that are not needed anymore?</p>
</blockquote>
<p>I cleaned up the code.</p>
</blockquote>
<p>There is still a warning for "boolean sameHomotypicGroup". Can this line be removed?</p>
EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=609162021-05-17T11:29:24ZAndreas Müller
<ul><li><strong>Target version</strong> changed from <i>Release 5.25</i> to <i>Release 5.23</i></li></ul> EDIT - bug #9590: ObjectDeletedException when swap synonym and accepted taxonhttps://dev.e-taxonomy.eu/redmine/issues/9590?journal_id=609222021-05-17T11:37:06ZKatja Luther
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Andreas Müller wrote:</p>
<blockquote>
<p>Katja Luther wrote:</p>
<blockquote>
<p>Andreas Müller wrote:</p>
<blockquote>
<p>Also there is a looot of commented code still in the methods. Also some warning.<br>
Can you please remove those parts of the (commented) code that are not needed anymore?</p>
</blockquote>
<p>I cleaned up the code.</p>
</blockquote>
<p>There is still a warning for "boolean sameHomotypicGroup". Can this line be removed?</p>
</blockquote>
<p>removed this line and the updated code seems to be correct.</p>