karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Nodet <gno...@gmail.com>
Subject Re: svn commit: r1064126 - /karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java
Date Thu, 27 Jan 2011 14:10:12 GMT
Could that be refactored a bit to avoid the performance loss caused by
re-creating a sorted set  each time the completer is invoked ?

On Thu, Jan 27, 2011 at 15:06,  <ldywicki@apache.org> wrote:
> Author: ldywicki
> Date: Thu Jan 27 14:06:22 2011
> New Revision: 1064126
>
> URL: http://svn.apache.org/viewvc?rev=1064126&view=rev
> Log:
> KARAF-421. Allow StringCompleter extensions to return own strings
>
> Modified:
>    karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java
>
> Modified: karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java?rev=1064126&r1=1064125&r2=1064126&view=diff
> ==============================================================================
> --- karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java
(original)
> +++ karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/completer/StringsCompleter.java
Thu Jan 27 14:06:22 2011
> @@ -81,7 +81,8 @@ public class StringsCompleter
>             buffer = buffer.toLowerCase();
>         }
>
> -        SortedSet<String> matches = strings.tailSet(buffer);
> +        // KARAF-421, use getStrings() instead strings field.
> +        SortedSet<String> matches = new TreeSet<String>(getStrings()).tailSet(buffer);
>
>         for (String match : matches) {
>             String s = caseSensitive ? match : match.toLowerCase();
>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Mime
View raw message