Use switch expression where feasible
See gh-38217
This commit is contained in:
committed by
Moritz Halbritter
parent
a006b26437
commit
d7ab153559
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user