Revision c9e4e6f8
Added by Katja Luther almost 2 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperation.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.HashSet; |
13 |
import java.util.Iterator; |
|
13 | 14 |
import java.util.List; |
14 | 15 |
import java.util.Set; |
15 | 16 |
|
... | ... | |
21 | 22 |
|
22 | 23 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
23 | 24 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
25 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
24 | 26 |
import eu.etaxonomy.cdm.model.media.ExternalLink; |
25 | 27 |
import eu.etaxonomy.cdm.model.media.ExternalLinkType; |
26 | 28 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
69 | 71 |
|
70 | 72 |
monitor.worked(20); |
71 | 73 |
UpdateResult result = CdmStore.getService(ITaxonService.class).swapSynonymAndAcceptedTaxon(synonym.getUuid(), element.getUuid(), setNameInSource, false);//TODO |
74 |
// element = (Taxon) result.getCdmEntity(); |
|
72 | 75 |
element = (Taxon)CdmStore.getService(ITaxonService.class).load(result.getCdmEntity().getUuid()); |
73 | 76 |
Synonym newSyn = null; |
74 | 77 |
if (!result.getUpdatedObjects().isEmpty()){ |
78 |
Iterator<CdmBase> it = result.getUpdatedObjects().iterator(); |
|
79 |
while(it.hasNext()){ |
|
80 |
CdmBase tb = it.next(); |
|
81 |
if (tb instanceof Synonym){ |
|
82 |
newSyn = (Synonym)tb; |
|
83 |
} |
|
84 |
} |
|
75 | 85 |
newSyn = (Synonym)CdmStore.getService(ITaxonService.class).load(result.getUpdatedObjects().iterator().next().getUuid()); |
76 | 86 |
} |
77 | 87 |
Reference accRef = element.getSec(); |
Also available in: Unified diff
ref #9668: hotfix for secundum handling when swap syn and accepted - continue