Java: Recognize multiple parametrized duplicates when extracting a method (IDEA-188243)

This commit is contained in:
Pavel Dolgov
2018-05-10 12:59:45 +03:00
parent 192532ab7d
commit 1f0ed3d0ea
27 changed files with 501 additions and 99 deletions
@@ -0,0 +1,24 @@
class DeclaredOutputVariable {
void foo(String[] a, int j) {
<selection>
String s = a[j];
if (s == null) return;
System.out.println(s.charAt(1) + "X");
</selection>
System.out.println(s.length());
}
void bar(String[] a, int k) {
String s = a[k];
if (s == null) return;
System.out.println(s.charAt(2) + "Y");
System.out.println(s.length());
}
void bar(String[] a, int n) {
String s = a[n];
if (s == null) return;
System.out.println(s.charAt(1) + "Z");
System.out.println(s.length());
}
}