extract class: allow to make nested (IDEA-144033)

This commit is contained in:
Anna Kozlova
2015-09-09 11:44:36 +03:00
parent 7484fa8599
commit 07ab234ff3
5 changed files with 114 additions and 10 deletions
@@ -0,0 +1,29 @@
class Test {
final Extracted extracted = new Extracted(this);
void bar(){
System.out.println(extracted.getMyT());
}
String foo() {
return "";
}
void bazz() {
bar();
}
public static class Extracted {
private final Test test;
String myT;
public String getMyT() {
return myT;
}
public Extracted(Test test) {
this.test = test;
this.myT = test.foo();
}
}
}
@@ -0,0 +1,15 @@
class Test {
String myT = foo();
void bar(){
System.out.println(myT);
}
String foo() {
return "";
}
void bazz() {
bar();
}
}