On Wed, 18 Jun 2025 17:57:26 GMT, Phil Race <[email protected]> wrote:
> Clarify the behaviour of new HeadlessException().getMessage()
> The spec. is updated to be clear that empty means null, not an empty string.
test/jdk/java/awt/Headless/HeadlessExceptionTest.java line 37:
> 35: public static void main (String[] args) {
> 36: String nullmsg = new HeadlessException().getMessage();
> 37: String emptymsg = new HeadlessException("").getMessage();
@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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25881#discussion_r2159723867