Commit 813b7bca authored by Skylot's avatar Skylot

core: sort error nodes in execution report

parent e2945f2a
...@@ -7,7 +7,11 @@ import jadx.core.dex.nodes.ClassNode; ...@@ -7,7 +7,11 @@ import jadx.core.dex.nodes.ClassNode;
import jadx.core.dex.nodes.MethodNode; import jadx.core.dex.nodes.MethodNode;
import jadx.core.utils.exceptions.JadxOverflowException; import jadx.core.utils.exceptions.JadxOverflowException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -66,7 +70,14 @@ public class ErrorsCounter { ...@@ -66,7 +70,14 @@ public class ErrorsCounter {
public static void printReport() { public static void printReport() {
if (getErrorCount() > 0) { if (getErrorCount() > 0) {
LOG.error(getErrorCount() + " errors occured in following nodes:"); LOG.error(getErrorCount() + " errors occured in following nodes:");
for (Object node : ERROR_NODES) { List<Object> nodes = new ArrayList<Object>(ERROR_NODES);
Collections.sort(nodes, new Comparator<Object>() {
@Override
public int compare(Object o1, Object o2) {
return String.valueOf(o1).compareTo(String.valueOf(o2));
}
});
for (Object node : nodes) {
String nodeName = node.getClass().getSimpleName().replace("Node", ""); String nodeName = node.getClass().getSimpleName().replace("Node", "");
LOG.error(" " + nodeName + ": " + node); LOG.error(" " + nodeName + ": " + node);
} }
......
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