Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8359951

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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P2 P2
    • 25, 26
    • client-libs
    • None
    • source
    • minimal
    • Describes the existing implementation - doc only change
    • Java API
    • SE

      Summary

      The specification of the no-args HeadlessException constructor is updated to state that it is constructed with a null message.

      Problem

      The no-args HeadlessException constructor states that it is constructed with an empty message. This is ambiguous as to whether it means null or the empty string "".

      Solution

      Be clear that it means null - which is the current behavior for this class and all its super-classes. Also be clear that if there is a default headless message it will be returned instead of null.

      Specification

      Update the specification of the no-args java.awt.HeadlessException() constructor as follows

      -   * Constructs new {@code HeadlessException} with empty message.
      +   * Constructs a new {@code HeadlessException} with {@code null} as its detail message.
      +   * The default headless message may replace {@code null} in some cases, as outlined below.

            prr Philip Race
            dbessono Dmitry Bessonov
            Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: