From: <ls...@us...> - 2007-09-23 18:39:58
|
Revision: 3524 http://jnode.svn.sourceforge.net/jnode/?rev=3524&view=rev Author: lsantha Date: 2007-09-23 11:39:55 -0700 (Sun, 23 Sep 2007) Log Message: ----------- Eliminated duplicate thread names. Modified Paths: -------------- trunk/shell/src/shell/org/jnode/shell/help/argument/ThreadNameArgument.java Modified: trunk/shell/src/shell/org/jnode/shell/help/argument/ThreadNameArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/help/argument/ThreadNameArgument.java 2007-09-23 18:27:44 UTC (rev 3523) +++ trunk/shell/src/shell/org/jnode/shell/help/argument/ThreadNameArgument.java 2007-09-23 18:39:55 UTC (rev 3524) @@ -21,8 +21,7 @@ package org.jnode.shell.help.argument; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import java.security.AccessController; import java.security.PrivilegedAction; @@ -42,7 +41,7 @@ } public String complete(final String partial) { - final ArrayList<String> names = new ArrayList<String>(); + final HashSet<String> names = new HashSet<String>(); ThreadGroup grp = Thread.currentThread().getThreadGroup(); while (grp.getParent() != null) { grp = grp.getParent(); @@ -59,7 +58,7 @@ return complete(partial, names); } - private void findList(ThreadGroup grp, String partial, List<String> names) { + private void findList(ThreadGroup grp, String partial, HashSet<String> names) { final Thread[] ts = new Thread[grp.activeCount()]; grp.enumerate(ts); for (Thread t : ts) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |