extract method object: do not make static when already static (IDEA-98290)

This commit is contained in:
anna
2012-12-31 13:58:17 +01:00
parent e9070ccbc8
commit e47dc7accb
5 changed files with 43 additions and 2 deletions
@@ -0,0 +1,12 @@
class Bag {
Integer x;
Integer y;
}
class Foo {
public static void foo() {
Bag b = new Bag();
System.out.println(<selection>b</selection>.x);
System.out.println(b.x);
}
}
@@ -0,0 +1,24 @@
class Bag {
Integer x;
Integer y;
}
class Foo {
public static void foo() {
Bag b = new Bag();
System.out.println(new Inner(b).invoke().x);
System.out.println(new Inner(b).invoke().x);
}
private static class Inner {
private Bag b;
public Inner(Bag b) {
this.b = b;
}
public Bag invoke() {
return b;
}
}
}