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

This commit is contained in:
Pavel Dolgov
2017-11-22 15:41:07 +03:00
parent 336e80d215
commit d6e92c273f
10 changed files with 216 additions and 17 deletions
@@ -0,0 +1,21 @@
class DecrementDifferentInnerFieldsDuplicate {
class C {
int x;
int y;
}
private void foo(C a, C b) {
<selection>
if (a.x > 0) {
bar(a.x);
a.x--;
}</selection>
if (b.y > 0) {
bar(b.y);
b.y--;
}
}
private void bar(int i) { }
}