IDEA-163302 Suggest to use IntStream.boxed() if manually mapping to an Integer

This commit is contained in:
Tagir Valeev
2016-11-03 11:26:21 +07:00
parent 551d91c8f3
commit f04509a776
20 changed files with 311 additions and 25 deletions
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
public class Main {
public static void main(String[] args) {
List<Double> list = DoubleStream.of(1,2,3,4).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
public class Main {
public static void main(String[] args) {
List<Double> list = DoubleStream.of(1,2,3,4).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = IntStream.range(0, 100).boxed().collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).ma<caret>pToObj(x -> x).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
public class Main {
public static void main(String[] args) {
List<Double> list = DoubleStream.of(1,2,3,4).map<caret>ToObj((x) -> new Double(x)).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "false"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Double> list = LongStream.of(1,2,3,4).map<caret>ToObj((x) -> new Double(x)).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).<Long>ma<caret>pToObj((x) -> (x)).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
public class Main {
public static void main(String[] args) {
List<Double> list = DoubleStream.of(1,2,3,4).m<caret>apToObj((x) -> (Double.valueOf(x))).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).map<caret>ToObj(Long::new).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "false"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = LongStream.range(0, 100).map<caret>ToObj(Double::new).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "true"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = IntStream.range(0, 100).mapT<caret>oObj(Integer::valueOf).collect(Collectors.toList());
}
}
@@ -0,0 +1,11 @@
// "Replace with 'boxed'" "false"
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
List<Integer> list = IntStream.range(0, 100).mapT<caret>oObj(Long::valueOf).collect(Collectors.toList());
}
}