Skip to content

Conversation

@mrserb
Copy link
Member

@mrserb mrserb commented Nov 12, 2025

This is an update to the patch integrated in #28127. It changes the exception from IllegalArgumentException back to NullPointerException, which was thrown previously.

Rationale:

  • Since an NPE was already thrown before, this does not introduce a behavior change
  • Throwing NPE on null is the common pattern used across the codebase, including in the affected package

Additional notes:
The patch uses the idiomatic way to check parameters for null via Objects.requireNonNull(). I am not sure whether this code path is performance critical. The use of >> 1 instead of / 2 suggests that performance might matter. If this code is performance sensitive, we can remove the Objects.requireNonNull() call, because even without it the resulting NPE would still clearly show which variable was null when its field was accessed.

It is also possible to remove the use of multiplyExact(). We can simply multiply width/height as long values and compare the result with the data length. In case of overflow, the existing “Data array too small” exception would still be thrown.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires a CSR request matching fixVersion 26 to be approved (needs to be created)

Issue

  • JDK-8371501: Change IAE to NPE in java.awt.image.Kernel when data is null (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28249

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 12, 2025

👋 Welcome back serb! 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 Nov 12, 2025

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

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Nov 12, 2025
@openjdk
Copy link

openjdk bot commented Nov 12, 2025

@mrserb 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.

@mrserb
Copy link
Member Author

mrserb commented Nov 13, 2025

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Nov 13, 2025
@openjdk
Copy link

openjdk bot commented Nov 13, 2025

@mrserb has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@mrserb please create a CSR request for issue JDK-8371501 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@mrserb mrserb marked this pull request as ready for review November 13, 2025 22:55
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 13, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 13, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org 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