On Tue, 25 May 2021 09:37:58 GMT, Patrick Concannon <[email protected]>
wrote:
> Hi,
>
> Could someone please review my code for updating the code in the `java.io`,
> `java.math`, and `java.text` packages to make use of the switch expressions?
>
> Kind regards,
> Patrick
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;
....
-------------
PR: https://git.openjdk.java.net/jdk/pull/4182