mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
IDEA-178434 "Unwrap 'if' statement" produces incompilable code if variable declared in the if body shadows the outer scope variable
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Unwrap 'if' statement" "true"
|
||||
class X {
|
||||
StringBuilder str = new StringBuilder();
|
||||
|
||||
void test(@org.jetbrains.annotations.NotNull String x) {
|
||||
<caret>{
|
||||
String str = x.trim();
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
str.append("foo");
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Unwrap 'if' statement" "true"
|
||||
class X {
|
||||
StringBuilder str = new StringBuilder();
|
||||
|
||||
void test(@org.jetbrains.annotations.NotNull String x) {
|
||||
if(x != <caret>null) {
|
||||
String str = x.trim();
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
str.append("foo");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user