Java: Fixed extracting method from duplicates containing reused variables (IDEA-188894)

This commit is contained in:
Pavel Dolgov
2018-03-28 12:33:31 +03:00
parent ff674e7b47
commit e4b477fc6e
7 changed files with 257 additions and 12 deletions
@@ -0,0 +1,19 @@
import java.util.List;
class DeclaredOutputVariable {
void foo(List<String> a) {
<selection>
String s = a.get(1);
if (s == null) return;
System.out.println(s.charAt(1));
</selection>
System.out.println(s.length());
}
void bar(List<String> a) {
String s = a.get(2);
if (s == null) return;
System.out.println(s.charAt(2));
System.out.println(s.length());
}
}