gets the return type signature from a method signature

@param methodSig
the signature of the method

@return the signature of the return type, or ? if a bogus method signature is given
347368
public static String getReturnSignature(String methodSig) {
        int parenPos = methodSig.indexOf(')');
        if (parenPos < 0) {
            return "?";
        }

        return methodSig.substring(parenPos + 1);
    }
426019
static Method getGaugeMethod(Registry registry, Id id, Object obj, String method) {
    try {
      final Method m = Utils.getMethod(obj.getClass(), method);
      try {
        // Make sure we can cast the response to a Number
        final Number n = (Number) m.invoke(obj);
        REGISTRY_LOGGER.debug(
            "registering gauge {}, using method [{}], with initial value {}", id, m, n);
        return m;
      } catch (Exception e) {
        final String msg = "exception thrown invoking method [" + m
            + "], skipping registration of gauge " + id;
        registry.propagate(msg, e);
      }
    } catch (NoSuchMethodException e) {
      final String mname = obj.getClass().getName() + "." + method;
      final String msg = "invalid method [" + mname + "], skipping registration of gauge " + id;
      registry.propagate(msg, e);
    }
    return null;
  }
816046
private boolean equalsSimpleTypeNames(MethodIdentifier identifier, MethodResult methodResult) {
        MethodIdentifier originalIdentifier = methodResult.getOriginalMethodSignature();

        return originalIdentifier.getMethodName().equals(identifier.getMethodName()) &&
                matchesTypeBestEffort(originalIdentifier.getReturnType(), identifier.getReturnType()) &&
                parameterMatch(originalIdentifier.getParameters(), identifier.getParameters());
    }
192200
public static List<String> getParameterSignatures(String methodSignature) {

        int start = methodSignature.indexOf('(') + 1;
        int limit = methodSignature.lastIndexOf(')');

        if ((limit - start) == 0) {
            return Collections.emptyList();
        }

        List<String> parmSignatures = new ArrayList<>();
        int sigStart = start;
        for (int i = start; i < limit; i++) {
            if (!methodSignature.startsWith(Values.SIG_ARRAY_PREFIX, i)) {
                if (methodSignature.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX, i)) {
                    int semiPos = methodSignature.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR, i + 1);
                    parmSignatures.add(methodSignature.substring(sigStart, semiPos + 1));
                    i = semiPos;
                } else if (!isWonkyEclipseSignature(methodSignature, i)) {
                    parmSignatures.add(methodSignature.substring(sigStart, i + 1));
                }
                sigStart = i + 1;
            }
        }

        return parmSignatures;
    }
1108789
@Nullable
  public static MethodSymbol getSymbol(MethodInvocationTree tree) {
    Symbol sym = ASTHelpers.getSymbol(tree.getMethodSelect());
    if (!(sym instanceof MethodSymbol)) {
      // Defensive. Would only occur if there are errors in the AST.
      return null;
    }
    return (MethodSymbol) sym;
  }
1074757
protected static String getMethodSignature(Method method) {
    return getMethodSignature(method.getName(), method.getParameterTypes(), method.getReturnType());
  }
1367752
Name typeSig(Type type) {
        Assert.check(signatureGen.isEmpty());
        //- System.out.println(" ? " + type);
        signatureGen.assembleSig(type);
        Name n = signatureGen.toName();
        signatureGen.reset();
        //- System.out.println("   " + n);
        return n;
    }
244779
private static String getMethodName(MethodSymbol methodSym) {
    return String.format("%s#%s", methodSym.owner, methodSym.getSimpleName());
  }
472273
public static BshMethod getMethod(Class<?> type, String name, Class<?>[] sig) {
        return getMethod(getThisNS(type), name, sig);
    }
111002
private Method findCallbackMethod(final Class<?> klass, final String signature) {
        for (Method method : klass.getMethods()) {

            if (method.toString().equals(signature)) {
                // found!
                return method;
            }
        }

        throw new JsiiException("Unable to find callback method with signature: " + signature);
    }
582869
public static String convertMethodSignature(JavaClass javaClass, Method method) {
        return convertMethodSignature(javaClass.getClassName(), method.getName(), method.getSignature());
    }
501255
private static String createSig(Method m) {
        return m.getName() + ':' + MethodDesc.forMethod(m).getDescriptor();
    }
1017836
public static String getDigAlgFromSigAlg(String signatureAlgorithm) {
        signatureAlgorithm = signatureAlgorithm.toUpperCase(Locale.ENGLISH);
        int with = signatureAlgorithm.indexOf("WITH");
        if (with > 0) {
            return signatureAlgorithm.substring(0, with);
        }
        return null;
    }
633240
public static int getNumParameters(String methodSignature) {
        int start = methodSignature.indexOf('(') + 1;
        int limit = methodSignature.lastIndexOf(')');

        if ((limit - start) == 0) {
            return 0;
        }

        int numParms = 0;
        for (int i = start; i < limit; i++) {
            if (!methodSignature.startsWith(Values.SIG_ARRAY_PREFIX, i)) {
                if (methodSignature.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX, i)) {
                    i = methodSignature.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR, i + 1);
                } else if (isWonkyEclipseSignature(methodSignature, i)) {
                    continue;
                }
                numParms++;
            }
        }

        return numParms;
    }
1058198
public static String getMethodSignature(String name, String rawSignature) {
        StringBuilder signature = new StringBuilder();
        String returnType = org.objectweb.asm.Type.getReturnType(rawSignature).getClassName();
        if (returnType != null) {
            signature.append(returnType);
            signature.append(' ');
        }
        signature.append(name);
        signature.append('(');
        org.objectweb.asm.Type[] types = org.objectweb.asm.Type.getArgumentTypes(rawSignature);
        for (int i = 0; i < types.length; i++) {
            if (i > 0) {
                signature.append(',');
            }
            signature.append(types[i].getClassName());
        }
        signature.append(')');
        return signature.toString();
    }
1216523
public String getMethodSignature() {
        if (method != null) {
            String methodSignature = method.toString();
            return methodSignature.replaceFirst("public void ", "");
        }
        return null;
    }
78109
public static Type getReturnType(final String methodDescriptor) {
    // Skip the first character, which is always a '('.
    int currentOffset = 1;
    // Skip the argument types, one at a each loop iteration.
    while (methodDescriptor.charAt(currentOffset) != ')') {
      while (methodDescriptor.charAt(currentOffset) == '[') {
        currentOffset++;
      }
      if (methodDescriptor.charAt(currentOffset++) == 'L') {
        while (methodDescriptor.charAt(currentOffset++) != ';') {
          // Skip the argument descriptor content.
        }
      }
    }
    return getType(methodDescriptor, currentOffset + 1, methodDescriptor.length());
  }