Closed jodastephen closed 11 years ago
Changing the signatures of the Duration.plus/minus method would reduce the value of static type checking. Those methods would now need to check for estimated Periods and might fail at at runtime.
It would also blur the distinction between human time and machine time.
Opening up Period.plus/minus would require a definition of the rounding or truncation required to combine values with different units years/months/days and days/nano.
While it could be well defined in the spec; it makes the behavior depend on the actual values supplied and harder to understand and use.
The main argument in favour of this is consistency, as other similar methods are lenient in their input (with the effect of changing compile time to runtime checking). cf LocalDate.plus(TemporalAmount)
.
Closing as Won'tFix. Issue #285 means that it is easy enough to do the conversion for those cases when it is needed. I'm more worried about the lack of mapping of weeks to days and quarters to months than this.
Currently we have these methods:
now that we have a queryable interface, they should probably be: