8026854: java.time.temporal.TemporalQueries doesn't compile after javac modification to lambda flow analysis
authorvromero
Sat, 19 Oct 2013 17:53:44 +0100
changeset 21297 813b7d784410
parent 21296 de1c1faa6f77
child 21298 d8a11a962ee3
8026854: java.time.temporal.TemporalQueries doesn't compile after javac modification to lambda flow analysis Reviewed-by: psandoz
jdk/src/share/classes/java/time/temporal/TemporalQueries.java
--- a/jdk/src/share/classes/java/time/temporal/TemporalQueries.java	Fri Oct 18 16:37:58 2013 -0400
+++ b/jdk/src/share/classes/java/time/temporal/TemporalQueries.java	Sat Oct 19 17:53:44 2013 +0100
@@ -341,34 +341,23 @@
     /**
      * A strict query for the {@code ZoneId}.
      */
-    static final TemporalQuery<ZoneId> ZONE_ID = (temporal) -> {
-        return temporal.query(ZONE_ID);
-    };
+    static final TemporalQuery<ZoneId> ZONE_ID = (temporal) ->
+        temporal.query(TemporalQueries.ZONE_ID);
 
     /**
      * A query for the {@code Chronology}.
      */
-    static final TemporalQuery<Chronology> CHRONO = (temporal) -> {
-        return temporal.query(CHRONO);
-    };
+    static final TemporalQuery<Chronology> CHRONO = (temporal) ->
+        temporal.query(TemporalQueries.CHRONO);
 
     /**
      * A query for the smallest supported unit.
      */
-    static final TemporalQuery<TemporalUnit> PRECISION = (temporal) -> {
-        return temporal.query(PRECISION);
-    };
+    static final TemporalQuery<TemporalUnit> PRECISION = (temporal) ->
+        temporal.query(TemporalQueries.PRECISION);
 
     //-----------------------------------------------------------------------
     /**
-     * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}.
-     */
-    static final TemporalQuery<ZoneId> ZONE = (temporal) -> {
-        ZoneId zone = temporal.query(ZONE_ID);
-        return (zone != null ? zone : temporal.query(OFFSET));
-    };
-
-    /**
      * A query for {@code ZoneOffset} returning null if not found.
      */
     static final TemporalQuery<ZoneOffset> OFFSET = (temporal) -> {
@@ -379,6 +368,14 @@
     };
 
     /**
+     * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}.
+     */
+    static final TemporalQuery<ZoneId> ZONE = (temporal) -> {
+        ZoneId zone = temporal.query(ZONE_ID);
+        return (zone != null ? zone : temporal.query(OFFSET));
+    };
+
+    /**
      * A query for {@code LocalDate} returning null if not found.
      */
     static final TemporalQuery<LocalDate> LOCAL_DATE = (temporal) -> {