refactoring: issue#2376 (#2491)

Changed all the switch expression according to the JAVA 17.
This commit is contained in:
akshatarora0013 authored and GitHub committed 2023-04-01 17:48:38 +03:00
1 parent fc7e672419
commit 9d6ae392b8
23 files changed
+608 -724

No files matched your search

@@ -45,16 +45,12 @@ public class RangeShardManager extends ShardManager {
@Override
protected int allocateShard(Data data) {
var type = data.getType();
switch (type) {
case TYPE_1:
return 1;
case TYPE_2:
return 2;
case TYPE_3:
return 3;
default:
return -1;
}
return switch (type) {
case TYPE_1 -> 1;
case TYPE_2 -> 2;
case TYPE_3 -> 3;
default -> -1;
};
}
}