justinmclean commented on code in PR #6285:
URL: https://github.com/apache/gravitino/pull/6285#discussion_r1917617144


##########
clients/cli/src/main/java/org/apache/gravitino/cli/AreYouSure.java:
##########
@@ -32,16 +32,16 @@ public class AreYouSure {
    * @return {@code true} if the action is to continue {@code false} otherwise.
    */
   public static boolean really(boolean force) {
-    Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8.name());
-
     /* force option for scripting */
     if (force) {
       return true;
     }
 
-    System.out.println(
-        "This command could result in data loss or other issues. Are you sure 
you want to do this? (Y/N)");
-    String answer = scanner.next();
-    return answer.equals("Y");
+    try (Scanner scanner = new Scanner(System.in, 
StandardCharsets.UTF_8.name())) {
+      System.out.println(
+          "This command could result in data loss or other issues. Are you 
sure you want to do this? (Y/N)");
+      String answer = scanner.next();
+      return answer.equals("Y");
+    }

Review Comment:
   It will only work with a "Y"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to