Skip to content

Commit 635173f

Browse files
Merge pull request #44379 from warunalakshitha/fix_semtype_concurrent_issue
Fix Intermittent ConcurrentModificationException with Type checker when running load tests
2 parents 7d5efc3 + a0a52c7 commit 635173f

File tree

1 file changed

+4
-4
lines changed
  • bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/semtype

1 file changed

+4
-4
lines changed

bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/semtype/CellAtomicType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import io.ballerina.runtime.api.types.semtype.SemType;
2525
import io.ballerina.runtime.api.types.semtype.TypeAtom;
2626

27-
import java.util.HashMap;
2827
import java.util.Map;
28+
import java.util.concurrent.ConcurrentHashMap;
2929

3030
/**
3131
* CellAtomicType node.
@@ -67,9 +67,9 @@ public enum CellMutability {
6767

6868
private static final class CellAtomCache {
6969

70-
private static final Map<Integer, CellAtomicType> NONE_CACHE = new HashMap<>();
71-
private static final Map<Integer, CellAtomicType> LIMITED_CACHE = new HashMap<>();
72-
private static final Map<Integer, CellAtomicType> UNLIMITED_CACHE = new HashMap<>();
70+
private static final Map<Integer, CellAtomicType> NONE_CACHE = new ConcurrentHashMap<>();
71+
private static final Map<Integer, CellAtomicType> LIMITED_CACHE = new ConcurrentHashMap<>();
72+
private static final Map<Integer, CellAtomicType> UNLIMITED_CACHE = new ConcurrentHashMap<>();
7373

7474
private static CellAtomicType get(SemType semType, CellMutability mut) {
7575
if (semType.some() != 0) {

0 commit comments

Comments
 (0)