IDEA-230363 Freeze in StreamApiMigrationInspection when StringBuilder-append-loop is followed by append to another StringBuilder

GitOrigin-RevId: c7bc72635a3322ecdd9eea6b47b997154a0ad014
This commit is contained in:
Tagir Valeev
2020-01-10 08:35:02 +00:00
committed by intellij-monorepo-bot
parent 2da39d524b
commit cca1cec121
3 changed files with 26 additions and 3 deletions
@@ -0,0 +1,11 @@
import java.util.stream.IntStream;
// "Replace with forEach" "true"
class X {
private void initBuilder() {
StringBuilder builder = new StringBuilder();
StringBuilder spaces = new StringBuilder();
IntStream.range(0, 20).mapToObj(i -> " ").forEach(spaces::append);
builder.append(spaces);
}
}
@@ -0,0 +1,11 @@
// "Replace with forEach" "true"
class X {
private void initBuilder() {
StringBuilder builder = new StringBuilder();
StringBuilder spaces = new StringBuilder();
f<caret>or(int i = 0; i < 20; i++) {
spaces.append(" ");
}
builder.append(spaces);
}
}