mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8263668: Update java.time to use instanceof pattern variable
Reviewed-by: lancea, ryadav, naoto, rriggs, dfuchs, scolebourne, chegar
This commit is contained in:
parent
a93d911954
commit
28af31db34
34 changed files with 129 additions and 176 deletions
|
@ -2208,7 +2208,7 @@ public final class DateTimeFormatter {
|
|||
Objects.requireNonNull(obj, "obj");
|
||||
Objects.requireNonNull(toAppendTo, "toAppendTo");
|
||||
Objects.requireNonNull(pos, "pos");
|
||||
if (obj instanceof TemporalAccessor == false) {
|
||||
if (!(obj instanceof TemporalAccessor)) {
|
||||
throw new IllegalArgumentException("Format target must implement TemporalAccessor");
|
||||
}
|
||||
pos.setBeginIndex(0);
|
||||
|
|
|
@ -165,7 +165,7 @@ public final class DateTimeFormatterBuilder {
|
|||
*/
|
||||
private static final TemporalQuery<ZoneId> QUERY_REGION_ONLY = (temporal) -> {
|
||||
ZoneId zone = temporal.query(TemporalQueries.zoneId());
|
||||
return (zone != null && zone instanceof ZoneOffset == false ? zone : null);
|
||||
return zone instanceof ZoneOffset ? null : zone;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -189,7 +189,7 @@ final class Parsed implements TemporalAccessor {
|
|||
(time != null && time.isSupported(field))) {
|
||||
return true;
|
||||
}
|
||||
return field != null && (field instanceof ChronoField == false) && field.isSupportedBy(this);
|
||||
return field != null && (!(field instanceof ChronoField)) && field.isSupportedBy(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue