mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 16:14:58 +00:00
refactoring: issue#2376 (#2491)
Changed all the switch expression according to the JAVA 17.
This commit is contained in:
1 parent
fc7e672419
commit
9d6ae392b8
23 files changed
+608
-724
No files matched your search
+5
-6
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user