JDK 9 RFR of 8130679: Writer/StringWriter.write methods do not specify index out bounds
Brian Burkhalter
brian.burkhalter at oracle.com
Mon May 9 20:11:39 UTC 2016
Hi Roger,
Thanks for taking a close look at this.
On May 9, 2016, at 12:42 PM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
> In the @throws IndexOutOfBounds I think it is easier to understand to say
>
> * or {@code off + len} is greater than {@code cbuf.length}
>
> It matches the code more closely.
The reason for the verbiage is that it matches (module removal of a redundant “or” in the throws verbiage) Reader.read(char[],int,int) with which I thought it would good to be consistent in an operation-symmetric sense:
http://download.java.net/java/jdk9/docs/api/java/io/Reader.html#read-char:A-int-int-
> - Is not clear why the form of the added @throws is different between the methods (other than len = string.size()
Writer.write(String,int,int) already had a throws exception for IOOBEs so I was trying to be consistent with that:
http://download.java.net/java/jdk9/docs/api/java/io/Writer.html#write-java.lang.String-int-int-
> line 214: add a spaces in "off+len"
>
> Most/All files have the same pattern. It would be nice to be consistent.
Again, this is the same as in the extent Writer.write(String,int,int).
Thanks,
Brian
More information about the core-libs-dev
mailing list