Re: RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

2021-07-30 Thread Prasanta Sadhukhan
On Tue, 27 Jul 2021 02:46:53 GMT, Yi Yang wrote: >> I meant >> >> if (imageIndex < minIndex) >> throw new IndexOutOfBoundsException(); >> >> can't it be replaced with Objects.checkFromToIndex(minIndex, imageIndex, .. > > Hi, sorry for the late response. checkFromToIndex

Re: RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

2021-07-26 Thread Yi Yang
On Thu, 22 Jul 2021 06:35:07 GMT, Prasanta Sadhukhan wrote: >> checkFromToIndex​ has different semantice with checkIndex: >> >> - checkFromToIndex >> >> * >> * {@code fromIndex < 0} >> * {@code fromIndex > toIndex} >> * {@code toIndex > length} >> * {@code length

Re: RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

2021-07-22 Thread Prasanta Sadhukhan
On Thu, 22 Jul 2021 06:23:43 GMT, Yi Yang wrote: >> test/jdk/javax/imageio/ImageReaderReadAll.java line 94: >> >>> 92: if (seekForwardOnly) { >>> 93: if (imageIndex < minIndex) >>> 94: throw new IndexOutOfBoundsException(); >> >> Can't we use

Re: RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

2021-07-22 Thread Yi Yang
On Thu, 22 Jul 2021 05:48:44 GMT, Prasanta Sadhukhan wrote: >> Yi Yang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> checkFromIndexSize(off, len,...) > > test/jdk/javax/imageio/ImageReaderReadAll.java line 94: > >> 92:

Re: RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

2021-07-21 Thread Prasanta Sadhukhan
On Wed, 21 Jul 2021 09:58:23 GMT, Yi Yang wrote: >> After JDK-8265518(#3615), it's possible to replace all variants of >> checkIndex by >> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in >> the whole JDK codebase. >> >> As Mandy suggested, I create this PR for