void sortClasses(ClassClass classes[]) { ArrayList list = new ArrayList(); for (int i = 0; i < classes.length; i++) { list.add(classes[i]); } Collections.sort( list, new Comparator() { public int compare(Object o1, Object o2) { ClassClass c1 = (ClassClass) o1; ClassClass c2 = (ClassClass) o2; return c1.ci.className.compareTo(c2.ci.className); } }); for (int i = 0; i < list.size(); i++) { classes[i] = (ClassClass) list.get(i); } }
void sortMethods(EVMMethodInfo methods[]) { ArrayList list = new ArrayList(); for (int i = 0; i < methods.length; i++) { list.add(methods[i]); } Collections.sort( list, new Comparator() { public int compare(Object o1, Object o2) { MethodInfo m1 = ((EVMMethodInfo) o1).method; MethodInfo m2 = ((EVMMethodInfo) o2).method; int n = m1.name.string.compareTo(m2.name.string); if (n != 0) { return n; } else { return m1.type.string.compareTo(m2.type.string); } } }); for (int i = 0; i < list.size(); i++) { methods[i] = (EVMMethodInfo) list.get(i); } }