mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-171094 Extract method object fails
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
public class RenameInInitializer {
|
||||
public static void main(String[] args) {
|
||||
<selection>int aValue = 100;
|
||||
int result = 1000;
|
||||
int a = IntStream.of(aValue, result).peek(x -> {}).sum();</selection>
|
||||
System.out.println(aValue + result + a);
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
public class RenameInInitializer {
|
||||
public static void main(String[] args) {
|
||||
Inner inner = new Inner().invoke();
|
||||
int aValue = inner.getValue();
|
||||
int result = inner.getResult();
|
||||
int a = inner.getA();
|
||||
System.out.println(aValue + result + a);
|
||||
}
|
||||
|
||||
private static class Inner {
|
||||
private int myValue;
|
||||
private int myResult;
|
||||
private int myA;
|
||||
|
||||
public int getValue() {
|
||||
return myValue;
|
||||
}
|
||||
|
||||
public int getResult() {
|
||||
return myResult;
|
||||
}
|
||||
|
||||
public int getA() {
|
||||
return myA;
|
||||
}
|
||||
|
||||
public Inner invoke() {
|
||||
myValue = 100;
|
||||
myResult = 1000;
|
||||
myA = IntStream.of(myValue, myResult).peek(x -> {
|
||||
}).sum();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user