aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/java/time
diff options
context:
space:
mode:
authorscolebourne <none@none>2014-03-06 17:16:20 +0000
committerscolebourne <none@none>2014-03-06 17:16:20 +0000
commit5a44ffb4cb322ae789b79ba4e78e589a4e8dd2c1 (patch)
tree4ca8485a4c017ac2b893628c69411028c249948d /src/share/classes/java/time
parent8b4295744908624ff562cd3618353a041ec7eb87 (diff)
downloadjdk8u_jdk-5a44ffb4cb322ae789b79ba4e78e589a4e8dd2c1.tar.gz
8035099: LocalTime.with(MILLI_OF_DAY/MICRO_OF_DAY) incorrect
Summary: Correctly zeros low order bits of time when setting milli/micro Reviewed-by: alanb, rriggs Contributed-by: Stephen Colebourne <scolebourne@joda.org>
Diffstat (limited to 'src/share/classes/java/time')
-rw-r--r--src/share/classes/java/time/LocalTime.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/share/classes/java/time/LocalTime.java b/src/share/classes/java/time/LocalTime.java
index 08a0631741..c3ccfcc303 100644
--- a/src/share/classes/java/time/LocalTime.java
+++ b/src/share/classes/java/time/LocalTime.java
@@ -838,9 +838,9 @@ public final class LocalTime
case NANO_OF_SECOND: return withNano((int) newValue);
case NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);
case MICRO_OF_SECOND: return withNano((int) newValue * 1000);
- case MICRO_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000) * 1000);
+ case MICRO_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000);
case MILLI_OF_SECOND: return withNano((int) newValue * 1000_000);
- case MILLI_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000_000) * 1000_000);
+ case MILLI_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000_000);
case SECOND_OF_MINUTE: return withSecond((int) newValue);
case SECOND_OF_DAY: return plusSeconds(newValue - toSecondOfDay());
case MINUTE_OF_HOUR: return withMinute((int) newValue);