|
17 | 17 |
|
18 | 18 | import com.google.common.reflect.ClassPath.ClassInfo; |
19 | 19 | import com.google.common.reflect.ClassPath; |
20 | | - |
| 20 | +import com.google.common.base.Joiner; |
21 | 21 | public class App { |
22 | 22 | // -o absolutepathpath.txt to output to text file instead of console |
23 | 23 | public static void main(String[] args) throws Exception { |
@@ -106,9 +106,26 @@ private static void serializeFields(final Class<?> clazz, final ILogWriter write |
106 | 106 | } |
107 | 107 | } |
108 | 108 | private static List<String> methodsNameToSkip; |
| 109 | + private static String delimiter = " "; |
109 | 110 | private static void serializeMethods(final Class<?> clazz, final ILogWriter writer) { |
110 | 111 | final Method[] methods = clazz.getMethods(); |
111 | | - Arrays.sort(methods, (o1, o2) -> o1.getName().compareTo(o2.getName())); |
| 112 | + Arrays.sort(methods, (o1, o2) -> (o1.getName() + |
| 113 | + Joiner.on(delimiter) |
| 114 | + .useForNull("") |
| 115 | + .join(Arrays.asList(o1.getParameters()) |
| 116 | + .stream() |
| 117 | + .sequential() |
| 118 | + .map(x -> x.getName() + x.getType().getName()) |
| 119 | + .collect(Collectors.toList()))) |
| 120 | + .compareTo(o2.getName() + |
| 121 | + Joiner.on(delimiter) |
| 122 | + .useForNull("") |
| 123 | + .join(Arrays.asList(o2.getParameters()) |
| 124 | + .stream() |
| 125 | + .sequential() |
| 126 | + .map(x -> x.getName() + x.getType().getName()) |
| 127 | + .collect(Collectors.toList()))) |
| 128 | + ); |
112 | 129 | for(Method method : methods) { |
113 | 130 | if(!methodsNameToSkip.contains(method.getName())) { |
114 | 131 | writer.write("method " + method.getName(), 2); |
|
0 commit comments