private boolean doMatchesSignature()

in src/main/java/org/adoptopenjdk/jitwatch/ui/code/languages/JitWatchJavaSupport.java [85:136]


    private boolean doMatchesSignature(PsiMethod method, String memberName, List<String> paramTypeNames, String returnTypeName)
    {
        String psiMethodName;
        if (method.isConstructor())
        {
            String classVMName = JVMNameUtil.getClassVMName(method.getContainingClass());
            psiMethodName = (classVMName != null && classVMName.contains("."))
                    ? classVMName.substring(classVMName.lastIndexOf('.') + 1)
                    : method.getName();
        }
        else
        {
            psiMethodName = method.getName();
        }

        if (!memberName.equals(psiMethodName))
        {
            return false;
        }

        if (paramTypeNames.size() != method.getParameterList().getParametersCount())
        {
            return false;
        }

        List<String> methodParamTypes = new ArrayList<>();
        for (PsiParameter parameter : method.getParameterList().getParameters())
        {
            methodParamTypes.add(jvmText(parameter.getType()));
        }

        for (int i = 0; i < paramTypeNames.size(); i++)
        {
            String methodParamType = methodParamTypes.get(i);
            if (!paramTypeNames.get(i).equals(methodParamType))
            {
                methodParamType = JavaTypeUtils.normalizeTypeName(methodParamType);
                if (!paramTypeNames.get(i).equals(methodParamType))
                {
                    return false;
                }
            }
        }

        String psiMethodReturnTypeName = method.isConstructor() ? "void" : jvmText(method.getReturnType());

        if (!returnTypeName.equals(psiMethodReturnTypeName))
        {
            psiMethodReturnTypeName = JavaTypeUtils.normalizeTypeName(psiMethodReturnTypeName);
        }
        return returnTypeName.equals(psiMethodReturnTypeName);
    }