Commit cc1be673 authored by Skylot's avatar Skylot

core: sort classes in package and methods

parent f9e87d4d
...@@ -16,6 +16,7 @@ import java.io.File; ...@@ -16,6 +16,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -89,6 +90,14 @@ public final class Decompiler { ...@@ -89,6 +90,14 @@ public final class Decompiler {
packages.add(new JavaPackage(entry.getKey(), entry.getValue())); packages.add(new JavaPackage(entry.getKey(), entry.getValue()));
} }
Collections.sort(packages); Collections.sort(packages);
for (JavaPackage pkg : packages) {
Collections.sort(pkg.getClasses(), new Comparator<JavaClass>() {
@Override
public int compare(JavaClass o1, JavaClass o2) {
return o1.getShortName().compareTo(o2.getShortName());
}
});
}
return Collections.unmodifiableList(packages); return Collections.unmodifiableList(packages);
} }
......
...@@ -8,6 +8,7 @@ import jadx.core.dex.nodes.MethodNode; ...@@ -8,6 +8,7 @@ import jadx.core.dex.nodes.MethodNode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
public final class JavaClass { public final class JavaClass {
...@@ -54,6 +55,12 @@ public final class JavaClass { ...@@ -54,6 +55,12 @@ public final class JavaClass {
mths.add(new JavaMethod(m)); mths.add(new JavaMethod(m));
} }
} }
Collections.sort(mths, new Comparator<JavaMethod>() {
@Override
public int compare(JavaMethod o1, JavaMethod o2) {
return o1.getName().compareTo(o2.getName());
}
});
this.methods = Collections.unmodifiableList(mths); this.methods = Collections.unmodifiableList(mths);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment