<i18n dev> RFR: 8263668: Update java.time to use instanceof pattern variable [v7]

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Wed Apr 21 13:04:36 UTC 2021


On Wed, 21 Apr 2021 11:06:16 GMT, Patrick Concannon <pconcannon at openjdk.org> wrote:

>> Hi,
>> 
>> Could someone please review my code for updating the code in the `java.time` package to make use of the `instanceof` pattern variable?
>> 
>> Kind regards,
>> Patrick
>
> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
> 
>  - Updated single letter pattern variable name in java/time/Duration
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Updated single letter pattern variable names
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - Merge remote-tracking branch 'origin/master' into JDK-8263668
>  - 8263668: Update java.time to use instanceof pattern variable

I was able to find (with IntelliJ IDEA help) few more places to improve

    java.time   27 warnings 
        class Clock   2 warnings 
            class FixedClock   1 warning 
                method equals(Object)   1 warning 
                    WARNING Variable 'other' can be replaced with pattern variable 
            class OffsetClock   1 warning 
                method equals(Object)   1 warning 
                    WARNING Variable 'other' can be replaced with pattern variable 
        class Instant   2 warnings 
            method until(Temporal, TemporalUnit)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class LocalDate   5 warnings 
            method minus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToSubtract' can be replaced with pattern variable 
            method plus(long, TemporalUnit)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method plus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToAdd' can be replaced with pattern variable 
            method range(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class LocalDateTime   8 warnings 
            method get(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method getLong(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method isSupported(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method minus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToSubtract' can be replaced with pattern variable 
            method plus(long, TemporalUnit)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method plus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToAdd' can be replaced with pattern variable 
            method range(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class LocalTime   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class OffsetDateTime   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class Year   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class YearMonth   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class ZonedDateTime   6 warnings 
            method equals(Object)   1 warning 
                WARNING Variable 'other' can be replaced with pattern variable 
            method minus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToSubtract' can be replaced with pattern variable 
            method plus(TemporalAmount)   1 warning 
                WARNING Variable 'periodToAdd' can be replaced with pattern variable 
            method with(TemporalAdjuster)   2 warnings 
                WARNING Variable 'odt' can be replaced with pattern variable 
                WARNING Variable 'instant' can be replaced with pattern variable 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
    java.time.chrono   13 warnings 
        class ChronoLocalDateImpl   1 warning 
            method plus(long, TemporalUnit)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class ChronoLocalDateTimeImpl   6 warnings 
            method get(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method getLong(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method isSupported(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method plus(long, TemporalUnit)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method range(TemporalField)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class ChronoPeriodImpl   1 warning 
            method validateAmount(TemporalAmount)   1 warning 
                WARNING Variable 'period' can be replaced with pattern variable 
        class ChronoZonedDateTimeImpl   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class HijrahDate   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class JapaneseDate   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class MinguoDate   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
        class ThaiBuddhistDate   1 warning 
            method with(TemporalField, long)   1 warning 
                WARNING Variable 'f' can be replaced with pattern variable 
    java.time.format   3 warnings 
        class DecimalStyle   1 warning 
            method equals(Object)   1 warning 
                WARNING Variable 'other' can be replaced with pattern variable 
        class Parsed   2 warnings 
            method resolveFields()   2 warnings 
                WARNING Variable 'czdt' can be replaced with pattern variable 
                WARNING Variable 'cldt' can be replaced with pattern variable 
    java.time.zone   1 warning 
        class TzdbZoneRulesProvider   1 warning 
            method provideRules(String, boolean)   1 warning 
                WARNING Variable 'bytes' can be replaced with pattern variable 

Do you have plans to adjust them too?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3170


More information about the i18n-dev mailing list