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

Add API notes to Optional class doc to cover intended usage

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs

      Description

      Add some notes to the API specification of java.util.Optional to describe Optional's intended use more clearly. In particular, its intended use is in the method return position only, not as method parameters, fields, or local variables. Also possibly rationale for not Serializable, etc. However, a brief, crisp statement of its intended use (and not much else) is probably called for here.

      See

      http://stackoverflow.com/a/23464794/1441122

      http://stackoverflow.com/a/24564612/1441122

      and related for source material.

      (Also add notes or references to OptionalInt etc.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smarks Stuart Marks
                Reporter:
                smarks Stuart Marks
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: