IDEA-344652 Replace direct access to bundles with getResourceBundles

GitOrigin-RevId: a739e1c7956771675248b19467fed579193bc15e
This commit is contained in:
Vera Petrenkova
2024-03-01 09:58:22 +01:00
committed by intellij-monorepo-bot
parent b0b0ac9527
commit 3d040212b9
2 changed files with 7 additions and 3 deletions

View File

@@ -38,8 +38,7 @@ public class DynamicBundle extends AbstractBundle {
private static @NotNull String ourLangTag = Locale.ENGLISH.toLanguageTag();
@ApiStatus.Internal
public static final ConcurrentMap<String, ResourceBundle> bundles = new ConcurrentHashMap<>();
private static final ConcurrentMap<String, ResourceBundle> bundles = new ConcurrentHashMap<>();
/**
* Creates a new instance of the message bundle. It's usually stored in a private static final field, and static methods delegating
@@ -376,6 +375,11 @@ public class DynamicBundle extends AbstractBundle {
return Locale.forLanguageTag(ourLangTag);
}
@ApiStatus.Internal
public static Map<String, ResourceBundle> getResourceBundles() {
return Collections.unmodifiableMap(bundles);
}
private enum BundleOrder {
FOLDER_REGION_LEVEL_PLUGIN(0), //localization/zh/CN/
FOLDER_REGION_LEVEL_PLATFORM(1),

View File

@@ -32,7 +32,7 @@ class ShowBundleMessagesDialogAction : AnAction(), DumbAware {
}
override fun createCenterPanel(): JComponent {
val bundleMap = DynamicBundle.bundles
val bundleMap = DynamicBundle.getResourceBundles()
table = JBTable(object : DefaultTableModel(Vector(listOf("Bundle name", "Values")), bundleMap.size) {
override fun isCellEditable(row: Int, column: Int): Boolean {
return false