RFR: 8299600: Use Objects.check*() where appropriate in java.io

Brian Burkhalter bpb at openjdk.org
Wed Jan 4 22:19:49 UTC 2023


On Wed, 4 Jan 2023 19:52:07 GMT, Scott Palmer <swpalmer at openjdk.org> wrote:

>> Use the following methods instead of hand-written code:
>> - Objects.checkFromIndexSize()
>> - Objects.checkFromToIndex()
>
> src/java.base/share/classes/java/io/CharArrayWriter.java line 101:
> 
>> 99:      */
>> 100:     public void write(char[] c, int off, int len) {
>> 101:         Objects.checkFromToIndex(off, len, c.length);
> 
> shouldn't that be Objects.checkFromIndexSize(off, len, c.length);

It looks like all the occurrences of `checkFromToIndex()` should instead be `checkFromIndexSize()`.

-------------

PR: https://git.openjdk.org/jdk/pull/11849


More information about the core-libs-dev mailing list