mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8265746: Update java.time to use instanceof pattern variable (part II)
Reviewed-by: dfuchs, lancea, rriggs, chegar, naoto
This commit is contained in:
parent
a85f6cbbaa
commit
45c5da0fd3
20 changed files with 104 additions and 152 deletions
|
@ -282,8 +282,7 @@ final class Parsed implements TemporalAccessor {
|
|||
TemporalField targetField = entry.getKey();
|
||||
TemporalAccessor resolvedObject = targetField.resolve(fieldValues, this, resolverStyle);
|
||||
if (resolvedObject != null) {
|
||||
if (resolvedObject instanceof ChronoZonedDateTime) {
|
||||
ChronoZonedDateTime<?> czdt = (ChronoZonedDateTime<?>) resolvedObject;
|
||||
if (resolvedObject instanceof ChronoZonedDateTime<?> czdt) {
|
||||
if (zone == null) {
|
||||
zone = czdt.getZone();
|
||||
} else if (zone.equals(czdt.getZone()) == false) {
|
||||
|
@ -291,8 +290,7 @@ final class Parsed implements TemporalAccessor {
|
|||
}
|
||||
resolvedObject = czdt.toLocalDateTime();
|
||||
}
|
||||
if (resolvedObject instanceof ChronoLocalDateTime) {
|
||||
ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
|
||||
if (resolvedObject instanceof ChronoLocalDateTime<?> cldt) {
|
||||
updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
|
||||
updateCheckConflict(cldt.toLocalDate());
|
||||
changedCount++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue