RFR 8027640 : String.indexOf(String, int) for the empty string case not specified

Paul Sandoz paul.sandoz at oracle.com
Tue Feb 25 12:41:04 UTC 2014


On Feb 25, 2014, at 12:52 AM, Brent Christian <brent.christian at oracle.com> wrote:

> Please review my changes for:
> https://bugs.openjdk.java.net/browse/JDK-8027640
> 
> The webrev is here:
> http://cr.openjdk.java.net/~bchristi/8027640/webrev.00/
> 

In AbstractStringBuilder there is a small typo, "k<":

1348      * <p>The returned index is the largest value {@code k<} for which:

Otherwise looks ok.

Paul.

> 
> This is a small cleanup to reconcile the String[last]indexOf() spec with longstanding behavior.  There are no changes to executable code.
> 
> In String, the "Math.min(fromIndex, this.length())" clause is brought over from String[Buffer|Builder] for indexOf(String,int) and lastIndexOf(String,int).  This resolves the issue for which the bug was filed.
> 
> To further sync up the [last]indexOf() docs, I ported the 6940381 wording improvements from String to String[Buffer|Builder].  I also made a few doclint updates to the code in question.
> 
> Thanks,
> -Brent
> 



More information about the core-libs-dev mailing list