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

java.time.Duration missing isPositive method

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 9
    • 18
    • core-libs
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: