Project

General

Profile

« Previous | Next » 

Revision c844706d

Added by Andreas Müller almost 4 years ago

fix possible concurrent modification exception

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmFormElement.java
5 5

  
6 6
import java.util.ConcurrentModificationException;
7 7
import java.util.HashSet;
8
import java.util.Iterator;
9 8
import java.util.List;
10 9
import java.util.Set;
11 10

  
......
147 146
	 */
148 147
	@Override
149 148
    public void removeElements(){
150
        for (Iterator<ICdmFormElement> iterator = getElements().iterator();iterator.hasNext();) {
151
            ICdmFormElement childElement = iterator.next();
152
			// recursion
149
	    Set<ICdmFormElement> tmpElements = new HashSet<>(getElements());
150
        for (ICdmFormElement childElement : tmpElements) {
151
            // recursion
153 152
			childElement.removeElements();
154 153

  
155 154
			// unregister selection arbitrator

Also available in: Unified diff