libenchao commented on code in PR #3627:
URL: https://github.com/apache/calcite/pull/3627#discussion_r1452934528


##########
plus/src/main/java/org/apache/calcite/adapter/os/SqlShell.java:
##########
@@ -118,17 +118,18 @@ private static String model() {
   /** Main entry point. */
   @SuppressWarnings("CatchAndPrintStackTrace")
   public static void main(String[] args) {
-    try (PrintWriter err =
-             new PrintWriter(
-                 new OutputStreamWriter(System.err, StandardCharsets.UTF_8));
-         InputStreamReader in =
-             new InputStreamReader(System.in, StandardCharsets.UTF_8);
-         PrintWriter out =
-             new PrintWriter(
-                 new OutputStreamWriter(System.out, StandardCharsets.UTF_8))) {
+    try {
+      final PrintWriter err =
+          new PrintWriter(
+              new OutputStreamWriter(System.err, StandardCharsets.UTF_8));

Review Comment:
   I think it's ok to not close them, we only need to ensure they flush all the 
data into enclosed stream (for now, only `out` is used, and it's flushed in 
`finally` block).



-- 
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...@calcite.apache.org

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

Reply via email to