mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
introduced PsiPolyadicExpression
This commit is contained in:
@@ -639,18 +639,12 @@
|
||||
|
||||
<problem>
|
||||
<file>Foo.java</file>
|
||||
<line>73</line>
|
||||
|
||||
<line>72</line>
|
||||
|
||||
<description>Numeric overflow in expression</description>
|
||||
</problem>
|
||||
|
||||
|
||||
|
||||
<problem>
|
||||
<file>Foo.java</file>
|
||||
<line>73</line>
|
||||
|
||||
<description>Numeric overflow in expression</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ class c {
|
||||
l1 = LONG_MIN_VALUE / -1;
|
||||
|
||||
l1 = 30 * 24 * 60 * 60 * 1000;
|
||||
l1 = 30000000 * 243232323
|
||||
* (LONG_MAX_VALUE +3) / 5;
|
||||
l1 = 30000000 * 243232323 * (LONG_MAX_VALUE +3) / 5;
|
||||
|
||||
System.out.println(l1);
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
0: EMPTY
|
||||
1: READ file
|
||||
2: COND_GOTO [END] 9
|
||||
2: COND_GOTO [ELSE] 9
|
||||
3: READ b1
|
||||
4: COND_GOTO [ELSE] 9
|
||||
5: READ b2
|
||||
@@ -9,4 +9,4 @@
|
||||
8: GOTO [END] 10
|
||||
9: WRITE highlighter
|
||||
10: READ highlighter
|
||||
11: GOTO [END] 12 RETURN
|
||||
11: GOTO [END] 12 RETURN
|
||||
|
||||
@@ -24,19 +24,18 @@ PsiJavaFile:And0.java
|
||||
PsiReturnStatement
|
||||
PsiKeyword:return('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiBinaryExpression:a & b & c
|
||||
PsiBinaryExpression:a & b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:AND('&')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a & b & c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:AND('&')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:AND('&')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -48,4 +47,4 @@ PsiJavaFile:And0.java
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
|
||||
@@ -24,19 +24,18 @@ PsiJavaFile:CondAnd0.java
|
||||
PsiReturnStatement
|
||||
PsiKeyword:return('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiBinaryExpression:a && b && c
|
||||
PsiBinaryExpression:a && b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:ANDAND('&&')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a && b && c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:ANDAND('&&')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:ANDAND('&&')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -48,4 +47,4 @@ PsiJavaFile:CondAnd0.java
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
|
||||
@@ -24,19 +24,18 @@ PsiJavaFile:CondOr0.java
|
||||
PsiReturnStatement
|
||||
PsiKeyword:return('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiBinaryExpression:a || b || c
|
||||
PsiBinaryExpression:a || b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a || b || c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -48,4 +47,4 @@ PsiJavaFile:CondOr0.java
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
|
||||
@@ -24,19 +24,18 @@ PsiJavaFile:Or0.java
|
||||
PsiReturnStatement
|
||||
PsiKeyword:return('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiBinaryExpression:a | b | c
|
||||
PsiBinaryExpression:a | b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a | b | c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -48,4 +47,4 @@ PsiJavaFile:Or0.java
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
|
||||
@@ -24,19 +24,18 @@ PsiJavaFile:Xor0.java
|
||||
PsiReturnStatement
|
||||
PsiKeyword:return('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiBinaryExpression:a ^ b ^ c
|
||||
PsiBinaryExpression:a ^ b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:XOR('^')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a ^ b ^ c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:XOR('^')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:XOR('^')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -48,4 +47,4 @@ PsiJavaFile:Xor0.java
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
PsiJavaFile:CondOr0.java
|
||||
PsiBinaryExpression:a || b || c
|
||||
PsiBinaryExpression:a || b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a || b || c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OROR('||')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:c
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:c('c')
|
||||
PsiIdentifier:c('c')
|
||||
@@ -1,21 +1,20 @@
|
||||
PsiJavaFile:Or0.java
|
||||
PsiBinaryExpression:a | b | c
|
||||
PsiBinaryExpression:a | b
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiPolyadicExpression: a | b | c
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:OR('|')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:c
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:c('c')
|
||||
PsiIdentifier:c('c')
|
||||
@@ -10,8 +10,8 @@ import com.intellij.util.ThrowableRunnable;
|
||||
*/
|
||||
public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase{
|
||||
public void testHugeConcatenationVisitingPerformance() throws IncorrectOperationException {
|
||||
StringBuilder text = new StringBuilder("String s = \"xxx\"");
|
||||
final int N = 2;
|
||||
StringBuilder text = new StringBuilder("String s = null");
|
||||
final int N = 20000;
|
||||
for (int i = 0; i < N; i++) {
|
||||
text.append("+\"xxx\"");
|
||||
}
|
||||
@@ -19,26 +19,26 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase{
|
||||
final PsiElement expression =
|
||||
JavaPsiFacade.getInstance(getProject()).getElementFactory().createStatementFromText(text.toString(), null);
|
||||
final int[] n = {0};
|
||||
PlatformTestUtil.startPerformanceTest(getTestName(false), 20, new ThrowableRunnable() {
|
||||
PlatformTestUtil.startPerformanceTest(getTestName(false), 100, new ThrowableRunnable() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
n[0] = 0;
|
||||
expression.accept(new JavaRecursiveElementWalkingVisitor() {
|
||||
@Override
|
||||
public void visitBinaryExpression(final PsiBinaryExpression expression) {
|
||||
PsiExpression s = expression.getLOperand();
|
||||
super.visitBinaryExpression(expression);
|
||||
public void visitExpression(PsiExpression expression) {
|
||||
PsiExpression s = expression;
|
||||
super.visitExpression(expression);
|
||||
s.hashCode(); //hold on stack
|
||||
n[0]++;
|
||||
}
|
||||
});
|
||||
assertEquals(N, n[0]);
|
||||
assertEquals(N+2, n[0]);
|
||||
}
|
||||
}).cpuBound().assertTiming();
|
||||
}
|
||||
public void testHugeMethodChainingVisitingPerformance() throws IncorrectOperationException {
|
||||
StringBuilder text = new StringBuilder("Object s = new StringBuilder()");
|
||||
final int N = 1500;
|
||||
final int N = 20000;
|
||||
for (int i = 0; i < N; i++) {
|
||||
text.append(".append(\"xxx\")");
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase{
|
||||
final PsiElement expression =
|
||||
JavaPsiFacade.getInstance(getProject()).getElementFactory().createStatementFromText(text.toString(), null);
|
||||
final int[] n = {0};
|
||||
PlatformTestUtil.startPerformanceTest(getTestName(false), 100, new ThrowableRunnable() {
|
||||
PlatformTestUtil.startPerformanceTest(getTestName(false), 200, new ThrowableRunnable() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
n[0] = 0;
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.lang.java.parser.ExpressionParser;
|
||||
import com.intellij.lang.java.parser.JavaParsingTestCase;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
|
||||
public class ExpressionParserTest extends JavaParsingTestCase {
|
||||
@@ -115,7 +116,7 @@ public class ExpressionParserTest extends JavaParsingTestCase {
|
||||
public void testChainedClassObjectAccess() { doParserTest("A.class.B.class"); }
|
||||
public void testChainedThisObjectAccess() { doParserTest("A.this.B.this"); }
|
||||
|
||||
private void doParserTest(final String text) {
|
||||
private void doParserTest(@NonNls final String text) {
|
||||
doParserTest(text, new TestParser() {
|
||||
@Override
|
||||
public void parse(final PsiBuilder builder) {
|
||||
|
||||
@@ -15,16 +15,15 @@
|
||||
*/
|
||||
package com.intellij.psi;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
|
||||
|
||||
public class JavaSOEOnReparseTest extends LightCodeInsightTestCase {
|
||||
private static final String HUGE_EXPR;
|
||||
public class JavaSOEOnReparseTest extends LightDaemonAnalyzerTestCase {
|
||||
private static final StringBuilder HUGE_EXPR;
|
||||
static {
|
||||
final StringBuilder sb = new StringBuilder("\"-\"");
|
||||
for (int i = 0; i < 10000; i++) sb.append("+\"b\"");
|
||||
HUGE_EXPR = sb.toString();
|
||||
HUGE_EXPR = new StringBuilder("\"-\"");
|
||||
for (int i = 0; i < 100000; i++) HUGE_EXPR.append("+\"b\"");
|
||||
}
|
||||
|
||||
public void testOnHugeBinaryExprInFile() throws Exception {
|
||||
@@ -37,7 +36,7 @@ public class JavaSOEOnReparseTest extends LightCodeInsightTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private static void doTest() {
|
||||
private void doTest() {
|
||||
final int pos = getEditor().getDocument().getText().indexOf("\"\"");
|
||||
|
||||
// replace small expression with huge binary one
|
||||
@@ -45,23 +44,27 @@ public class JavaSOEOnReparseTest extends LightCodeInsightTestCase {
|
||||
getEditor().getDocument().replaceString(pos, pos + 2, HUGE_EXPR);
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
}});
|
||||
doTestConfiguredFile(false, false);
|
||||
|
||||
// modify huge binary expression (1)
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() {
|
||||
getEditor().getDocument().insertString(pos, "\".\"+");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
}});
|
||||
doTestConfiguredFile(false, false);
|
||||
|
||||
// modify huge binary expression (2)
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() {
|
||||
getEditor().getDocument().replaceString(pos, pos + 4, "");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
}});
|
||||
doTestConfiguredFile(false, false);
|
||||
|
||||
// replace huge binary expression with small one
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() {
|
||||
getEditor().getDocument().replaceString(pos, pos + HUGE_EXPR.length(), "\".\"");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
}});
|
||||
doTestConfiguredFile(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,13 @@ package com.intellij.refactoring;
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.CodeInsightUtil;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.util.Pass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiExpression;
|
||||
import com.intellij.psi.PsiLocalVariable;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.introduceField.ElementToWorkOn;
|
||||
import com.intellij.refactoring.introduceParameter.IntroduceParameterHandler;
|
||||
import com.intellij.refactoring.introduceParameter.IntroduceParameterProcessor;
|
||||
import com.intellij.refactoring.introduceParameter.Util;
|
||||
@@ -317,24 +319,25 @@ public class IntroduceParameterTest extends LightCodeInsightTestCase {
|
||||
final boolean removeUnusedParameters,
|
||||
final boolean generateDelegate,
|
||||
int enclosingLevel) {
|
||||
int startOffset = myEditor.getSelectionModel().getSelectionStart();
|
||||
int endOffset = myEditor.getSelectionModel().getSelectionEnd();
|
||||
final ElementToWorkOn[] elementToWorkOn = new ElementToWorkOn[1];
|
||||
ElementToWorkOn
|
||||
.processElementToWorkOn(myEditor, myFile, "INtr param", HelpID.INTRODUCE_PARAMETER, getProject(), new Pass<ElementToWorkOn>() {
|
||||
@Override
|
||||
public void pass(final ElementToWorkOn e) {
|
||||
if (e == null) return;
|
||||
|
||||
PsiExpression expr = CodeInsightUtil.findExpressionInRange(myFile, startOffset, endOffset);
|
||||
elementToWorkOn[0] = e;
|
||||
}
|
||||
});
|
||||
|
||||
PsiLocalVariable localVariable = null;
|
||||
if (expr == null) {
|
||||
PsiElement element = CodeInsightUtil.findElementInRange(myFile, startOffset, endOffset, PsiElement.class);
|
||||
localVariable = PsiTreeUtil.getParentOfType(element, PsiLocalVariable.class);
|
||||
if (localVariable == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
PsiElement context = expr == null ? localVariable : expr;
|
||||
final PsiExpression expr = elementToWorkOn[0].getExpression();
|
||||
final PsiLocalVariable localVar = elementToWorkOn[0].getLocalVariable();
|
||||
|
||||
PsiElement context = expr == null ? localVar : expr;
|
||||
PsiMethod method = Util.getContainingMethod(context);
|
||||
if (method == null) return false;
|
||||
|
||||
final List<PsiMethod> methods = IntroduceParameterHandler.getEnclosingMethods(method);
|
||||
final List<PsiMethod> methods = com.intellij.refactoring.introduceParameter.IntroduceParameterHandler.getEnclosingMethods(method);
|
||||
assertTrue(methods.size() > enclosingLevel);
|
||||
method = methods.get(enclosingLevel);
|
||||
|
||||
@@ -345,11 +348,11 @@ public class IntroduceParameterTest extends LightCodeInsightTestCase {
|
||||
else {
|
||||
methodToSearchFor = method;
|
||||
}
|
||||
PsiExpression[] occurences = null;
|
||||
PsiExpression[] occurences;
|
||||
PsiExpression initializer;
|
||||
if (expr == null) {
|
||||
initializer = localVariable.getInitializer();
|
||||
occurences = CodeInsightUtil.findReferenceExpressions(method, localVariable);
|
||||
initializer = localVar.getInitializer();
|
||||
occurences = CodeInsightUtil.findReferenceExpressions(method, localVar);
|
||||
}
|
||||
else {
|
||||
initializer = expr;
|
||||
@@ -357,7 +360,7 @@ public class IntroduceParameterTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
TIntArrayList parametersToRemove = removeUnusedParameters ? Util.findParametersToRemove(method, initializer, occurences) : new TIntArrayList();
|
||||
new IntroduceParameterProcessor(
|
||||
getProject(), method, methodToSearchFor, initializer, expr, localVariable, true, parameterName, replaceAllOccurences,
|
||||
getProject(), method, methodToSearchFor, initializer, expr, localVar, true, parameterName, replaceAllOccurences,
|
||||
replaceFieldsWithGetters,
|
||||
declareFinal, generateDelegate, null, parametersToRemove).run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user