PDavid commented on code in PR #2357:
URL: https://github.com/apache/zookeeper/pull/2357#discussion_r3014642381


##########
zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java:
##########
@@ -310,9 +310,13 @@ void run() throws IOException, InterruptedException {
 
             boolean jlinemissing = false;
             // only use jline if it's in the classpath
+            Class<?> endOfFileExceptionC = null;
+            Class<?> userInterruptExceptionC = null;
             try {
                 Class<?> readerC = 
Class.forName("org.jline.reader.LineReader");
                 Class<?> completerC = 
Class.forName("org.apache.zookeeper.JLineZNodeCompleter");
+                endOfFileExceptionC = 
Class.forName("org.jline.reader.EndOfFileException");
+                userInterruptExceptionC = 
Class.forName("org.jline.reader.UserInterruptException");
 
                 System.out.println("JLine support is enabled");

Review Comment:
   As many thanks! :+1:
   This makes perfect sense and this is so much simpler and easier than I 
implemented here.  :man_facepalming:  :smile:
   
   I tried this out and works nicely. Please check it here: 
https://github.com/apache/zookeeper/pull/2369



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to