JCgH4164838Gh792C124B5 commented on a change in pull request #477:
URL: https://github.com/apache/struts/pull/477#discussion_r598130091
##########
File path:
core/src/main/java/com/opensymphony/xwork2/util/AbstractLocalizedTextProvider.java
##########
@@ -413,11 +411,11 @@ public ResourceBundle findResourceBundle(String
aBundleName, Locale locale) {
}
} catch (MissingResourceException e) {
LOG.debug("Missing resource bundle [{}]!", aBundleName, e);
- missingBundles.add(key);
+ missingBundles.put(key, Boolean.TRUE);
}
} else {
LOG.debug("Missing resource bundle [{}]!", aBundleName);
- missingBundles.add(key);
+ missingBundles.put(key, Boolean.TRUE);
Review comment:
And the same `missingBundles.putIfAbsent(key, Boolean.TRUE);`
consideration here.
##########
File path:
core/src/main/java/com/opensymphony/xwork2/util/AbstractLocalizedTextProvider.java
##########
@@ -413,11 +411,11 @@ public ResourceBundle findResourceBundle(String
aBundleName, Locale locale) {
}
} catch (MissingResourceException e) {
LOG.debug("Missing resource bundle [{}]!", aBundleName, e);
- missingBundles.add(key);
+ missingBundles.put(key, Boolean.TRUE);
Review comment:
Consider changing `put()` to `putIfAbsent()` as the closest behaviour
match to the previous `add()` method usage:
`missingBundles.putIfAbsent(key, Boolean.TRUE);`
##########
File path:
core/src/main/java/com/opensymphony/xwork2/util/AbstractLocalizedTextProvider.java
##########
@@ -61,7 +59,7 @@
private final ConcurrentMap<MessageFormatKey, MessageFormat>
messageFormats = new ConcurrentHashMap<>();
private final ConcurrentMap<Integer, List<String>> classLoaderMap = new
ConcurrentHashMap<>();
- private final Set<String> missingBundles = Collections.synchronizedSet(new
HashSet<String>());
+ private final ConcurrentMap<String,Boolean> missingBundles = new
ConcurrentHashMap<>();
Review comment:
Minor formatting suggestion: Add a space before `Boolean` for:
`ConcurrentMap<String, Boolean>`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]