Re: RFR: 8276806: Use Objects.checkFromIndexSize where possible in java.base [v2]

2021-11-19 Thread Lance Andersen
On Mon, 8 Nov 2021 18:59:06 GMT, Сергей Цыпанов  wrote:

>> This is a follow-up for https://github.com/openjdk/jdk/pull/4507, looks like 
>> there are some cases that were not covered.
>> 
>> Also this is related to https://github.com/openjdk/jdk/pull/3615
>
> Сергей Цыпанов has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8276806: Use Objects.checkFromIndexSize where possible in java.base

This Looks OK to me

-

Marked as reviewed by lancea (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6297


Re: RFR: 8276806: Use Objects.checkFromIndexSize where possible in java.base [v2]

2021-11-19 Thread Roger Riggs
On Mon, 8 Nov 2021 18:59:06 GMT, Сергей Цыпанов  wrote:

>> This is a follow-up for https://github.com/openjdk/jdk/pull/4507, looks like 
>> there are some cases that were not covered.
>> 
>> Also this is related to https://github.com/openjdk/jdk/pull/3615
>
> Сергей Цыпанов has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8276806: Use Objects.checkFromIndexSize where possible in java.base

Marked as reviewed by rriggs (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/6297


Re: RFR: 8276806: Use Objects.checkFromIndexSize where possible in java.base [v2]

2021-11-08 Thread Сергей Цыпанов
On Mon, 8 Nov 2021 14:52:59 GMT, Daniel Fuchs  wrote:

>> Сергей Цыпанов has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8276806: Use Objects.checkFromIndexSize where possible in java.base
>
> src/java.base/share/classes/java/io/ObjectInputStream.java line 1199:
> 
>> 1197: public void readFully(byte[] buf, int off, int len) throws 
>> IOException {
>> 1198: int endoff = off + len;
>> 1199: Objects.checkFromToIndex(off, endoff, buf.length);
> 
> Why not using `Objects.checkFromIndexSize(off, len, buf.length);` just like 
> in the previous change at line 1029 above?

Good point, done!

-

PR: https://git.openjdk.java.net/jdk/pull/6297


Re: RFR: 8276806: Use Objects.checkFromIndexSize where possible in java.base [v2]

2021-11-08 Thread Сергей Цыпанов
> This is a follow-up for https://github.com/openjdk/jdk/pull/4507, looks like 
> there are some cases that were not covered.
> 
> Also this is related to https://github.com/openjdk/jdk/pull/3615

Сергей Цыпанов has updated the pull request incrementally with one additional 
commit since the last revision:

  8276806: Use Objects.checkFromIndexSize where possible in java.base

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6297/files
  - new: https://git.openjdk.java.net/jdk/pull/6297/files/cd295a93..0089a644

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=6297=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=6297=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6297.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6297/head:pull/6297

PR: https://git.openjdk.java.net/jdk/pull/6297