jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java
changeset 20522 9a239bba214f
parent 20520 0952771e3e25
child 22081 86eb26ff8f2b
--- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Fri Oct 04 12:01:29 2013 -0400
+++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Sat Sep 14 22:50:40 2013 +0100
@@ -186,9 +186,9 @@
     static <R extends ChronoLocalDate> ChronoLocalDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) {
         @SuppressWarnings("unchecked")
         ChronoLocalDateTimeImpl<R> other = (ChronoLocalDateTimeImpl<R>) temporal;
-        if (chrono.equals(other.toLocalDate().getChronology()) == false) {
+        if (chrono.equals(other.getChronology()) == false) {
             throw new ClassCastException("Chronology mismatch, required: " + chrono.getId()
-                    + ", actual: " + other.toLocalDate().getChronology().getId());
+                    + ", actual: " + other.getChronology().getId());
         }
         return other;
     }
@@ -371,7 +371,7 @@
     public long until(Temporal endExclusive, TemporalUnit unit) {
         Objects.requireNonNull(endExclusive, "endExclusive");
         @SuppressWarnings("unchecked")
-        ChronoLocalDateTime<D> end = (ChronoLocalDateTime<D>) toLocalDate().getChronology().localDateTime(endExclusive);
+        ChronoLocalDateTime<D> end = (ChronoLocalDateTime<D>) getChronology().localDateTime(endExclusive);
         if (unit instanceof ChronoUnit) {
             if (unit.isTimeBased()) {
                 long amount = end.getLong(EPOCH_DAY) - date.getLong(EPOCH_DAY);