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

   CharSequenceUtils.lastIndexOf treats a start index equal to the last char as 
no match for supplementary code points, so StringUtils.lastIndexOf(seq, 
codePoint) on a StringBuilder or other non-String CharSequence always returns 
-1 even when the code point is present, because the default overload passes 
startPos equal to the length. A supplementary code point spans two chars and 
its high surrogate can begin no later than sz-2, so the search origin should be 
clamped there rather than bailing out. With the clamp the results match 
java.lang.String, as the added assertions verify.


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