🎨 Improving structure / format of the code. Switch Case 语句格式 调整

This commit is contained in:
lbw committed 2022-07-03 08:37:43 +08:00
1 parent 2dfebcb79e
commit ca20a8a732
17 files changed
+657 -656

No files matched your search

@@ -159,45 +159,45 @@ public class SessionHolder {
GlobalSession globalSession = iterator.next();
GlobalStatus globalStatus = globalSession.getStatus();
switch (globalStatus) {
case UnKnown:
case Committed:
case CommitFailed:
case Rollbacked:
case RollbackFailed:
case TimeoutRollbacked:
case TimeoutRollbackFailed:
case Finished:
removeGlobalSessions.add(globalSession);
break;
case AsyncCommitting:
if (storeMode == StoreMode.FILE) {
queueToAsyncCommitting(globalSession);
}
break;
default: {
if (storeMode == StoreMode.FILE) {
lockBranchSessions(globalSession.getSortedBranches());
switch (globalStatus) {
case Committing:
case CommitRetrying:
queueToRetryCommit(globalSession);
break;
case Rollbacking:
case RollbackRetrying:
case TimeoutRollbacking:
case TimeoutRollbackRetrying:
queueToRetryRollback(globalSession);
break;
case Begin:
globalSession.setActive(true);
break;
default:
throw new ShouldNeverHappenException("NOT properly handled " + globalStatus);
case UnKnown:
case Committed:
case CommitFailed:
case Rollbacked:
case RollbackFailed:
case TimeoutRollbacked:
case TimeoutRollbackFailed:
case Finished:
removeGlobalSessions.add(globalSession);
break;
case AsyncCommitting:
if (storeMode == StoreMode.FILE) {
queueToAsyncCommitting(globalSession);
}
break;
default: {
if (storeMode == StoreMode.FILE) {
lockBranchSessions(globalSession.getSortedBranches());
switch (globalStatus) {
case Committing:
case CommitRetrying:
queueToRetryCommit(globalSession);
break;
case Rollbacking:
case RollbackRetrying:
case TimeoutRollbacking:
case TimeoutRollbackRetrying:
queueToRetryRollback(globalSession);
break;
case Begin:
globalSession.setActive(true);
break;
default:
throw new ShouldNeverHappenException("NOT properly handled " + globalStatus);
}
}
break;
}
break;
}
}
}
for (GlobalSession globalSession : removeGlobalSessions) {