Java: Prevent introducing parameter that contains subexpression replaced by another parameter (IDEA-180801)

This commit is contained in:
Pavel Dolgov
2017-10-27 15:22:39 +03:00
parent 4b3e26fb2f
commit 550f61fa53
5 changed files with 74 additions and 3 deletions
@@ -0,0 +1,13 @@
class C {
public void foo(C c, long d, int i, String s) {
<selection>b(s, 1).m(d, i())</selection>;
b(s, i).m(d, k(d));
c.m(d, i);
}
private C b(String s, int i) { return new C(); }
void m(long d, int i) { }
private int i() { return 0; }
private int k(long d) { return 0; }
}