Fix: ConcurrentModificationException
This commit is contained in:
@@ -56,6 +56,9 @@ public final class OptiFineBMCLVersionList extends VersionList<OptiFineRemoteVer
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
lock.writeLock().lock();
|
||||
|
||||
try {
|
||||
versions.clear();
|
||||
Set<String> duplicates = new HashSet<>();
|
||||
List<OptiFineVersion> root = JsonUtils.GSON.fromJson(task.getResult(), new TypeToken<List<OptiFineVersion>>() {
|
||||
@@ -74,6 +77,9 @@ public final class OptiFineBMCLVersionList extends VersionList<OptiFineRemoteVer
|
||||
String gameVersion = VersionNumber.normalize(element.getGameVersion());
|
||||
versions.put(gameVersion, new OptiFineRemoteVersion(gameVersion, version, mirror, isPre));
|
||||
}
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user