extract method: allow to fold parameters if calls to fields are involved

This commit is contained in:
Anna Kozlova
2014-12-08 16:19:28 +01:00
parent 5ba2b4b384
commit 5a5ed0fe42
4 changed files with 28 additions and 1 deletions
@@ -0,0 +1,10 @@
class Main {
private String [] args;
void foo(Main m, int i) {
<selection>if (m.args[i] != null) {
System.out.println(m.args[i]);
}</selection>
}
}
@@ -0,0 +1,14 @@
class Main {
private String [] args;
void foo(Main m, int i) {
newMethod(m.args[i]);
}
private void newMethod(String arg) {
if (arg != null) {
System.out.println(arg);
}
}
}