ramanathan1504 commented on code in PR #4393:
URL: https://github.com/apache/logging-log4j2/pull/4393#discussion_r4329432737


##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/lookup/StrSubstitutorTest.java:
##########
@@ -138,6 +138,79 @@ void testValueEscapeDelimiter() {
         assertEquals("", sub.replace("${:\\-:-}"));
     }
 
+    @Test
+    void testEscapedClosingBraceInDefaultValue() {
+        final Map<String, String> valuesMap = new HashMap<>();
+        final StrSubstitutor sub = new StrSubstitutor(valuesMap);
+        // Example from https://github.com/apache/logging-log4j2/issues/2679
+        assertEquals("%d{yyyy-MM-dd HH:mm:ss}{GMT+00}", 
sub.replace("${undefined:-%d{yyyy-MM-dd HH:mm:ss$}{GMT+00$}}"));
+        assertEquals("}", sub.replace("${undefined:-$}}"));
+        // The same expression through the Interpolator, as in a configuration 
file

Review Comment:
   The assertion below already says this.
   
   ```suggestion
   ```



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