<AWT Dev> RFR: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop [v3]

Jayathirth D V jdv at openjdk.java.net
Fri Jul 30 08:20:32 UTC 2021


On Thu, 22 Jul 2021 06:29:13 GMT, Yi Yang <yyang at openjdk.org> 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 changes involving client code:
>> 
>> src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java
>> src/java.desktop/share/classes/javax/swing/JTabbedPane.java
>> test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
>> test/jdk/javax/imageio/AppletResourceTest.java
>> test/jdk/javax/imageio/ImageReaderReadAll.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

src/java.desktop/share/classes/javax/swing/JTabbedPane.java line 1793:

> 1791: 
> 1792:     private void checkIndex(int index) {
> 1793:         Objects.checkIndex(index, pages.size());

I think we should not replace IOOBE checks with messages. Its better to keep it old way.

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

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


More information about the awt-dev mailing list