Skip to content

Commit 6478e4b

Browse files
fix: don't use enhanced switch
this language feature is not available in 1.3
1 parent 45799a6 commit 6478e4b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

atomix/cluster/src/main/java/io/atomix/raft/impl/RaftContext.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,17 @@ public void addSnapshotReplicationListener(
477477
// Notify listener immediately if it registered during an ongoing replication.
478478
// This is to prevent missing necessary state transitions.
479479
switch (missedSnapshotReplicationEvents) {
480-
case STARTED -> snapshotReplicationListener.onSnapshotReplicationStarted();
481-
case COMPLETED -> {
480+
case STARTED:
482481
snapshotReplicationListener.onSnapshotReplicationStarted();
483-
snapshotReplicationListener.onSnapshotReplicationCompleted(term);
484-
}
485-
default -> {}
482+
break;
483+
case COMPLETED:
484+
{
485+
snapshotReplicationListener.onSnapshotReplicationStarted();
486+
snapshotReplicationListener.onSnapshotReplicationCompleted(term);
487+
break;
488+
}
489+
default:
490+
break;
486491
}
487492
});
488493
}

0 commit comments

Comments
 (0)