PsiElement (@NotNull String fqn, @NotNull Project project) { final PsiPackage psiPackage = JavaPsiFacade.getInstance(project).findPackage(fqn); if (psiPackage != null) { return psiPackage; } PsiClass aClass = JavaPsiFacade.getInstance(project).findClass(fqn, GlobalSearchScope.allScope(project)); if (aClass != null) { return aClass; } final int endIndex = fqn.indexOf('#'); if (endIndex != -1) { String className = fqn.substring(0, endIndex); int paramIndex = fqn.indexOf('(', endIndex); aClass = JavaPsiFacade.getInstance(project).findClass(className, GlobalSearchScope.allScope(project)); if (aClass != null) { String memberName = fqn.substring(endIndex + 1, paramIndex < 0 ? fqn.length() : paramIndex); PsiField field = aClass.findFieldByName(memberName, false); if (field != null) { return field; } String paramString = paramIndex < 0 ? "" : fqn.substring(paramIndex); for (PsiMethod overload : aClass.findMethodsByName(memberName, false)) { if (StringUtil.isEmpty(paramString) || paramString.equals(getParameterString(overload))) { return overload; } } } } VirtualFile file = findFile(fqn, project); if (file != null) { return PsiManager.getInstance(project).findFile(file); } return null; }