mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 14:58:39 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user