-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Conversation
/csr |
👋 Welcome back prr! A progress list of the required criteria for merging this PR into |
@prrace 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:
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 36 new commits pushed to the
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 |
CSR to be reviewed https://bugs.openjdk.org/browse/JDK-8359951 |
There was a problem hiding this 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?
* 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 |
There was a problem hiding this comment.
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.”
There was a problem hiding this comment.
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.
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 Is my understanding correct now? |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do copyright years need to be updated for this file if there's a docs change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated javadoc and regression test LGTM.
/integrate |
Going to push as commit 81985d4.
Your commit was automatically rebased without conflicts. |
String nullmsg = new HeadlessException().getMessage(); | ||
String emptymsg = new HeadlessException("").getMessage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prrace I was thinking of a case which would actually throw HeadlessException when run with Djava.awt.headless=true
such as creating a frame or robot but the exception msg can be null or default message from GraphicsEnvironment so making it difficult to validate on different platforms. The current test works well to validate both empty and null message.
Clarify the behaviour of new HeadlessException().getMessage()
The spec. is updated to be clear that empty means null, not an empty string.
Progress
Issues
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