mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-180862 'Wrap using Collections.singletonList' intention doesn't work with subtypes of return type
Also anonymous classes supported
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Wrap using 'Collections.singletonList()'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void m() {
|
||||
List<Object> list = Collections.singletonList(new Object() {
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Wrap using 'Collections.singletonList()'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void m(String s) {
|
||||
List<CharSequence> list = Collections.singletonList(s);
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Wrap using 'Collections.singletonList()'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void m() {
|
||||
List<Object> list = new Obj<caret>ect() {};
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Wrap using 'Collections.singletonList()'" "false"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void m(CharSequence s) {
|
||||
List<String> list = <caret>s;
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Wrap using 'Collections.singletonList()'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void m(String s) {
|
||||
List<CharSequence> list = <caret>s;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user