Use switch expression where feasible

See gh-38217
This commit is contained in:
Yanming Zhou
2023-11-06 11:05:13 +08:00
committed by Moritz Halbritter
parent a006b26437
commit d7ab153559
3 changed files with 23 additions and 24 deletions

View File

@@ -27,12 +27,12 @@ public class MyReadinessStateExporter {
@EventListener
public void onStateChange(AvailabilityChangeEvent<ReadinessState> event) {
switch (event.getState()) {
case ACCEPTING_TRAFFIC:
case ACCEPTING_TRAFFIC -> {
// create file /tmp/healthy
break;
case REFUSING_TRAFFIC:
}
case REFUSING_TRAFFIC -> {
// remove file /tmp/healthy
break;
}
}
}