mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract light method object: filter inaccessible variables
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
interface I {
|
||||
void foo(int i) {}
|
||||
}
|
||||
class Sample {
|
||||
void foo() {
|
||||
System.out.println("hello <caret>world");
|
||||
}
|
||||
}
|
||||
+14
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user