RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v2]
Patrick Concannon
pconcannon at openjdk.java.net
Tue May 25 14:57:26 UTC 2021
On Tue, 25 May 2021 13:16:00 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> 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 three additional commits since the last revision:
>>
>> - 8267670: Updated code to use yield
>> - Merge remote-tracking branch 'origin/master' into JDK-8267670
>> - 8267670: Update java.io, java.math, and java.text to use switch expressions
>
> src/java.base/share/classes/java/io/ObjectStreamField.java line 123:
>
>> 121: case 'D' -> type = Double.TYPE;
>> 122: case 'L', '[' -> type = Object.class;
>> 123: default -> throw new IllegalArgumentException("illegal signature");
>
> Why not assign type here?
>
>
> type = switch(signature.charAt(0)) {
> case 'Z' -> Boolean.TYPE;
> ....
Thanks for your suggestion. I've done that now. See adc8af4
-------------
PR: https://git.openjdk.java.net/jdk/pull/4182
More information about the core-libs-dev
mailing list