PsiMethod (PsiManager manager, String externalName) { final int spaceIdx = externalName.indexOf(' '); final String className = externalName.substring(0, spaceIdx); final PsiClass psiClass = ClassUtil.findPsiClass(manager, className); if (psiClass == null) return null; try { PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject()); String methodSignature = externalName.substring(spaceIdx + 1); MethodSignature patternSignature = factory.createMethodFromText(methodSignature, psiClass).getSignature(PsiSubstitutor.EMPTY); return ContainerUtil.find(psiClass.findMethodsByName(patternSignature.getName(), false), m -> { MethodSignature s = m.getSignature(PsiSubstitutor.EMPTY); MethodSignature refinedPatternSignature = factory.createMethodFromText(methodSignature, m).getSignature(s.getSubstitutor()); return MethodSignatureUtil.areErasedParametersEqual(s, refinedPatternSignature); }); } catch (IncorrectOperationException e) { // Do nothing. Returning null is acceptable in this case. return null; } }