mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-30 07:32:57 +00:00
improve SearchClassCommand. #234
This commit is contained in:
1 parent
7f89c8c290
commit
13684c5718
1 file changed
+4
-5
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.taobao.arthas.core.command.Constants;
|
||||
import com.taobao.arthas.core.shell.command.AnnotatedCommand;
|
||||
@@ -90,11 +89,11 @@ public class SearchClassCommand extends AnnotatedCommand {
|
||||
// TODO: null check
|
||||
RowAffect affect = new RowAffect();
|
||||
Instrumentation inst = process.session().getInstrumentation();
|
||||
List<Class<?>> matchedClasses = new ArrayList(SearchUtils.searchClass(inst, classPattern, isRegEx));
|
||||
Collections.sort(matchedClasses, new Comparator() {
|
||||
List<Class<?>> matchedClasses = new ArrayList<Class<?>>(SearchUtils.searchClass(inst, classPattern, isRegEx));
|
||||
Collections.sort(matchedClasses, new Comparator<Class<?>>() {
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
return StringUtils.classname((Class) o1).compareTo(StringUtils.classname((Class) o2));
|
||||
public int compare(Class<?> c1, Class<?> c2) {
|
||||
return StringUtils.classname(c1).compareTo(StringUtils.classname(c2));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user