You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "vlsi (via GitHub)" <gi...@apache.org> on 2023/05/06 10:49:34 UTC
[GitHub] [jmeter] vlsi commented on pull request #5869: Add more variables to template to compute sampler names
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-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org