forked from Qortal/qortal
Synchronize lists, to prevent an occasional ConcurrentModificationException
This commit is contained in:
parent
af06774ba6
commit
9daf7a6668
@ -13,6 +13,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ResourceList {
|
||||
@ -20,7 +21,7 @@ public class ResourceList {
|
||||
private static final Logger LOGGER = LogManager.getLogger(ResourceList.class);
|
||||
|
||||
private String name;
|
||||
private List<String> list = new ArrayList<>();
|
||||
private List<String> list = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
/**
|
||||
* ResourceList
|
||||
|
@ -5,6 +5,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -13,7 +14,7 @@ public class ResourceListManager {
|
||||
private static final Logger LOGGER = LogManager.getLogger(ResourceListManager.class);
|
||||
|
||||
private static ResourceListManager instance;
|
||||
private List<ResourceList> lists = new ArrayList<>();
|
||||
private List<ResourceList> lists = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
|
||||
public ResourceListManager() {
|
||||
|
Loading…
Reference in New Issue
Block a user