Closed cushon closed 9 years ago
Original comment posted by eaftan@google.com on 2014-04-07 at 10:38 PM
The root of the problem is that this API uses longs to represent what are really differently typed units of time. This feels like something that should be solved with the type system or type annotations/checker framework rather than with error-prone.
Status: WontFix
Original issue created by nlidz@google.com on 2014-03-06 at 07:39 PM
Time conversions return long and will overflow silently with no exception. It is possible to incorrectly convert unit per the following pattern:
import java.util.concurrent.TimeUnit; long t0 = TimeUnit.SECONDS.toMicros(TimeUnit.MILLISECONDS.toMicros(clock.now().getMillis()));