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); |           addFundsToLotteryAccount(bank, scanner); | ||||||
|         } else if ("3".equals(cmd)) { |         } else if ("3".equals(cmd)) { | ||||||
|           submitTicket(service, scanner); |           submitTicket(service, scanner); | ||||||
|         } else if (cmd.equals("4")) { |         } else if ("4".equals(cmd)) { | ||||||
|           checkTicket(service, scanner); |           checkTicket(service, scanner); | ||||||
|         } else if ("5".equals(cmd)) { |         } else if ("5".equals(cmd)) { | ||||||
|           exit = true; |           exit = true; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user