Re: RFR 8027640 : String.indexOf(String, int) for the empty string case not specified
On Feb 25, 2014, at 12:52 AM, Brent Christian brent.christ...@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 * pThe 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
Re: RFR 8027640 : String.indexOf(String, int) for the empty string case not specified
On 2/25/14 4:41 AM, Paul Sandoz wrote: On Feb 25, 2014, at 12:52 AM, Brent Christian brent.christ...@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 * pThe returned index is the largest value {@code k} for which: Great catch, Paul. Thanks! -Brent
RFR 8027640 : String.indexOf(String,int) for the empty string case not specified
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/ 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