Skip to content

Commit

Permalink
Fix Folia locale string concurrency issue Fixes #5097
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Nov 9, 2024
1 parent f90a15a commit 2ea9cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 2.2.027
Fixed concurrency issue with Folia regarding locale strings

Version 2.2.026
Fixed NullPointerException on ChunkUnloadEvent
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/gmail/nossr50/locale/LocaleLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class LocaleLoader {
private static final String BUNDLE_ROOT = "com.gmail.nossr50.locale.locale";
private static final String OVERRIDE_FILE_NAME = "locale_override.properties";
private static Map<String, String> bundleCache = new HashMap<>();
// Must be concurrent to accomodate Folia
private static Map<String, String> bundleCache = new ConcurrentHashMap<>();
private static ResourceBundle bundle = null;
private static ResourceBundle filesystemBundle = null;
private static ResourceBundle enBundle = null;
Expand Down

0 comments on commit 2ea9cff

Please sign in to comment.