WrapWithAdapterMethodCallFix: wrap with List.of() instead of Arrays.asList() on Java 9 and higher (IDEA-269380)

GitOrigin-RevId: f39f5c58348afb6b3c57dbc059860f940c6ec363
This commit is contained in:
Bas Leijdekkers
2021-05-19 10:44:07 +00:00
committed by intellij-monorepo-bot
parent 358da7cc4e
commit 223eeb0b0f
34 changed files with 121 additions and 77 deletions
@@ -0,0 +1,13 @@
// "Wrap 4th argument using 'List.of()'" "true"
import java.util.List;
public class Test {
void list(int i, int j, int k, List<String> l, String s) {
}
void m(String[] a) {
list(1, 2, 3, List.of(a), "asd");
}
}
@@ -0,0 +1,13 @@
// "Wrap argument using 'List.of()'" "true"
import java.util.List;
public class Test {
void list(List<String> l) {
}
void m(String[] a) {
list(List.of(a));
}
}
@@ -0,0 +1,13 @@
// "Wrap 4th argument using 'List.of()'" "true"
import java.util.List;
public class Test {
void list(int i, int j, int k, List<String> l, String s) {
}
void m(String[] a) {
list(1, 2, 3, a<caret>, "asd");
}
}
@@ -0,0 +1,13 @@
// "Wrap argument using 'List.of()'" "true"
import java.util.List;
public class Test {
void list(List<String> l) {
}
void m(String[] a) {
list(a<caret>);
}
}