Skip to content

Commit

Permalink
GH-218 - Fix potential ConcurrentModificationException in PluginLogger.
Browse files Browse the repository at this point in the history
Switching to a ConcurrentSkipListMap to allow safe concurrent executions but retain the ordering by keys.
  • Loading branch information
odrotbohm committed Jan 17, 2024
1 parent 27e94a5 commit c086e97
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentSkipListMap;

/**
* Logger to aggregate information about transformations applied to individual {@link TypeDescription}s.
Expand All @@ -35,7 +36,7 @@ enum PluginLogger {

INSTANCE;

private Map<String, Set<LogEntry>> logs = new TreeMap<>();
private Map<String, Set<LogEntry>> logs = new ConcurrentSkipListMap<>();

/**
* Obtains the {@link Log} for the given {@link TypeDescription} and module name.
Expand Down

0 comments on commit c086e97

Please sign in to comment.