Looking at TimeRange::nanos:
/**
* Length of the range in nanoseconds.
*
* @return length of the range in nanoseconds
*/
public long nanos() {
return start.until(end, ChronoUnit.NANOS) - (inclusiveEnd ? 0 : 1);
}
this seems incorrect.
For example, I would expect that
[ofEpochMilli(0), ofEpochMilli(1)) = 1,000,000 nanos
[ofEpochMilli(0), ofEpochMilli(1)] = 1,000,001 nanos
This makes me think a lot of the testing and calculations are off by 1.
but it seems like the code as written is providing
[ofEpochMilli(0), ofEpochMilli(1)) = 999,999 nanos
[ofEpochMilli(0), ofEpochMilli(1)] = 1,000,000 nanos
Originially identified in #5378 (comment).
Looking at
TimeRange::nanos:this seems incorrect.
For example, I would expect that
This makes me think a lot of the testing and calculations are off by 1.
but it seems like the code as written is providing
Originially identified in #5378 (comment).