mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
migration to stream api: disable for raw types (IDEA-140095)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// "Replace with forEach" "false"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors
|
||||
|
||||
class A {
|
||||
public static <T> List<T> toTypedList1(Collection collection, Class<T> aClass) {
|
||||
if (collection.size() == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<T> result = new ArrayList<>(collection.size());
|
||||
|
||||
for (Object obj : coll<caret>ection) {
|
||||
result.add(aClass.cast(obj));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user