mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Stream API Migration: do not add type arguments if a type is a wildcard type
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
class A {
|
||||
public List<? super Integer> sum() {
|
||||
List<? super Integer> result = IntStream.range(0, 10).mapToObj(i -> i * 2).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
public List<? super Integer> sum() {
|
||||
List<? super Integer> result = new ArrayList<>();
|
||||
for(i<caret>nt i=0; i<10; i++) {
|
||||
result.add(i*2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user