extract light method object: filter inaccessible variables

This commit is contained in:
Anna Kozlova
2014-09-09 15:51:39 +04:00
parent b8a3e8d1c6
commit 92518cf5c9
3 changed files with 40 additions and 3 deletions
@@ -0,0 +1,8 @@
interface I {
void foo(int i) {}
}
class Sample {
void foo() {
System.out.println("hello <caret>world");
}
}
@@ -98,6 +98,20 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase {
" }");
}
public void testAnonymousClassParams() throws Exception {
doTest("new I() {public void foo(int i) {i++;}};", "new Test().invoke();",
"public class Test {\n" +
" public void invoke() {\n" +
" new I() {\n" +
" public void foo(int i) {\n" +
" i++;\n" +
" }\n" +
" };\n" +
" }\n" +
" }");
}
@Override
protected Sdk getProjectJDK() {
return IdeaTestUtil.getMockJdk18();