mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
[java-intentions] ConvertSwitchToIfIntention: fix brace handling
Fixes EA-795482 - IOE: JavaParserUtil.parseFragment GitOrigin-RevId: 63fe89da84e4432fab8f8f191c139add97553640
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e947f7b9a8
commit
2b2d79fb6a
@@ -0,0 +1,12 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x == 1) {
|
||||
{
|
||||
System.out.println("hello");
|
||||
}
|
||||
} else if (x == 2) {
|
||||
System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x == 1) {
|
||||
{
|
||||
System.out.println("hello");
|
||||
}
|
||||
} else if (x == 2) {
|
||||
System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x == 1) {
|
||||
System.out.println("");
|
||||
} else if (x == 2) {
|
||||
System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
<caret>switch (x) {
|
||||
case 1 -> {{
|
||||
System.out.println("hello");
|
||||
}}
|
||||
case 2 -> System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
<caret>switch (x) {
|
||||
case 1 -> {
|
||||
{
|
||||
System.out.println("hello");
|
||||
}}
|
||||
case 2 -> System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace 'switch' with 'if'" "true-preview"
|
||||
class X {
|
||||
void test(int x) {
|
||||
<caret>switch (x) {
|
||||
case 1 -> { System.out.println("");}
|
||||
case 2 -> System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user