jdk/src/share/classes/java/time/OffsetDateTime.java
changeset 24985 61ec15d123c3
parent 24256 da9a41004459
--- a/jdk/src/share/classes/java/time/OffsetDateTime.java	Wed Jun 18 15:05:29 2014 +0100
+++ b/jdk/src/share/classes/java/time/OffsetDateTime.java	Thu Jun 12 00:31:27 2014 +0100
@@ -357,10 +357,11 @@
         }
         try {
             ZoneOffset offset = ZoneOffset.from(temporal);
-            try {
-                LocalDateTime ldt = LocalDateTime.from(temporal);
-                return OffsetDateTime.of(ldt, offset);
-            } catch (DateTimeException ignore) {
+            LocalDate date = temporal.query(TemporalQueries.localDate());
+            LocalTime time = temporal.query(TemporalQueries.localTime());
+            if (date != null && time != null) {
+                return OffsetDateTime.of(date, time, offset);
+            } else {
                 Instant instant = Instant.from(temporal);
                 return OffsetDateTime.ofInstant(instant, offset);
             }