mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Iterables are converted to Stream using spliterator
This commit is contained in:
+5
-1
@@ -497,7 +497,11 @@ class PseudoLambdaReplaceTemplate {
|
||||
if (type instanceof PsiClassType) {
|
||||
final PsiClass resolved = ((PsiClassType)type).resolve();
|
||||
LOG.assertTrue(resolved != null && resolved.getQualifiedName() != null, type);
|
||||
return collectionExpression.getText() + ".stream()";
|
||||
if (InheritanceUtil.isInheritor(resolved, CommonClassNames.JAVA_UTIL_COLLECTION)) {
|
||||
return collectionExpression.getText() + ".stream()";
|
||||
} else {
|
||||
return "java.util.stream.StreamSupport.stream(" + collectionExpression.getText() + ".spliterator(), false)";
|
||||
}
|
||||
}
|
||||
else if (type instanceof PsiArrayType) {
|
||||
return CommonClassNames.JAVA_UTIL_ARRAYS + ".stream(" + collectionExpression.getText() + ")";
|
||||
|
||||
Reference in New Issue
Block a user