mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
FoldExpressionIntoStream: support String.join-able patterns (IDEA-190570)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
// "Fold expression into Stream chain" "true"
|
||||
class Test {
|
||||
void test2(Integer a, Integer b, Integer c, Integer d) {
|
||||
String result = Stream.of(a, b, c, d).map(String::valueOf).collect(Collectors.joining(",")) + ",";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Fold expression into 'String.join'" "true"
|
||||
class Test {
|
||||
void test(String a, String b, String c, String d) {
|
||||
String result = String.join(",", a, b, c, d) + ",";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Fold expression into Stream chain" "true"
|
||||
class Test {
|
||||
void test2(Integer a, Integer b, Integer c, Integer d) {
|
||||
String result = a + "," + b + "," + c + "," <caret>+ d + ",";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Fold expression into 'String.join'" "true"
|
||||
class Test {
|
||||
void test(String a, String b, String c, String d) {
|
||||
String result = a + "," + b + "," + c + ","<caret> + d + ",";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user