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

Alexey Ivanov aivanov at openjdk.org
Wed Jun 18 18:37:29 UTC 2025


On Wed, 18 Jun 2025 17:57:26 GMT, Phil Race <prr at openjdk.org> wrote:

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

Should each constructor specify how the message returned by `getMessage` is constructed instead of _directing to the specification of `getMessage` for details_?

src/java.desktop/share/classes/java/awt/HeadlessException.java line 56:

> 54:      * For such {@code HeadlessException} the default headless error message
> 55:      * may be auto-generated for some platforms.
> 56:      * The text of the default headless message may depend on

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.”

-------------

Changes requested by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25881#pullrequestreview-2940277056
PR Review Comment: https://git.openjdk.org/jdk/pull/25881#discussion_r2155243664


More information about the client-libs-dev mailing list