Skip to content

8358526: Clarify behavior of java.awt.HeadlessException constructed with no-args #25881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prrace
Copy link
Contributor

@prrace prrace commented Jun 18, 2025

Clarify the behaviour of new HeadlessException().getMessage()
The spec. is updated to be clear that empty means null, not an empty string.


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 CSR request JDK-8359951 to be approved

Issues

  • JDK-8358526: Clarify behavior of java.awt.HeadlessException constructed with no-args (Bug - P2)
  • JDK-8359951: Clarify behavior of java.awt.HeadlessException constructed with no-args (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25881

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@prrace
Copy link
Contributor Author

prrace commented Jun 18, 2025

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 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 Jun 18, 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 8358526 8358526: Clarify behavior of java.awt.HeadlessException constructed with no-args Jun 18, 2025
@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Jun 18, 2025
@openjdk
Copy link

openjdk bot commented Jun 18, 2025

@prrace an approved CSR request is already required for this pull request.

@openjdk
Copy link

openjdk bot commented Jun 18, 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.

@mlbridge
Copy link

mlbridge bot commented Jun 18, 2025

Webrevs

@prrace
Copy link
Contributor Author

prrace commented Jun 18, 2025

CSR to be reviewed https://bugs.openjdk.org/browse/JDK-8359951

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Should each constructor specify how the message returned by getMessage is constructed instead of directing to the specification of getMessage for details?

Comment on lines 54 to 56
* For such {@code HeadlessException} the default headless error message
* may be auto-generated for some platforms.
* The text of the default headless message may depend on
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't align, the following text has to be modified too.

The first sentence of the second paragraph, “For such {@code HeadlessException} the default headless error message may be auto-generated for some platforms,” should be replaced with the slightly edited text from the HeadlessException(String) constructor: “For some platforms, the {@code null} detail message may be replaced with the default headless error message.”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see why.

@prrace
Copy link
Contributor Author

prrace commented Jun 18, 2025

Should each constructor specify how the message returned by getMessage is constructed instead of directing to the specification of getMessage for details?

100% no. I am not wasting time on that. This whole spec. is getting revamped again in JDK 26 in very short order after this minimal fix is backported to JDK 25

@aivanov-jdk
Copy link
Member

Should each constructor specify how the message returned by getMessage is constructed instead of directing to the specification of getMessage for details?

100% no. I am not wasting time on that. This whole spec. is getting revamped again in JDK 26 in very short order after this minimal fix is backported to JDK 25

I see, thank you for your clarification.

So, this is a minimal update to the specification to quickly address the problem with null vs. empty message, which is being backported to JDK 25; the specification for JDK 26 is going to be overhauled shortly.

Is my understanding correct now?

@prrace
Copy link
Contributor Author

prrace commented Jun 19, 2025

Should each constructor specify how the message returned by getMessage is constructed instead of directing to the specification of getMessage for details?

100% no. I am not wasting time on that. This whole spec. is getting revamped again in JDK 26 in very short order after this minimal fix is backported to JDK 25

I see, thank you for your clarification.

So, this is a minimal update to the specification to quickly address the problem with null vs. empty message, which is being backported to JDK 25; the specification for JDK 26 is going to be overhauled shortly.

Is my understanding correct now?

Right. What I am obliged to do in order to satisfy one specific TCK test. Nothing more.

@aivanov-jdk
Copy link
Member

Right. What I am obliged to do in order to satisfy one specific TCK test. Nothing more.

Thank you! It makes perfect sense.

Looks good to me.

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.

2 participants