Java: Don't introduce parameter for potentially matching fields if the fields are written (IDEA-182284)

This commit is contained in:
Pavel Dolgov
2017-11-21 16:47:40 +03:00
parent 5e4857b722
commit 5107176b3c
10 changed files with 134 additions and 27 deletions
@@ -0,0 +1,24 @@
import java.util.List;
class C {
List<String> x;
List<String> y;
private void foo() {
<selection>
if (x.isEmpty()) return;
x.remove(0);
y.add(str());
baz();</selection>
}
private void bar() {
if (y.isEmpty()) return;
y.remove(0);
x.add(str());
baz();
}
private void baz() { }
private String str() { return null; }
}