dxbjavid opened a new pull request, #1740:
URL: https://github.com/apache/commons-lang/pull/1740
Port of apache/commons-text#759 to the equivalent
org.apache.commons.lang3.text.ExtendedMessageFormat.
The registry-based ExtendedMessageFormat constructor parses its pattern with
seekNonWs, which asks the split matcher about the character at the current
parse index without first checking it is still inside the buffer. A truncated
format element such as {, {0, or trailing text like {0}extra{ leaves the parse
position at the end of the pattern, so the matcher reads one past the char
array and the constructor throws ArrayIndexOutOfBoundsException rather than the
documented IllegalArgumentException that the plain constructor already gives
for the same input.
This bounds the seek to the pattern length so those patterns report the
usual unterminated-format-element error. A regression test covers the three
shapes above, alongside the JRE sanity checks you added post-merge on the
commons-text side.
--
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]