mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-242422 ArrayIndexOutOfBoundsException in FunExprOccurrence
GitOrigin-RevId: d0b1b4e881c919d9e855f897452c371dd12f2a59
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1802cec4d9
commit
29ef77afd0
@@ -133,7 +133,7 @@ public class FunExprOccurrence {
|
||||
|
||||
private boolean isCompatible(ReferenceChainLink link, PsiMember member, List<? extends PsiClass> samClasses) {
|
||||
if (link.isCall) {
|
||||
return member instanceof PsiMethod && hasCompatibleParameter((PsiMethod)member, argIndex, samClasses);
|
||||
return member instanceof PsiMethod && argIndex >= 0 && hasCompatibleParameter((PsiMethod)member, argIndex, samClasses);
|
||||
}
|
||||
if (member instanceof PsiClass) {
|
||||
return samClasses.contains(member);
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
{
|
||||
bar() = () -> {};;
|
||||
}
|
||||
|
||||
I bar() {}
|
||||
|
||||
}
|
||||
|
||||
interface I {
|
||||
void run();
|
||||
}
|
||||
+6
@@ -252,6 +252,12 @@ public class FindFunctionalInterfaceTest extends LightJavaCodeInsightFixtureTest
|
||||
assertOneElement(FunctionalExpressionSearch.search(fooClasses[1]).findAll());
|
||||
}
|
||||
|
||||
public void testInvalidCode() {
|
||||
configure();
|
||||
// whatever, but it shouldn't throw
|
||||
assertEmpty(FunctionalExpressionSearch.search(findClass("I")).findAll());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/daemonCodeAnalyzer/lambda/findUsages/";
|
||||
|
||||
Reference in New Issue
Block a user