RFR: 8267587: Update java.util to use enhanced switch [v5]
Brian Goetz
briangoetz at openjdk.java.net
Tue May 25 16:49:59 UTC 2021
On Tue, 25 May 2021 11:49:18 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:
>> Inspired by PR#4088. Most of the changes are done automatically using IntelliJ IDEA refactoring. Some manual adjustments are also performed, including indentations, moving comments, extracting common cast out of switch expression branches, etc.
>>
>> I also noticed that there are some switches having one branch only in JapaneseImperialCalendar.java. Probably it would be better to replace them with `if` statement?
>
> Tagir F. Valeev has updated the pull request incrementally with one additional commit since the last revision:
>
> More vertical alignment
src/java.base/share/classes/java/util/Calendar.java line 1507:
> 1505: }
> 1506: case "japanese" -> cal = new JapaneseImperialCalendar(zone, locale, true);
> 1507: default -> throw new IllegalArgumentException("unknown calendar type: " + type);
Agree with Chris' suggestion here.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4161
More information about the security-dev
mailing list