mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 09:13:27 +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:
1 parent
120033b58b
commit
95f2c19780
1 file changed
+1
-1
@@ -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