[Minor] Cleanup in I18nMessage

This commit is contained in:
Robert von Burg 2023-02-13 08:31:11 +01:00
parent d0faafa247
commit 270288b5ad
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 5 additions and 3 deletions

View File

@ -60,10 +60,12 @@ public class I18nMessage {
public I18nMessage(I18nMessage other) {
this.key = other.key;
this.values = other.values;
this.values = new Properties(other.values);
this.bundle = other.bundle;
this.bundleName = other.bundleName;
this.message = other.message;
this.exception = other.exception;
this.stackTrace = other.stackTrace;
}
public String getKey() {
@ -81,7 +83,7 @@ public class I18nMessage {
}
public Object getValue(String key) {
return this.values.get(key);
return this.values.getOrDefault(key, null);
}
private ResourceBundle getBundle(Locale locale) {
@ -253,7 +255,7 @@ public class I18nMessage {
private static MapOfMaps<String, Locale, ResourceBundle> getBundleMap() {
if (bundleMap == null) {
synchronized (I18nMessage.class) {
synchronized (logger) {
bundleMap = findAllBundles();
}
}