ReplaceInefficientStreamCountInspection: remove generic parameter list if any

This commit is contained in:
Tagir Valeev
2016-11-22 12:31:24 +07:00
parent ec864dc55a
commit 492d6ad737
3 changed files with 27 additions and 0 deletions
@@ -0,0 +1,12 @@
// "Replace Collection.stream().count() with Collection.size()" "true"
import java.util.ArrayList;
import java.util.List;
public class Main {
public static long test() {
List<String> s = new ArrayList<>();
/* unused parameter */
return (long) s.size();
}
}
@@ -0,0 +1,11 @@
// "Replace Collection.stream().count() with Collection.size()" "true"
import java.util.ArrayList;
import java.util.List;
public class Main {
public static long test() {
List<String> s = new ArrayList<>();
return s.</* unused parameter */String>stream().co<caret>unt();
}
}