-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
8u77
-
x86_64
-
linux
A DESCRIPTION OF THE REQUEST :
Having to compare durations is a common programming problem ; being forced to use compareTo() leads to code that is both hard to read and error-prone.
JUSTIFICATION :
I have a lot of understanding for wanting to have a minimal/orthogonal API but in this case the use-case (comparing durations) is just so common that IMHO it's worth adding these methods.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Duration instances should be comparable using isLongerThan() / isShorterThan() / isEqual() methods.
ACTUAL -
Currently durations can only be compared using the compareTo() method.
CUSTOMER SUBMITTED WORKAROUND :
None available.
Having to compare durations is a common programming problem ; being forced to use compareTo() leads to code that is both hard to read and error-prone.
JUSTIFICATION :
I have a lot of understanding for wanting to have a minimal/orthogonal API but in this case the use-case (comparing durations) is just so common that IMHO it's worth adding these methods.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Duration instances should be comparable using isLongerThan() / isShorterThan() / isEqual() methods.
ACTUAL -
Currently durations can only be compared using the compareTo() method.
CUSTOMER SUBMITTED WORKAROUND :
None available.