You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/03/02 11:50:21 UTC

[GitHub] [logging-log4j2] vy commented on a change in pull request #471: LOG4J2-2948 Replace HashSet with IdentityHashMap in ParameterFormatter to detect cycles.

vy commented on a change in pull request #471:
URL: https://github.com/apache/logging-log4j2/pull/471#discussion_r585384100



##########
File path: log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
##########
@@ -538,24 +536,28 @@ private static void appendArray(final Object o, final StringBuilder str, Set<Str
                     } else {
                         str.append(", ");
                     }
-                    recursiveDeepToString(current, str, new HashSet<>(dejaVu));
+                    recursiveDeepToString(current, str, effectiveDejaVu);

Review comment:
       Good catch! Putting the cloning back with a unit test.

##########
File path: log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
##########
@@ -448,7 +450,7 @@ static String deepToString(final Object o) {
      * @param str    the StringBuilder that o will be appended to
      * @param dejaVu a list of container identities that were already used.

Review comment:
       :+1: Will do.

##########
File path: log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
##########
@@ -448,7 +450,7 @@ static String deepToString(final Object o) {
      * @param str    the StringBuilder that o will be appended to
      * @param dejaVu a list of container identities that were already used.
      */
-    static void recursiveDeepToString(final Object o, final StringBuilder str, final Set<String> dejaVu) {
+    static void recursiveDeepToString(final Object o, final StringBuilder str, final Set<Object> dejaVu) {

Review comment:
       Makes sense, implemented.




----------------------------------------------------------------
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:
users@infra.apache.org