Fix EA-68149 which happened on editing Scala sources

This commit is contained in:
Alexander Udalov
2015-09-09 14:37:26 +03:00
parent 017db3d36c
commit fb31980c0b
2 changed files with 9 additions and 2 deletions
@@ -122,7 +122,14 @@ public class JavaClassImpl extends JavaClassifierImpl<PsiClass> implements JavaC
@Override
@NotNull
public Collection<JavaConstructor> getConstructors() {
return constructors(getPsi().getConstructors());
return constructors(KotlinPackage.filter(getPsi().getConstructors(), new Function1<PsiMethod, Boolean>() {
@Override
public Boolean invoke(PsiMethod method) {
// See for example org.jetbrains.plugins.scala.lang.psi.light.ScFunctionWrapper,
// which is present in getConstructors(), but its isConstructor() returns false
return method.isConstructor();
}
}));
}
@Override
@@ -178,7 +178,7 @@ public class JavaElementCollectionFromPsiArrayUtil {
}
@NotNull
public static Collection<JavaConstructor> constructors(@NotNull PsiMethod[] methods) {
public static Collection<JavaConstructor> constructors(@NotNull Iterable<PsiMethod> methods) {
return convert(methods, Factories.CONSTRUCTORS);
}