A DESCRIPTION OF THE PROBLEM :
When `TickClock` is created with a tick that is less than a millisecond its `millis()` method throws ArithmeticException division by zero.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create a microsecond precision clock:
Clock microsecondPrecisionClock = Clock.tick(Clock.systemUTC(), Duration.ofNanos(1000));
2. Call millis() method throw runtime exception
microsecondPrecisionClock.millis(); // java.lang.ArithmeticException: / by zero
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Get current millisecond instant of the clock without throwing an error
ACTUAL -
java.lang.ArithmeticException: / by zero
---------- BEGIN SOURCE ----------
public class TickClockTest {
public static void main(String[] args) {
Clock microsecondPrecisionClock = Clock.tick(Clock.systemUTC(), Duration.ofNanos(1000));
microsecondPrecisionClock.millis();
}
}
---------- END SOURCE ----------
When `TickClock` is created with a tick that is less than a millisecond its `millis()` method throws ArithmeticException division by zero.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create a microsecond precision clock:
Clock microsecondPrecisionClock = Clock.tick(Clock.systemUTC(), Duration.ofNanos(1000));
2. Call millis() method throw runtime exception
microsecondPrecisionClock.millis(); // java.lang.ArithmeticException: / by zero
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Get current millisecond instant of the clock without throwing an error
ACTUAL -
java.lang.ArithmeticException: / by zero
---------- BEGIN SOURCE ----------
public class TickClockTest {
public static void main(String[] args) {
Clock microsecondPrecisionClock = Clock.tick(Clock.systemUTC(), Duration.ofNanos(1000));
microsecondPrecisionClock.millis();
}
}
---------- END SOURCE ----------