RFR: 8262297: ImageIO.write() method will throw IndexOutOfBoundsException

Masanori Yano myano at openjdk.java.net
Thu Oct 28 09:38:33 UTC 2021


Could you please review the 8262297 bug fixes?

In this case, ImageIO.write() should throw java.io.IOException rather than java.lang.IndexOutOfBoundsException. IndexOutOfBoundsException is caught and wrapped in IIOException in ImageIO.write() with this fix. In addition, IndexOutOfBoundsException is not expected to throw by RandomAccessFile#write() according to its API specification. So it should be fixed.

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

Commit messages:
 - 8262297: ImageIO.write() method will throw IndexOutOfBoundsException

Changes: https://git.openjdk.java.net/jdk/pull/6151/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6151&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262297
  Stats: 96 lines in 4 files changed: 71 ins; 0 del; 25 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6151.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6151/head:pull/6151

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


More information about the core-libs-dev mailing list