[Java. Intention Actions] Fix invalid handling of statements with missing semicolon in Collapse into loop action

IDEA-357036

GitOrigin-RevId: 12972fe04b845c930f7aed33cdcd324d64d6c0c4
This commit is contained in:
Georgii Ustinov
2024-10-23 13:26:09 +03:00
committed by intellij-monorepo-bot
parent dec45327f8
commit 29caccb845
5 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
// "Collapse into loop" "true-preview"
class A {
String getPath() {
Integer i = 0;
for (int j = 1; j < 4; j++) {
i = j;
}
i = ;
return i.toString()
}
}

View File

@@ -0,0 +1,7 @@
// "Collapse into loop" "false"
class A {
String getPath() {
<caret>return "strange text getFixtureTestDataFolder() {
return "/foo/bar";
}
}

View File

@@ -0,0 +1,11 @@
// "Collapse into loop" "true-preview"
class A {
String getPath() {
Integer i = 0;
<caret>i = 1;
i = 2;
i = 3;
i = ;
return i.toString()
}
}

View File

@@ -0,0 +1,7 @@
// "Collapse into loop" "false"
class A {
String getPath() {
<selection>return "strange text getFixtureTestDataFolder() {
return "/foo/bar";</selection>
}
}