Fix EA-68149 which happened on editing Scala sources
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user