From 292bf4f85c0cb0ea55ef61e148402c9ef7a92712 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 10 Apr 2017 13:33:13 +0300 Subject: [PATCH] IDEA-169244 Evaluate expression inside of local class fails when anonymous class is used - fixed tests --- .../ExtractMethodObject4DebuggerTest.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodObject4DebuggerTest.java b/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodObject4DebuggerTest.java index 4150827856dc..a528d18f38c7 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodObject4DebuggerTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodObject4DebuggerTest.java @@ -60,7 +60,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testSimpleGeneration() throws Exception { doTest("int i = 0; int j = 0;", "Test test = new Test().invoke();int i = test.getI();int j = test.getJ();", - "public static class Test {\n" + + "static class Test {\n" + " private int i;\n" + " private int j;\n" + "\n" + @@ -83,7 +83,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testInvokeReturnType() throws Exception { doTest("x = 6; y = 6;", "Test test = new Test().invoke();x = test.getX();y = test.getY();", - "public static class Test {\n" + + "static class Test {\n" + " private int x;\n" + " private int y;\n" + "\n" + @@ -106,8 +106,8 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testAnonymousClassParams() throws Exception { doTest("new I() {public void foo(int i) {i++;}};", "I result = Test.invoke();", - "public static class Test {\n" + - " public static I invoke() {\n" + + "static class Test {\n" + + " static I invoke() {\n" + " return new I() {\n" + " public void foo(int i) {\n" + " i++;\n" + @@ -120,7 +120,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testInnerClass() throws Exception { doTest(" new I(2).foo()", "new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public void invoke() {\n" + " new Sample.I(2).foo();\n" + " }\n" + @@ -130,7 +130,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testResultExpr() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" + @@ -140,7 +140,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testResultStatements() throws Exception { doTest("int i = 0;\nfoo()", "Test test = new Test().invoke();int i = test.getI();int result = test.getResult();", - "public class Test {\n" + + "class Test {\n" + " private int i;\n" + " private int result;\n" + "\n" + @@ -164,7 +164,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOffsetsAtCallSite() throws Exception { doTest("map.entrySet().stream().filter((a) -> (a.getKey()>0));", "Stream> result = new Test(map).invoke();", - "public static class Test {\n" + + "static class Test {\n" + " private Map map;\n" + "\n" + " public Test(Map map) {\n" + @@ -178,8 +178,8 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { } public void testHangingFunctionalExpressions() throws Exception { - doTest("() -> {}", "Test.invoke();", "public static class Test {\n" + - " public static void invoke() {\n" + + doTest("() -> {}", "Test.invoke();", "static class Test {\n" + + " static void invoke() {\n" + " () -> {\n" + " };\n" + " }\n" + @@ -189,8 +189,8 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testArrayInitializer() throws Exception { doTest("{new Runnable() {public void run(){} } }", "Runnable[] result = Test.invoke();", - "public static class Test {\n" + - " public static Runnable[] invoke() {\n" + + "static class Test {\n" + + " static Runnable[] invoke() {\n" + " return new Runnable[]{new Runnable() {\n" + " public void run() {\n" + " }\n" + @@ -202,8 +202,8 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testNewArrayInitializer() throws Exception { doTest("new Runnable[] {new Runnable() {public void run(){} } }", "Runnable[] result = Test.invoke();", - "public static class Test {\n" + - " public static Runnable[] invoke() {\n" + + "static class Test {\n" + + " static Runnable[] invoke() {\n" + " return new Runnable[]{new Runnable() {\n" + " public void run() {\n" + " }\n" + @@ -227,7 +227,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { " foo();\n" + " });", "new Test(list).invoke();", - "public class Test {\n" + + "class Test {\n" + " private List list;\n" + "\n" + " public Test(List list) {\n" + @@ -256,7 +256,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnClosingBrace() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" + @@ -266,7 +266,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnClosingBraceLocalClass() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" + @@ -276,7 +276,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnFieldInitialization() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" + @@ -286,8 +286,8 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnEmptyMethod() throws Exception { doTest(" foo()", "int result = Test.invoke();", - "public static class Test {\n" + - " public static int invoke() {\n" + + "static class Test {\n" + + " static int invoke() {\n" + " return foo();\n" + " }\n" + " }"); @@ -296,7 +296,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnSuperConstructorCall() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" + @@ -306,7 +306,7 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase { public void testOnPrivateField() throws Exception { doTest(" foo()", "int result = new Test().invoke();", - "public class Test {\n" + + "class Test {\n" + " public int invoke() {\n" + " return foo();\n" + " }\n" +