Minor fix for ConcurrentModificationException

This commit is contained in:
Joakim Erdfelt 2014-04-07 10:31:34 -07:00
parent 5ca59f6087
commit eb53a9ce6d
2 changed files with 12 additions and 11 deletions

View File

@ -268,6 +268,16 @@ public class Module
private void init(BaseHome basehome)
{
parentNames = new HashSet<>();
optionalParentNames = new HashSet<>();
parentEdges = new HashSet<>();
childEdges = new HashSet<>();
xmls = new ArrayList<>();
initialise = new ArrayList<>();
libs = new ArrayList<>();
files = new ArrayList<>();
jvmArgs = new ArrayList<>();
String name = basehome.toShortForm(file);
// Find module system name (usually in the form of a filesystem reference)
@ -279,16 +289,6 @@ public class Module
}
this.fileRef = mat.group(1).replace('\\','/');
this.logicalName = this.fileRef;
parentNames = new HashSet<>();
optionalParentNames = new HashSet<>();
parentEdges = new HashSet<>();
childEdges = new HashSet<>();
xmls = new ArrayList<>();
initialise = new ArrayList<>();
libs = new ArrayList<>();
files = new ArrayList<>();
jvmArgs = new ArrayList<>();
}
public boolean isEnabled()

View File

@ -375,7 +375,8 @@ public class Modules implements Iterable<Module>
public void registerParentsIfMissing(BaseHome basehome, StartArgs args, Module module) throws IOException
{
for (String name : new ArrayList<>(module.getParentNames()))
Set<String> parents = new HashSet<>(module.getParentNames());
for (String name : parents)
{
if (!modules.containsKey(name))
{