mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-87016 - assert: PsiParameterListImpl.getParameterIndex
This commit is contained in:
+1
-1
@@ -369,7 +369,7 @@ class InlineToAnonymousConstructorProcessor {
|
||||
@Override public void visitReferenceExpression(final PsiReferenceExpression expression) {
|
||||
super.visitReferenceExpression(expression);
|
||||
final PsiElement psiElement = expression.resolve();
|
||||
if (psiElement instanceof PsiParameter) {
|
||||
if (psiElement instanceof PsiParameter && ((PsiParameter)psiElement).getDeclarationScope() == myConstructor) {
|
||||
parameterReferences.add(Pair.create(expression, (PsiParameter)psiElement));
|
||||
}
|
||||
else if ((psiElement instanceof PsiField || psiElement instanceof PsiMethod) &&
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
class Test {
|
||||
class <caret>A implements Runnable {
|
||||
public A(int[] args) {
|
||||
|
||||
for (int arg : args) {
|
||||
System.out.println(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
abstract class U {
|
||||
{
|
||||
A a = new A(new int[8]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
class Test {
|
||||
|
||||
abstract class U {
|
||||
{
|
||||
final int[] args = new int[8];
|
||||
Runnable a = new Runnable() {
|
||||
{
|
||||
for (int arg : args) {
|
||||
System.out.println(arg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -49,6 +49,10 @@ public class InlineToAnonymousClassTest extends LightRefactoringTestCase {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
public void testUnrelatedParameters() throws Exception {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
public void testConstructorWithArgumentsInExpression() throws Exception {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user