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:
Krisztián Nagy 2016-12-18 16:08:59 +01:00
parent 120033b58b
commit 95f2c19780

View File

@ -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;