mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract method object: do not make static when already static (IDEA-98290)
This commit is contained in:
+12
@@ -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);
|
||||
}
|
||||
}
|
||||
+24
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user