mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
MigrateToStreamFix: explicit formatting removed (as formatted anyways automatically)
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class Main {
|
||||
List<String> test(Map<String, List<String>> map, int limit) {
|
||||
List<String> list = map.entrySet().stream().filter(entry -> entry.getValue() != null).filter(entry -> entry.getValue().stream().anyMatch(str -> str.contains("foo"))).limit(limit).map(Map.Entry::getKey).collect(Collectors.toList());
|
||||
List<String> list = map.entrySet().stream().filter(entry -> entry.getValue() != null).filter(entry -> entry.getValue().stream().anyMatch(str -> str.contains("foo"))).limit(limit).map(Map.Entry::getKey).collect(Collectors.toList());
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class Main {
|
||||
List<String> test(Map<String, List<String>> map, int limit) {
|
||||
List<String> list = map.entrySet().stream().filter(entry -> entry.getValue() != null).flatMap(entry -> entry.getValue().stream()).filter(str -> str.contains("foo")).limit(limit).collect(Collectors.toList());
|
||||
List<String> list = map.entrySet().stream().filter(entry -> entry.getValue() != null).flatMap(entry -> entry.getValue().stream()).filter(str -> str.contains("foo")).limit(limit).collect(Collectors.toList());
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
public long test(String[] array) {
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(100).count();
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(100).count();
|
||||
return longStrings;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
public long test(String[] array, long limit) {
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(limit + 1).count();
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(limit + 1).count();
|
||||
return longStrings;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
public long test(String[] array) {
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(102).count();
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(102).count();
|
||||
return longStrings;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
public long test(String[] array) {
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(100).count();
|
||||
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(100).count();
|
||||
return longStrings;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ import java.util.stream.Collectors;
|
||||
public class Test {
|
||||
public List<String> test(String[] data) {
|
||||
int top = Math.min(10, data.length);
|
||||
List<String> result = Arrays.stream(data).limit(10).map(String::trim).filter(item -> !item.isEmpty()).collect(Collectors.toList());
|
||||
List<String> result = Arrays.stream(data).limit(10).map(String::trim).filter(item -> !item.isEmpty()).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user