@Override public Method resolveInternal() { Class<?> parentClass = parent.resolve(); if (parentClass == null) return null; List<Class<?>> argClasses = Lists.newLinkedList(); for (ClassRef argType : argTypes) { if (argType.resolve() == null) return null; argClasses.add(argType.resolve()); } Class<?>[] args = argClasses.toArray(new Class<?>[0]); Method methodObj; try { methodObj = parentClass.getDeclaredMethod(srgName, args); methodObj.setAccessible(true); return methodObj; } catch (Exception e) { } try { methodObj = parentClass.getDeclaredMethod(mcpName, args); methodObj.setAccessible(true); return methodObj; } catch (Exception e) { } return null; }
public String getAsmDescriptor(Namespace nameType) { StringBuilder sb = new StringBuilder("("); for (ClassRef arg : argTypes) sb.append(arg.getAsmDescriptor(nameType)); sb.append(")"); sb.append(returnType.getAsmDescriptor(nameType)); return sb.toString(); }