vy commented on code in PR #3868:
URL: https://github.com/apache/logging-log4j2/pull/3868#discussion_r2264564276


##########
log4j-api/src/main/java/org/apache/logging/log4j/CloseableThreadContext.java:
##########
@@ -206,7 +207,7 @@ public void close() {
         }
 
         private void closeMap() {
-            final Map<String, String> valuesToReplace = new 
HashMap<>(originalValues.size());
+            final Map<String, String> valuesToReplace = 
Maps.newHashMap(originalValues.size());

Review Comment:
   I've reviewed all `log4j-api` and `log4j-core` changes, and found this to be 
only change that one _might_ claim to be of importance. I prefer a PR that
   
   1. Replaces all `HashMap#new(int)` calls with a `HashMap#new()` (Since 
they're all incorrectly implemented, it is better to just stick to defaults.)
   2. Replaces only this line in `CloseableThreadContext` with `new 
HashMap((int) Math.ceil(originalValues.size() / 0.75))`
   
   @ppkarwasz, WDYT?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to