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.]+\\.");
|
||||
|
||||
@Override
|
||||
protected String getQualifiedName(Editor editor, List<PsiElement> elements) {
|
||||
String qualifiedName = super.getQualifiedName(editor, elements);
|
||||
if (qualifiedName == null) {
|
||||
return null;
|
||||
}
|
||||
int i = qualifiedName.indexOf("(");
|
||||
if (i > 0) {
|
||||
return QUALIFIED_PATTERN.matcher(qualifiedName).replaceAll("").replace('#', '.');
|
||||
|
||||
@@ -50,7 +50,11 @@ public class PsiClassUtils {
|
||||
@NotNull
|
||||
public static PsiClass[] fullNameToClass(@NotNull String className, @NotNull Project 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
|
||||
|
||||
@@ -78,7 +78,7 @@ class NewCallRefToPsiDoc {
|
||||
if (methodComment != null) {
|
||||
return methodComment;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} catch (Throwable ignored) {
|
||||
// ignored
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user