FULL PRODUCT VERSION :
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
A DESCRIPTION OF THE PROBLEM :
In the JavaDoc, for Duration.toString, it is specified that the "hours, minutes and seconds will all have the same sign". However, this is violated in certain cases. For instance, while Duration.ofSeconds(-59, 100000000) correctly prints as "PT-58.9S", Duration.ofSeconds(-60, 100000000) prints as "PT-1M0.1S" with a negative minute, but a positive second, when "PT-59.9S" would be the expected result.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
A DESCRIPTION OF THE PROBLEM :
In the JavaDoc, for Duration.toString, it is specified that the "hours, minutes and seconds will all have the same sign". However, this is violated in certain cases. For instance, while Duration.ofSeconds(-59, 100000000) correctly prints as "PT-58.9S", Duration.ofSeconds(-60, 100000000) prints as "PT-1M0.1S" with a negative minute, but a positive second, when "PT-59.9S" would be the expected result.
REPRODUCIBILITY :
This bug can be reproduced always.