alhudz opened a new pull request, #1819:
URL: https://github.com/apache/commons-lang/pull/1819

   Repro: `new ExtendedMessageFormat("Don't panic {0}", registry).format(args)` 
throws `IllegalArgumentException: Unterminated quoted string at position 4`.
   Expected: `Dont panic {0}`, which is what `java.text.MessageFormat` and the 
registry-less `ExtendedMessageFormat` both return; `MessageFormat` documents 
that an unmatched quote is treated as closed at the end of the pattern.
   Cause: `appendQuotedString` throws when the closing quote is missing, so 
supplying a `FormatFactory` registry changes which patterns parse.
   Fix: consume the remainder of the pattern as the quoted string, matching 
`MessageFormat`; `toPattern()` still round-trips. The Commons Text copy of this 
class behaves the same way and could take the same change.
   
   - [x] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
   - [x] Read the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html).
   - [x] Run a successful build using the default Maven goal with `mvn` (full 
test suite, Checkstyle, SpotBugs, PMD, japicmp and javadoc all pass locally).
   - [x] Write unit tests that match behavioral changes: 
`ExtendedMessageFormatTest#testUnmatchedQuote` fails with 
`IllegalArgumentException` before the runtime change and passes after.
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [x] Each commit in the pull request should have a meaningful subject line 
and body.
   


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