Sonar bug fixes using Yoda condition in equals expression when comparing String literal with String object.
Using try-with-resources if we use Scanner to close the underlying stream is a good practice to handle resources. Minimal refactor.
This commit is contained in:
parent
120033b58b
commit
95f2c19780
@ -67,7 +67,7 @@ public class ConsoleLottery {
|
||||
addFundsToLotteryAccount(bank, scanner);
|
||||
} else if ("3".equals(cmd)) {
|
||||
submitTicket(service, scanner);
|
||||
} else if (cmd.equals("4")) {
|
||||
} else if ("4".equals(cmd)) {
|
||||
checkTicket(service, scanner);
|
||||
} else if ("5".equals(cmd)) {
|
||||
exit = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user