refactoring: issue#2376 (#2491)

Changed all the switch expression according to the JAVA 17.
This commit is contained in:
akshatarora0013
2023-04-01 20:18:38 +05:30
committed by GitHub
parent fc7e672419
commit 9d6ae392b8
23 changed files with 614 additions and 730 deletions
@@ -105,32 +105,32 @@ public abstract class AbstractInstance implements Instance, Runnable {
*/
private void processMessage(Message message) {
switch (message.getType()) {
case ELECTION:
case ELECTION -> {
LOGGER.info(INSTANCE + localId + " - Election Message handling...");
handleElectionMessage(message);
break;
case LEADER:
}
case LEADER -> {
LOGGER.info(INSTANCE + localId + " - Leader Message handling...");
handleLeaderMessage(message);
break;
case HEARTBEAT:
}
case HEARTBEAT -> {
LOGGER.info(INSTANCE + localId + " - Heartbeat Message handling...");
handleHeartbeatMessage(message);
break;
case ELECTION_INVOKE:
}
case ELECTION_INVOKE -> {
LOGGER.info(INSTANCE + localId + " - Election Invoke Message handling...");
handleElectionInvokeMessage();
break;
case LEADER_INVOKE:
}
case LEADER_INVOKE -> {
LOGGER.info(INSTANCE + localId + " - Leader Invoke Message handling...");
handleLeaderInvokeMessage();
break;
case HEARTBEAT_INVOKE:
}
case HEARTBEAT_INVOKE -> {
LOGGER.info(INSTANCE + localId + " - Heartbeat Invoke Message handling...");
handleHeartbeatInvokeMessage();
break;
default:
break;
}
default -> {
}
}
}