Filter out methods without return type to fix EA-73795

This commit is contained in:
Alexander Udalov
2016-01-27 22:34:13 +03:00
parent 7e17482698
commit b946d725d7
2 changed files with 2 additions and 6 deletions
@@ -101,7 +101,8 @@ public class JavaClassImpl extends JavaClassifierImpl<PsiClass> implements JavaC
return methods(ArraysKt.filter(getPsi().getMethods(), new Function1<PsiMethod, Boolean>() {
@Override
public Boolean invoke(PsiMethod method) {
return !method.isConstructor();
// Return type seems to be null for example for the 'clone' Groovy method generated by @AutoClone (see EA-73795)
return !method.isConstructor() && method.getReturnType() != null;
}
}));
}
@@ -167,11 +167,6 @@ public class JavaElementCollectionFromPsiArrayUtil {
});
}
@NotNull
public static Collection<JavaMethod> methods(@NotNull PsiMethod[] methods) {
return convert(methods, Factories.METHODS);
}
@NotNull
public static Collection<JavaMethod> methods(@NotNull Iterable<PsiMethod> methods) {
return convert(methods, Factories.METHODS);