Re: RFR [XXS] 8130778: (str) Make AbstractStringBuilder.append(CharSequence, int, int) to throw StringIndexOutOfBoundsException

2015-07-09 Thread Ivan Gerasimov
What about this variant? http://cr.openjdk.java.net/~igerasim/8130778/00/webrev/ So, we'll throw SOOB only if the CharSequence is actually a String. I've also added the same code to insert(int,CharSequence,int,int) for the sake of symmetry. Sincerely yours, Ivan On 11.07.2015 20:22, Xueming S

Re: RFR [XXS] 8130778: (str) Make AbstractStringBuilder.append(CharSequence, int, int) to throw StringIndexOutOfBoundsException

2015-07-08 Thread Ivan Gerasimov
Thanks Sherman for looking to that! On 11.07.2015 20:22, Xueming Shen wrote: Hi, Arguably the "StringIndexOutOfBoundsException" should only be used when the index is out of a "String" (the builder included) boundary, but the offending object and the index here is CharSequence/index. The place

Re: RFR [XXS] 8130778: (str) Make AbstractStringBuilder.append(CharSequence, int, int) to throw StringIndexOutOfBoundsException

2015-07-08 Thread Xueming Shen
Hi, Arguably the "StringIndexOutOfBoundsException" should only be used when the index is out of a "String" (the builder included) boundary, but the offending object and the index here is CharSequence/index. The places that throw StringIndexoutOfBoundsException are all for the index/offset/leng

RFR [XXS] 8130778: (str) Make AbstractStringBuilder.append(CharSequence, int, int) to throw StringIndexOutOfBoundsException

2015-07-08 Thread Ivan Gerasimov
Resending the request with a new bug id. On 07.07.2015 15:55, Ivan Gerasimov wrote: Hi! With the fix for JDK-8077242 ((str) Optimize AbstractStringBuilder.append(CharSequence, int, int) for String argument) a change in behavior was introduced. In the places, where sb.append(str.substring(fr