Skip to content

Commit

Permalink
fix potential ConcurrentModificationException (apache#6031)
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj authored Apr 20, 2020
1 parent 00cdc53 commit dbda449
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -61,7 +62,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
* @return all registries
*/
public static Collection<Registry> getRegistries() {
return Collections.unmodifiableCollection(REGISTRIES.values());
return Collections.unmodifiableCollection(new LinkedList<>(REGISTRIES.values()));
}

public static Registry getRegistry(String key) {
Expand Down

0 comments on commit dbda449

Please sign in to comment.