Explorar o código

ZOOKEEPER-1718. Support JLine 2 (Manikumar Reddy via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1528219 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt %!s(int64=11) %!d(string=hai) anos
pai
achega
9c953d1ae2

+ 2 - 0
CHANGES.txt

@@ -395,6 +395,8 @@ BUGFIXES:
   ZOOKEEPER-1769. ZooInspector can't display node data/metadata/ACLs
   (Benjamin Jaton via phunt)
 
+  ZOOKEEPER-1718. Support JLine 2 (Manikumar Reddy via phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 1 - 1
ivy.xml

@@ -45,7 +45,7 @@
   
     <!-- transitive false turns off dependency checking, log4j deps seem borked -->
     <dependency org="log4j" name="log4j" rev="1.2.16" transitive="false" conf="default"/>
-    <dependency org="jline" name="jline" rev="0.9.94" transitive="false" conf="default"/>
+    <dependency org="jline" name="jline" rev="2.11" transitive="false" conf="default"/>
 
     <dependency org="org.jboss.netty" name="netty" conf="default" rev="3.2.5.Final">
       <artifact name="netty" type="jar" conf="default"/>

+ 3 - 1
src/java/lib/jline-0.9.94.LICENSE.txt → src/java/lib/jline-2.11.LICENSE.txt

@@ -1,6 +1,8 @@
-Copyright (c) 2002-2006, Marc Prud'hommeaux <mwp1@cornell.edu>
+Copyright (c) 2002-2012, the original author or authors.
 All rights reserved.
 
+http://www.opensource.org/licenses/bsd-license.php
+
 Redistribution and use in source and binary forms, with or
 without modification, are permitted provided that the following
 conditions are met:

+ 3 - 3
src/java/main/org/apache/zookeeper/JLineZNodeCompletor.java → src/java/main/org/apache/zookeeper/JLineZNodeCompleter.java

@@ -20,12 +20,12 @@ package org.apache.zookeeper;
 
 import java.util.List;
 
-import jline.Completor;
+import jline.console.completer.Completer;
 
-class JLineZNodeCompletor implements Completor {
+class JLineZNodeCompleter implements Completer {
     private ZooKeeper zk;
 
-    public JLineZNodeCompletor(ZooKeeper zk) {
+    public JLineZNodeCompleter(ZooKeeper zk) {
         this.zk = zk;
     }
 

+ 4 - 4
src/java/main/org/apache/zookeeper/ZooKeeperMain.java

@@ -293,9 +293,9 @@ public class ZooKeeperMain {
             boolean jlinemissing = false;
             // only use jline if it's in the classpath
             try {
-                Class<?> consoleC = Class.forName("jline.ConsoleReader");
+                Class<?> consoleC = Class.forName("jline.console.ConsoleReader");
                 Class<?> completorC =
-                    Class.forName("org.apache.zookeeper.JLineZNodeCompletor");
+                    Class.forName("org.apache.zookeeper.JLineZNodeCompleter");
 
                 System.out.println("JLine support is enabled");
 
@@ -304,8 +304,8 @@ public class ZooKeeperMain {
 
                 Object completor =
                     completorC.getConstructor(ZooKeeper.class).newInstance(zk);
-                Method addCompletor = consoleC.getMethod("addCompletor",
-                        Class.forName("jline.Completor"));
+                Method addCompletor = consoleC.getMethod("addCompleter",
+                        Class.forName("jline.console.completer.Completer"));
                 addCompletor.invoke(console, completor);
 
                 String line;