refactoring: issue#2376 (#2491)

Changed all the switch expression according to the JAVA 17.
This commit is contained in:
akshatarora0013 authored and GitHub committed 2023-04-01 17:48:38 +03:00
1 parent fc7e672419
commit 9d6ae392b8
23 files changed
+608 -724

No files matched your search

@@ -113,16 +113,15 @@ public class DefaultCircuitBreaker implements CircuitBreaker {
public void setState(State state) {
this.state = state;
switch (state) {
case OPEN:
case OPEN -> {
this.failureCount = failureThreshold;
this.lastFailureTime = System.nanoTime();
break;
case HALF_OPEN:
}
case HALF_OPEN -> {
this.failureCount = failureThreshold;
this.lastFailureTime = System.nanoTime() - retryTimePeriod;
break;
default:
this.failureCount = 0;
}
default -> this.failureCount = 0;
}
}