mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract method: fix name conflicts at method call site
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class X {
|
||||
@NotNull
|
||||
public X fun1(int x) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public X fun2(boolean b) {
|
||||
|
||||
X x1 = newMethod(b);
|
||||
if (x1 != null) return x1;
|
||||
|
||||
int x = 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private X newMethod(boolean b) {
|
||||
if (b) {
|
||||
int x = 1;
|
||||
return fun1(x);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
void foo(int i, int j) {
|
||||
bar(i, j);
|
||||
}
|
||||
|
||||
private void bar(int i, int j) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user