Skip to content

8377167: javax/imageio/ReadAbortTest.java throw NPE when x11 unavailable#29569

Closed
sendaoYan wants to merge 1 commit intoopenjdk:masterfrom
sendaoYan:jbs8377167
Closed

8377167: javax/imageio/ReadAbortTest.java throw NPE when x11 unavailable#29569
sendaoYan wants to merge 1 commit intoopenjdk:masterfrom
sendaoYan:jbs8377167

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Feb 4, 2026

Hi all,

Test javax/imageio/ReadAbortTest.java and javax/imageio/WriteAbortTest.java throw java.lang.NullPointerException when x11 display unavailable, because object path unable to initial. This PR check the path is null or not before use it, this will make test failure report friendly when x11 display unavailable but DISPLAY was seted.

Change has been verified locally on linux-x64.


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

Issue

  • JDK-8377167: javax/imageio/ReadAbortTest.java throw NPE when x11 unavailable (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29569

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 4, 2026

👋 Welcome back syan! 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 Feb 4, 2026

@sendaoYan This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8377167: javax/imageio/ReadAbortTest.java throw NPE when x11 unavailable

Reviewed-by: prr, serb

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Feb 4, 2026
@openjdk
Copy link

openjdk bot commented Feb 4, 2026

@sendaoYan 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 Feb 4, 2026
@mlbridge
Copy link

mlbridge bot commented Feb 4, 2026

Webrevs

@prrace
Copy link
Contributor

prrace commented Feb 4, 2026

This does not make one bit of sense. These tests do nothing with DISPLAY. They do not start AWT.

@mrserb
Copy link
Member

mrserb commented Feb 4, 2026

This does not make one bit of sense. These tests do nothing with DISPLAY. They do not start AWT.

Since DISPLAY is set, the GraphicsEnvironment considers the system as headful and tries to connect to display. After this patch, the test will not pass in that environment but will instead show the real stack trace.

java.awt.AWTError: Can't connect to X11 window server using ':123' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:100)
at java.desktop/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:57)
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:35)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:89)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:80)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:102)
at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1167)
at ReadAbortTest.(ReadAbortTest.java:64)
at ReadAbortTest.main(ReadAbortTest.java:149)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1516)

Copy link
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. An odd case.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 4, 2026
@sendaoYan
Copy link
Member Author

sendaoYan commented Feb 5, 2026

Sorry, I did not describe the issue clearly enough. Thanks @mrserb the additionly details.

Thanks the reviews @prrace @mrserb

/integrate

@openjdk
Copy link

openjdk bot commented Feb 5, 2026

Going to push as commit d93bd18.
Since your change was applied there have been 7 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 5, 2026
@openjdk openjdk bot closed this Feb 5, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 5, 2026
@openjdk
Copy link

openjdk bot commented Feb 5, 2026

@sendaoYan Pushed as commit d93bd18.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@sendaoYan sendaoYan deleted the jbs8377167 branch February 5, 2026 11:56
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 integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants