vy commented on code in PR #2101:
URL: https://github.com/apache/logging-log4j2/pull/2101#discussion_r1429891139
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/JdkMapAdapterStringMap.java:
##########
@@ -52,6 +52,11 @@ public JdkMapAdapterStringMap() {
public JdkMapAdapterStringMap(final Map<String, String> map) {
this.map = Objects.requireNonNull(map, "map");
+ try {
+ map.replace(Strings.EMPTY, Strings.EMPTY, Strings.EMPTY);
+ } catch (final UnsupportedOperationException ignored) {
+ immutable = true;
+ }
Review Comment:
I won't object the change, but I wouldn't implement this myself. It is a bet
for an unsolicited optimization.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]