mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8268469: Update java.time to use switch expressions
Reviewed-by: lancea, naoto, dfuchs, iris, chegar
This commit is contained in:
parent
ffa34ed429
commit
1d167978e5
22 changed files with 256 additions and 337 deletions
|
@ -191,16 +191,12 @@ final class Ser implements Externalizable {
|
|||
|
||||
private static Serializable readInternal(byte type, DataInput in)
|
||||
throws IOException, ClassNotFoundException {
|
||||
switch (type) {
|
||||
case ZRULES:
|
||||
return ZoneRules.readExternal(in);
|
||||
case ZOT:
|
||||
return ZoneOffsetTransition.readExternal(in);
|
||||
case ZOTRULE:
|
||||
return ZoneOffsetTransitionRule.readExternal(in);
|
||||
default:
|
||||
throw new StreamCorruptedException("Unknown serialized type");
|
||||
}
|
||||
return switch (type) {
|
||||
case ZRULES -> ZoneRules.readExternal(in);
|
||||
case ZOT -> ZoneOffsetTransition.readExternal(in);
|
||||
case ZOTRULE -> ZoneOffsetTransitionRule.readExternal(in);
|
||||
default -> throw new StreamCorruptedException("Unknown serialized type");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue