You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/09/28 16:34:14 UTC

svn commit: r699827 - /geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java

Author: jdillon
Date: Sun Sep 28 07:34:14 2008
New Revision: 699827

URL: http://svn.apache.org/viewvc?rev=699827&view=rev
Log:
Tidy

Modified:
    geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java

Modified: geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java?rev=699827&r1=699826&r2=699827&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java Sun Sep 28 07:34:14 2008
@@ -53,16 +53,18 @@
         return strings;
     }
 
-    public int complete(final String buffer, final int cursor, final List candidates) {
+    public int complete(String buffer, final int cursor, final List candidates) {
         // buffer could be null
         assert candidates != null;
 
-        String start = (buffer == null) ? "" : buffer;
+        if (buffer == null) {
+            buffer = "";
+        }
 
-        SortedSet<String> matches = strings.tailSet(start);
+        SortedSet<String> matches = strings.tailSet(buffer);
 
         for (String match : matches) {
-            if (!match.startsWith(start)) {
+            if (!match.startsWith(buffer)) {
                 break;
             }