Java: Don't create parameters for effectively local variables in extracted fragment (IDEA-180864)

This commit is contained in:
Pavel Dolgov
2017-10-24 17:23:19 +03:00
parent 5fab484adf
commit f2eb220e2b
9 changed files with 188 additions and 14 deletions
@@ -0,0 +1,19 @@
public class EffectivelyLocalWithinExpression {
void foo() {
int n;
if (<selection>(n = z()) > 0 && n < 100</selection>) {
System.out.println();
}
}
void bar() {
int n;
if ((n = z()) > 1 && n < 100) {
System.out.println();
}
}
int z() {
return 1;
}
}