Project

General

Profile

« Previous | Next » 

Revision 541ae6bc

Added by Andreas Müller over 2 years ago

ref #7980 fix concurrent modification exception

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/StructuredDescriptionAggregation.java
236 236
    private <T extends DescriptionBase<?>> void mergeSourceDescription(T existingSourceDescription, T newSourceDescription) {
237 237

  
238 238
        Set<DescriptionElementBase> elementsToRemove = new HashSet<>(existingSourceDescription.getElements());
239

  
240
        for (DescriptionElementBase newElement : newSourceDescription.getElements()){
239
        Set<DescriptionElementBase> newElements = new HashSet<>(newSourceDescription.getElements());
240
        for (DescriptionElementBase newElement : newElements){
241 241
            DescriptionElementBase newElementClone = newElement.clone();
242 242
            Optional<DescriptionElementBase> matchingElement = elementsToRemove.stream()
243 243
                    .filter(e->e.getFeature()!= null

Also available in: Unified diff