vlsi commented on PR #5869:
URL: https://github.com/apache/jmeter/pull/5869#issuecomment-1537114844

   TL;DR: adding new language constructs to existing languages is not easy. We 
should refrain from extending existing languages.
   
   ```java
   MessageFormat.format("Hello {")
   ```
   
   yields
   
   ```
   java.lang.IllegalArgumentException: Unmatched braces in the pattern.
        at 
java.base/java.text.MessageFormat.applyPattern(MessageFormat.java:521)
        at java.base/java.text.MessageFormat.<init>(MessageFormat.java:371)
        at java.base/java.text.MessageFormat.format(MessageFormat.java:860)
   ```
   
   `MessageFormat.format("Doesn't contain quote")` yields `Doesnt contain 
quote`.
   
   So we should either declare that the format uses `MessageFormat` patterns 
(with all the `'` for escapes), or we should declare we use a completely 
different language with its own escapes.
   
   If we go with `MessageFormat`, then we should assume people could use `'` 
for literal parts like `Doesn''t contain quote` for expressing `Doesn't`.
   
   That means we must not blindly replace `#{...}` as it might be inside quotes.
   If we continue with `MessageFormat`, we should probably use proper quote 
handling when replacing `#{url}`-like named placeholders.
   
   
   


-- 
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: dev-unsubscr...@jmeter.apache.org

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

Reply via email to