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


##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverterTest.java:
##########
@@ -79,6 +79,21 @@ public String toString() {
         }
     }
 
+    private static final class CustomException extends Exception {

Review Comment:
   Could you implement the following changes, please?
   
   1. Rename this to `ToStringOverridingException`
   2. Use `super(EXCEPTION)` in ctor, and receive no arguments
   3. Create `ToStringOverridingException.INSTANCE` field and use it (similar 
to `TestFriendlyException.INSTANCE`)
   4. Return a constant in `toString()`, e.g., `return "foo"`



##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverterTest.java:
##########
@@ -545,9 +572,13 @@ private static List<Exception> 
createExceptionsOfDifferentDepths() {
     }
 
     static String convert(final String pattern) {
+        return convert(pattern, EXCEPTION);
+    }
+
+    static String convert(final String pattern, final Throwable throwable) {

Review Comment:
   This can be `private`.



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

Reply via email to