mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8269124: Update java.time to use switch expressions (part II)
Reviewed-by: dfuchs, vtewari, aefimov, iris, lancea, naoto
This commit is contained in:
parent
675a9520b2
commit
8a7b380ebb
16 changed files with 322 additions and 370 deletions
|
@ -2557,13 +2557,13 @@ public final class DateTimeFormatterBuilder {
|
|||
@Override
|
||||
public String toString() {
|
||||
// using ordinals to avoid javac synthetic inner class
|
||||
switch (ordinal()) {
|
||||
case 0: return "ParseCaseSensitive(true)";
|
||||
case 1: return "ParseCaseSensitive(false)";
|
||||
case 2: return "ParseStrict(true)";
|
||||
case 3: return "ParseStrict(false)";
|
||||
}
|
||||
throw new IllegalStateException("Unreachable");
|
||||
return switch (ordinal()) {
|
||||
case 0 -> "ParseCaseSensitive(true)";
|
||||
case 1 -> "ParseCaseSensitive(false)";
|
||||
case 2 -> "ParseStrict(true)";
|
||||
case 3 -> "ParseStrict(false)";
|
||||
default -> throw new IllegalStateException("Unreachable");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue