mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
move StreamApiMigrationInspection to separate package, extract inner classes, add "suggest foreach" option, restore comments in anyMatch/findFirst/etc., fix trivial replacements with anyMatch/findFirst
This commit is contained in:
+1
@@ -4,6 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
boolean find(String[][] data) {
|
||||
// Comment
|
||||
return Arrays.stream(data).flatMap(Arrays::stream).allMatch(str -> str.startsWith("xyz"));
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -5,6 +5,9 @@ import java.util.List;
|
||||
|
||||
public class Main {
|
||||
public static String find(List<List<String>> list) {
|
||||
/*
|
||||
Block comment
|
||||
*/
|
||||
return list.stream().flatMap(Collection::stream).filter(string -> string.startsWith("ABC")).findFirst().map(string -> string.substring(3)).orElse("");
|
||||
}
|
||||
}
|
||||
+1
@@ -7,6 +7,7 @@ import java.util.Objects;
|
||||
public class Main {
|
||||
public void testMap(Map<String, List<String>> map) throws Exception {
|
||||
int firstSize = map.values().stream().filter(Objects::nonNull).findFirst().map(List::size).orElse(0);
|
||||
// comment
|
||||
System.out.println(firstSize);
|
||||
}
|
||||
}
|
||||
+1
@@ -5,6 +5,7 @@ public class Main {
|
||||
for(String[] arr : da<caret>ta) {
|
||||
for(String str : arr) {
|
||||
if(!str.startsWith("xyz")) {
|
||||
// Comment
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -8,6 +8,9 @@ public class Main {
|
||||
for(String string : innerList) {
|
||||
if(string.startsWith("ABC")) {
|
||||
return string.substring(3);
|
||||
/*
|
||||
Block comment
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ public class Main {
|
||||
for(List<String> list : map.valu<caret>es()) {
|
||||
if(list != null) {
|
||||
firstSize = list.size();
|
||||
// comment
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user