mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 19:58:23 +07:00
[java-inspections] CodeBlockSurrounder and StatementExtractor: support templates
GitOrigin-RevId: 3a998d7117ef6e94a7727a3f37d110905cc0c1bf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7241647518
commit
0d63633751
@@ -140,8 +140,8 @@ public class Main {
|
||||
private static List<String> testMethodRef2(List<String[]> list) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String[] strings : list) {
|
||||
for (String t : strings) {
|
||||
result.add(t);
|
||||
for (String value : strings) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace Stream API chain with loop" "true-preview"
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public final class TemplateTest {
|
||||
void test() {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for (Integer i : Arrays.asList(1, 2, 3)) {
|
||||
list.add(i);
|
||||
}
|
||||
System.out.println(STR."\{list}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace Stream API chain with loop" "true-preview"
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public final class TemplateTest {
|
||||
void test() {
|
||||
System.out.println(STR."\{Stream.of(1,2,3).<caret>collect(Collectors.toList())}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user