geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r699827 - /geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
Date Sun, 28 Sep 2008 14:34:14 GMT
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;
             }
 



Mime
View raw message