提交 c8eee0d5 编写于 作者: V vromero

8026854: java.time.temporal.TemporalQueries doesn't compile after javac...

8026854: java.time.temporal.TemporalQueries doesn't compile after javac modification to lambda flow analysis
Reviewed-by: psandoz
上级 9d338455
......@@ -341,33 +341,22 @@ public final class TemporalQueries {
/**
* 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.
*/
......@@ -378,6 +367,14 @@ public final class TemporalQueries {
return null;
};
/**
* 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.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册