]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Use synchronized hash map instead of ConcurrentHashMap in LazyModule 83/1683/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 3 Apr 2018 12:15:11 +0000 (15:15 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 3 Apr 2018 12:15:11 +0000 (15:15 +0300)
refs #7826

Change-Id: I660f5f3312a7d1db49441f02d55864e36c950d74

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/LazyModule.java

index 41aff8d3122813cf153cdd43e36e5dea197ccd36..dc1e40e7321e3097d84be7c439aeb7a5a0c10cb6 100644 (file)
@@ -2,8 +2,9 @@ package org.simantics.scl.compiler.module;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.Map;
 
 import org.simantics.scl.compiler.constants.Constant;
 import org.simantics.scl.compiler.elaboration.chr.CHRRuleset;
@@ -27,9 +28,9 @@ import gnu.trove.map.hash.THashMap;
 public abstract class LazyModule implements Module {
 
     private final String moduleName;
-    private final ConcurrentHashMap<String, SCLValue> values = new ConcurrentHashMap<String, SCLValue>();
-    private final ConcurrentHashMap<String, SCLRelation> relations = new ConcurrentHashMap<String, SCLRelation>();
-    private final ConcurrentHashMap<String, SCLEntityType> entityTypes = new ConcurrentHashMap<String, SCLEntityType>();
+    private final Map<String, SCLValue> values = Collections.synchronizedMap(new HashMap<String, SCLValue>());
+    private final Map<String, SCLRelation> relations = Collections.synchronizedMap(new HashMap<String, SCLRelation>());
+    private final Map<String, SCLEntityType> entityTypes = Collections.synchronizedMap(new HashMap<String, SCLEntityType>());
     
     protected abstract SCLValue createValue(String name);