This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


The following commit(s) were added to refs/heads/master by this push:
     new 767ea9f4 Fix concurrent map access exception (#275)
767ea9f4 is described below

commit 767ea9f458c26de469fdbc88024a54bc388ac90a
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Tue Feb 20 16:39:57 2024 +0100

    Fix concurrent map access exception (#275)
---
 src/main/java/org/apache/bcel/util/SyntheticRepository.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/SyntheticRepository.java 
b/src/main/java/org/apache/bcel/util/SyntheticRepository.java
index c046cb4e..f1889a81 100644
--- a/src/main/java/org/apache/bcel/util/SyntheticRepository.java
+++ b/src/main/java/org/apache/bcel/util/SyntheticRepository.java
@@ -16,8 +16,8 @@
  */
 package org.apache.bcel.util;
 
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * This repository is used in situations where a Class is created outside the 
realm of a ClassLoader. Classes are loaded
@@ -32,7 +32,7 @@ import java.util.Map;
  */
 public class SyntheticRepository extends MemorySensitiveClassPathRepository {
 
-    private static final Map<ClassPath, SyntheticRepository> MAP = new 
HashMap<>(); // CLASSPATH X REPOSITORY
+    private static final Map<ClassPath, SyntheticRepository> MAP = new 
ConcurrentHashMap<>(); // CLASSPATH X REPOSITORY
 
     public static SyntheticRepository getInstance() {
         return getInstance(ClassPath.SYSTEM_CLASS_PATH);

Reply via email to