Skip to content

Commit

Permalink
Fix concurrent map access exception (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Feb 20, 2024
1 parent 01fd7ec commit 767ea9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/bcel/util/SyntheticRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@
*/
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);
Expand Down

0 comments on commit 767ea9f

Please sign in to comment.