[WIP] Upgrade ONOS to karaf version 4.2.1
Change-Id: I7cd40c995bdf1c80f94b1895fb3344e32404c7fa
diff --git a/cli/src/main/java/org/onosproject/cli/AbstractChoicesCompleter.java b/cli/src/main/java/org/onosproject/cli/AbstractChoicesCompleter.java
index 5b5e808..4f1962c 100644
--- a/cli/src/main/java/org/onosproject/cli/AbstractChoicesCompleter.java
+++ b/cli/src/main/java/org/onosproject/cli/AbstractChoicesCompleter.java
@@ -15,7 +15,9 @@
*/
package org.onosproject.cli;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
import java.util.List;
import java.util.SortedSet;
@@ -26,13 +28,17 @@
public abstract class AbstractChoicesCompleter extends AbstractCompleter {
protected abstract List<String> choices();
+ protected CommandLine commandLine;
+ protected Session session;
@Override
- public int complete(String buffer, int cursor, List<String> candidates) {
+ public int complete(Session session, CommandLine commandLine, List<String> candidates) {
+ this.session = session;
+ this.commandLine = commandLine;
StringsCompleter delegate = new StringsCompleter();
SortedSet<String> strings = delegate.getStrings();
choices().forEach(strings::add);
- return delegate.complete(buffer, cursor, candidates);
+ return delegate.complete(session, commandLine, candidates);
}
}