@Override public MethodInfo[] getDeclaredMethods() { Iterable<? extends Method> implMethods = classDef.getMethods(); List<MethodInfo> result = new ArrayList<>(); for (Method method : implMethods) { if (!isConstructor(method)) { MethodInfo mi = new MethodInfo(); mi.parameterTypes = convertParameters(method.getParameters()); mi.annotations = convertAnnotations(method.getAnnotations()); mi.modifiers = method.getAccessFlags(); mi.name = method.getName(); mi.exceptionTypes = new ExceptionInfo[0]; mi.returnType = DexlibAdapter.getTypeName(method.getReturnType()); result.add(mi); } } MethodInfo[] array = new MethodInfo[result.size()]; return result.toArray(array); }
private static boolean isConstructor(Method constructor) { return constructor.getName().equals("<init>"); }