mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -518,12 +518,10 @@ public final class HijrahChronology extends AbstractChronology implements Serial
|
|||
*/
|
||||
@Override
|
||||
public HijrahEra eraOf(int eraValue) {
|
||||
switch (eraValue) {
|
||||
case 1:
|
||||
return HijrahEra.AH;
|
||||
default:
|
||||
throw new DateTimeException("invalid Hijrah era");
|
||||
}
|
||||
return switch (eraValue) {
|
||||
case 1 -> HijrahEra.AH;
|
||||
default -> throw new DateTimeException("invalid Hijrah era");
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue