catch some Error fixed #11
This commit is contained in:
@@ -23,8 +23,12 @@ public class CopyReferenceSimple extends CopyReferenceAction {
|
|||||||
|
|
||||||
private static final Pattern QUALIFIED_PATTERN = Pattern.compile("[\\w.]+\\.");
|
private static final Pattern QUALIFIED_PATTERN = Pattern.compile("[\\w.]+\\.");
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getQualifiedName(Editor editor, List<PsiElement> elements) {
|
protected String getQualifiedName(Editor editor, List<PsiElement> elements) {
|
||||||
String qualifiedName = super.getQualifiedName(editor, elements);
|
String qualifiedName = super.getQualifiedName(editor, elements);
|
||||||
|
if (qualifiedName == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
int i = qualifiedName.indexOf("(");
|
int i = qualifiedName.indexOf("(");
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return QUALIFIED_PATTERN.matcher(qualifiedName).replaceAll("").replace('#', '.');
|
return QUALIFIED_PATTERN.matcher(qualifiedName).replaceAll("").replace('#', '.');
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ public class PsiClassUtils {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static PsiClass[] fullNameToClass(@NotNull String className, @NotNull Project project) {
|
public static PsiClass[] fullNameToClass(@NotNull String className, @NotNull Project project) {
|
||||||
JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
|
JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
|
||||||
return javaPsiFacade.findClasses(className, GlobalSearchScope.allScope(project));
|
try {
|
||||||
|
return javaPsiFacade.findClasses(className, GlobalSearchScope.allScope(project));
|
||||||
|
} catch (Throwable e) {
|
||||||
|
return PsiClass.EMPTY_ARRAY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class NewCallRefToPsiDoc {
|
|||||||
if (methodComment != null) {
|
if (methodComment != null) {
|
||||||
return methodComment;
|
return methodComment;
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Throwable ignored) {
|
||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user