Skip to content

Conversation

prrace
Copy link
Contributor

@prrace prrace commented Oct 3, 2025

Updates the specification of Raster.createPackedRaster(..) methods and also the implementation of these to explicitly check the specified conditions rather than relying on them being passed up from some other API.

Also one each of the createInterleavedRaster(..) and createBandedRaster(..) methods have an update

createInterleavedRaster(...) to address that even if WxH does not exceed Integer.MAX_VALUE, the storage needed still might.

createBandedRaster(..) to address

  • a not explicitly specified or tested case that WxH must not overflow
  • a not explicitly tested NPE case if bandMasks is null. This was relying on a de-reference and the actual check for it being null would have thrown the wrong exception type (AIOBE) - meaning not the one NPE actually specified and thrown.
    There's an unfortunate oddity with this that of bankIndices is null it specifies and throws AIOBE, but I didn't think it worth changing either of these to make them consistent.

The existing CreateRasterExceptionTest.java is updated to verify all these assertions.
In almost all cases the behaviour is unchanged, it is just now properly specified and verified up front.

There are only 2 sub-tests which would fail on JDK 25
The test can also be run (and pass) there without this fix because it explicitly handles those 2 cases which are reasonable behavioral changes

  • One for the createInterleavedRaster() update where the unchecked case could end up causing a NegativeArraySizeException. This seems like a merited change.
  • One for an unlikely case where if an app specified 0 app to createPackedRaster, divide by zero would happen.

The CSR is now ready for review https://bugs.openjdk.org/browse/JDK-8369131


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change requires CSR request JDK-8369131 to be approved
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issues

  • JDK-8369129: Raster createPackedRaster methods specification clean up (Bug - P4)
  • JDK-8369131: Raster.createPackedRaster methods specification clean up (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27627/head:pull/27627
$ git checkout pull/27627

Update a local copy of the PR:
$ git checkout pull/27627
$ git pull https://git.openjdk.org/jdk.git pull/27627/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27627

View PR using the GUI difftool:
$ git pr show -t 27627

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27627.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 3, 2025

👋 Welcome back prr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 3, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8369129 8369129: Raster createPackedRaster methods specification clean up. Oct 3, 2025
@openjdk openjdk bot added csr Pull request needs approved CSR before integration client [email protected] labels Oct 3, 2025
@openjdk
Copy link

openjdk bot commented Oct 3, 2025

@prrace The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 3, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 3, 2025

Webrevs

@prrace prrace changed the title 8369129: Raster createPackedRaster methods specification clean up. 8369129: Raster createPackedRaster methods specification clean up Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client [email protected] csr Pull request needs approved CSR before integration rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant