mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Java: When generating return statement where the returned type is an array use raw type in array creation (IDEA-163341)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
List<T>[] f(T a, T b) {
|
||||
List<List<T>> list = Arrays.asList(Collections.singletonList(a), Collections.singletonList(b));
|
||||
return list.toArray(new List[0]);
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
List<T>[] f() {
|
||||
return new List[0];
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
Object[] f() {
|
||||
List<T> list = new ArrayList<>();
|
||||
return list.toArray();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
List<T>[] f(T a, T b) {
|
||||
List<List<T>> list = Arrays.asList(Collections.singletonList(a), Collections.singletonList(b));
|
||||
<caret>}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
List<T>[] f() {
|
||||
<caret>}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add 'return' statement" "true"
|
||||
import java.util.*;
|
||||
class A<T> {
|
||||
Object[] f() {
|
||||
List<T> list = new ArrayList<>();
|
||||
<caret>}
|
||||
}
|
||||
Reference in New Issue
Block a user