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

java.time.Duration missing isPositive method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 9
    • core-libs
    • None
    • b08

      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

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

              Created:
              Updated:
              Resolved: