Project

General

Profile

« Previous | Next » 

Revision 1726e8f0

Added by Patrick Plitzner almost 8 years ago

Avoid duplicate UUIDs by fixing the order of adding original sources
#5448

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
273 273
            RedListUtil.logMessage(id, "Taxon name inconsistent! taxon.titleCache <-> Column "+RedListUtil.TAXNAME+": "+nameCache+" <-> "+taxNameString, logger);
274 274
        }
275 275

  
276

  
277
        taxaToSave.add(taxonBase);
278

  
279
        //id
280
        ImportHelper.setOriginalSource(taxonBase, state.getTransactionalSourceReference(), id, RedListUtil.TAXON_GESAMTLISTE_NAMESPACE);
281
        state.getTaxonMap().put(id, taxonBase.getUuid());
282

  
283 276
        /*check if taxon/synonym is also in checklist
284 277
         * 1. create new taxon with the same name (in the checklist classification)
285 278
         * 2. create congruent concept relationship between both
......
293 286
                taxonRelation.setDoubtful(true);//TODO Ist das mit " mit Fragezeichen" gemeint?
294 287
            }
295 288
            ImportHelper.setOriginalSource(clone, state.getTransactionalSourceReference(), id, RedListUtil.TAXON_CHECKLISTE_NAMESPACE);
296
            state.getTaxonMap().put(id, clone.getUuid());
297 289
            taxaToSave.add(clone);
298 290
        }
299 291

  
292
        //NOTE: the source has to be added after cloning or otherwise the clone would also get the source
293
        ImportHelper.setOriginalSource(taxonBase, state.getTransactionalSourceReference(), id, RedListUtil.TAXON_GESAMTLISTE_NAMESPACE);
294
        taxaToSave.add(taxonBase);
295

  
300 296
    }
301 297

  
302 298
    private Rank makeRank(long id, RedListGefaesspflanzenImportState state, String rankStr) {

Also available in: Unified diff