dxbjavid opened a new pull request, #750:
URL: https://github.com/apache/commons-text/pull/750

   **Unhandled StringIndexOutOfBoundsException on a trailing-whitespace 
argument index**
   
   Reading through readArgumentIndex I noticed that once it has accumulated a 
digit and then meets whitespace, it calls seekNonWs and immediately does 
pattern.charAt(pos.getIndex()) again. If that whitespace runs to the end of the 
pattern the index now equals the length, so a pattern like "{0 " throws 
StringIndexOutOfBoundsException straight out of the constructor, whereas every 
other unterminated element ("{0", "{0,number ") reports the documented 
IllegalArgumentException. I broke out of the loop when the skip reaches the end 
so it falls through to the existing unterminated-element error. Added a test 
for the "{0 " case.


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