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

2021-07-08 Thread Yi Yang
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 changes involving client code:

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

2021-07-30 Thread Yi Yang
On Fri, 30 Jul 2021 06:23:40 GMT, Prasanta Sadhukhan wrote: >> Hi, sorry for the late response. checkFromToIndex has many constraints, this >> code may not satisfy those constraints, so I don't think we should do that >> in this PR.(Maybe we can file a new PR to do replacement carefully) > >

Re: RFR: 8271396: Spelling errors

2021-07-28 Thread Yi Yang
On Wed, 3 Feb 2021 19:12:25 GMT, Emmanuel Bourg wrote: > This PR fixes the following spelling errors: > > choosen -> chosen > commad -> command > hiearchy -> hierarchy > leagacy -> legacy > minium -> minimum > subsytem -> subsystem > unamed -> unnamed Hi, I've filed

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

2021-08-04 Thread Yi Yang
On Thu, 22 Jul 2021 06:29:13 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. >> >>

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

2021-08-04 Thread Yi Yang
On Fri, 30 Jul 2021 08:59:31 GMT, Jayathirth D V wrote: >> Objects.checkIndex itself throws exceptions for wrong values. So this should >> be ok. No? > > We have specific message here like "Tab count" which we are not passing and > will be helpful for debugging in future. Restored.

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

2021-08-04 Thread Yi Yang
aderReadAll.java > test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java Yi Yang has updated the pull request incrementally with one additional commit since the last revision: review from @jayathirthrao - Changes: - all: https://git.openjdk.java.ne

Integrated: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop

2021-08-05 Thread Yi Yang
On Thu, 8 Jul 2021 08:32:49 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

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/ImageReader

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

2021-07-22 Thread Yi Yang
aderReadAll.java > test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java Yi Yang has updated the pull request incrementally with one additional commit since the last revision: typo - Changes: - all: https://git.openjdk.java.net/jdk/pull/4718/files

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