mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
SimplifyStreamApiCallChainsInspection: remove support of user-defined collections as it could be incorrect (IDEA-CR-17005)
This commit is contained in:
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
-14
@@ -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
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with 'Test.MyType' constructor" "true"
|
||||
// "Replace with 'Test.MyType' constructor" "false"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
||||
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
-17
@@ -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");
|
||||
}
|
||||
}
|
||||
-18
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user