This is an automated email from the ASF dual-hosted git repository.
wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 046f2c1 For code format (#9407)
046f2c1 is described below
commit 046f2c150eec8dd56d3ec415eeec611b3e13c22e
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Feb 9 22:46:07 2021 +0800
For code format (#9407)
---
.../java/org/apache/shardingsphere/infra/state/StateContext.java | 8 ++++----
.../org/apache/shardingsphere/infra/state/StateContextTest.java | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/state/StateContext.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/state/StateContext.java
index e54653c..00b3d92 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/state/StateContext.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/state/StateContext.java
@@ -52,6 +52,10 @@ public final class StateContext {
}
}
+ private void recoverState() {
+ currentState.pop();
+ }
+
/**
* Get current state.
*
@@ -60,8 +64,4 @@ public final class StateContext {
public StateType getCurrentState() {
return Optional.ofNullable(currentState.peek()).orElse(StateType.OK);
}
-
- private void recoverState() {
- currentState.pop();
- }
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/state/StateContextTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/state/StateContextTest.java
index ada85b5..78f652b 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/state/StateContextTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/state/StateContextTest.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertThat;
public final class StateContextTest {
- private StateContext stateContext = new StateContext();
+ private final StateContext stateContext = new StateContext();
@Test
public void assertSwitchStateWithCircuitBreakOn() {