RFR: 6185110: Undefined behaviour of SampleModel for width, height < 0
Phil Race
prr at openjdk.org
Fri Oct 10 22:36:34 UTC 2025
The only significant change here is to ensure that all SampleModel types throw a specified exception if a client
calls any of the following methods with a negative width or height.
getPixels(..)
setPixels(..)
getSamples(..)
setSamples(..)
The rest is fixing the javadoc to properly describe what happens and some minor cleanup.
I use {@inheritDoc} to avoid repeating the super-class doc. And no one now has to tediously compare them.
I could just delete the javadoc but that would cause no javadoc to be generated for an overridden method.
There were a couple of surprises with {@inheritDoc} and the one I had to deal with is that declared RuntimeExceptions
are not inherited. You need to explicitly re-add them.
I added a test which verifies the behaviour for illegal arguments.
There will be a CSR.
-------------
Commit messages:
- 6185110
Changes: https://git.openjdk.org/jdk/pull/27754/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27754&range=00
Issue: https://bugs.openjdk.org/browse/JDK-6185110
Stats: 815 lines in 6 files changed: 365 ins; 206 del; 244 mod
Patch: https://git.openjdk.org/jdk/pull/27754.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27754/head:pull/27754
PR: https://git.openjdk.org/jdk/pull/27754
More information about the client-libs-dev
mailing list