SimplifyStreamApiCallChainsInspection: remove support of user-defined collections as it could be incorrect (IDEA-CR-17005)

This commit is contained in:
Tagir Valeev
2017-01-17 15:45:04 +07:00
parent fbc56a607c
commit 97bf215035
10 changed files with 13 additions and 184 deletions
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "true"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
super(coll);
}
}
public static void test(List<String> s) {
new MyType(s).contains("abc");
}
}
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "true"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
this.addAll(coll);
}
}
public static void test(List<String> s) {
new MyType(s).contains("abc");
}
}
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "true"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType<A,B> extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
super(coll);
}
}
public static void testMy(List<String> s) {
new MyType<String, Number>(s).contains("abc");
}
}
@@ -1,14 +0,0 @@
// "Replace with 'Test.MyType' constructor" "false"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
}
public static void test(List<String> s) {
s.str<caret>eam().collect(Collectors.toCollection(MyType::new)).contains("abc");
}
}
@@ -1,4 +1,4 @@
// "Replace with 'Test.MyType' constructor" "true"
// "Replace with 'Test.MyType' constructor" "false"
import java.util.*;
import java.util.stream.*;
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "true"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
this.addAll(coll);
}
}
public static void test(List<String> s) {
s.str<caret>eam().collect(Collectors.toCollection(MyType::new)).contains("abc");
}
}
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "false"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
public MyType() {}
private MyType(Collection<String> coll) {
super(coll);
}
}
public static void test(List<String> s) {
s.str<caret>eam().collect(Collectors.toCollection(MyType::new)).contains("abc");
}
}
@@ -1,17 +0,0 @@
// "Replace with 'Test.MyType' constructor" "false"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
}
}
public static void test(List<String> s) {
s.str<caret>eam().collect(Collectors.toCollection(MyType::new)).contains("abc");
}
}
@@ -1,18 +0,0 @@
// "Replace with 'Test.MyType' constructor" "true"
import java.util.*;
import java.util.stream.*;
class Test {
static class MyType<A,B> extends ArrayList<String> {
public MyType() {}
public MyType(Collection<String> coll) {
super(coll);
}
}
public static void testMy(List<String> s) {
s.stream().collect(Collectors.toCollection(MyType<caret><String, Number>::new)).contains("abc");
}
}