mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
IDEA-167588 Uncompilable code after conversion Stream -> Loop with unknown Stream sources
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -21,4 +22,17 @@ public class Test {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long counter(Class<? extends Array> list) {
|
||||
long count = 0L;
|
||||
for (Iterator<? extends Array> it = stream(list).iterator(); it.hasNext(); ) {
|
||||
Array array = it.next();
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public <E> Stream<E> stream(Class<E> clazz) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -13,4 +14,12 @@ public class Test {
|
||||
List<String> list = new Test().names().map(String::trim).filter(n -> !n.isEmpty())
|
||||
.<caret>collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private long counter(Class<? extends Array> list) {
|
||||
return stream(list).count();
|
||||
}
|
||||
|
||||
public <E> Stream<E> stream(Class<E> clazz) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user