Skip to content

Commit

Permalink
improve SearchClassCommand. #234
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed Oct 18, 2018
1 parent 7f89c8c commit 13684c5
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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;
Expand Down Expand Up @@ -90,11 +89,11 @@ public void process(CommandProcess process) {
// 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));
}
});

Expand Down

0 comments on commit 13684c5

Please sign in to comment.