mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-78597 Refactoring introduce field introduce silly assignment
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public final ArrayList arrayList;
|
||||
|
||||
public Test()
|
||||
{
|
||||
arrayList = new ArrayList();
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public Test()
|
||||
{
|
||||
array<caret>List = new ArrayList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -71,6 +71,12 @@ public class IntroduceFieldInSameClassTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
public void testUnresolvedReferenceToLocalVar() throws Exception {
|
||||
configureByFile("/refactoring/introduceField/beforeUnresolvedReferenceToLocalVar.java");
|
||||
performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, false);
|
||||
checkResultByFile("/refactoring/introduceField/afterUnresolvedReferenceToLocalVar.java");
|
||||
}
|
||||
|
||||
private static void performRefactoring(final BaseExpressionToFieldHandler.InitializationPlace initializationPlace, final boolean declareStatic) {
|
||||
new MockIntroduceFieldHandler(initializationPlace, declareStatic).invoke(getProject(), myEditor, myFile, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user