RFR: 8376297: ArrayIndexOutOfBoundsException Not Documented for SinglePixelPackedSampleModel.getSampleSize(int)

Phil Race prr at openjdk.org
Wed Jan 28 18:25:03 UTC 2026


On Wed, 28 Jan 2026 00:17:54 GMT, Chen Liang <liach at openjdk.org> wrote:

> I recommend specifying `IndexOutOfBoundsException` instead of AIOOBE: this allows implementation freedom in case an underlying storage is at some point changed to a `List` or some other non-array structure.

This package has 152 specified cases of
@throws ArrayIndexOutOfBoundsException
and just one of
* @throws IndexOutOfBoundsException 

and I don't think we are likely to change the implementation anyway.

So I would prefer to leave it as it is.

- However counting this I noticed one un-specified exception on an un-related class in the package.
But that should be handled separately.

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

PR Comment: https://git.openjdk.org/jdk/pull/29457#issuecomment-3813040105


More information about the client-libs-dev mailing list