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

java.time.Duration missing isPositive method

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b08

      Description

      The omission of java.time.Duration.isPositive() seems odd.
      It would be useful compared to alternatives using existing methods.

      !isZero() && !isNegative()
      !.negate().isNegative()
      .compareTo(Duration.ZERO) > 0

      See http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-December/045552.html

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              naoto Naoto Sato
              Reporter:
              rriggs Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: