From d502b46b9e5504193b25d4aa9a1a03d601344e5d Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sun, 27 Jun 2021 22:16:05 +0200 Subject: Fixing lower case issue following acceptance test --- src/main/java/musichub/util/Policy.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/musichub/util/Policy.java b/src/main/java/musichub/util/Policy.java index 93e7caf..3d041d1 100644 --- a/src/main/java/musichub/util/Policy.java +++ b/src/main/java/musichub/util/Policy.java @@ -1,10 +1,5 @@ package musichub.util; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.sql.Timestamp; import java.util.Scanner; /** @@ -111,8 +106,7 @@ public final class Policy { printAgreement(); Scanner scan = new Scanner(System.in); - String choice = scan.nextLine(); - choice = choice.toLowerCase(); + String choice = scan.nextLine().toLowerCase(); while (!choice.equals("y")) { switch (choice.charAt(0)) { @@ -120,11 +114,11 @@ public final class Policy { case 'r' -> { System.out.println(termsAndConditions); printAgreement(); - choice = scan.nextLine(); + choice = scan.nextLine().toLowerCase(); } default -> { printAgreement(); - choice = scan.nextLine(); + choice = scan.nextLine().toLowerCase(); } } } -- cgit v1.2.3