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

reconsider cleanup of OptionalDataException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P5
    • None
    • None
    • core-libs
    • None

    Description

      The OptionalDataException class differs from established conventions for exception classes in a couple ways:

      1. it has no public constructors
      2. it has public, writable fields

      We should reconsider cleaning up this class. This was previously considered in JDK-8168101 which was closed because there was no compelling rationale to fix it. That may indeed have been the case; however, this exception class is a notable outlier compared to almost every other exception class in the system. Because it differs from established patterns, this class is flagged by various static detectors such as the one used by JDK-8283414.

      Public constructors could be added without much difficulty.

      Getters for the fields could be added, and the fields removed (possibly after deprecation). A middle ground might be to make the fields final. Some corpus searching might be of use to determine the degree of incompatibility.

      Attachments

        Issue Links

          Activity

            People

              rriggs Roger Riggs
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: