Java: When generating return statement where the returned type is a primitive array don't suggest Collection.toArray() (IDEA-163341)

This commit is contained in:
Pavel Dolgov
2017-01-11 12:33:51 +03:00
parent fa68de288b
commit af46d7d411
5 changed files with 40 additions and 5 deletions
@@ -0,0 +1,9 @@
// "Add 'return' statement" "true"
import java.util.*;
class T {
String[] f() {
List<String> list = Arrays.asList("a", "b");
String[] arr = {"c", "d"};
return arr;
}
}
@@ -0,0 +1,9 @@
// "Add 'return' statement" "true"
import java.util.*;
class T {
int[] f() {
Set<Integer> set = new HashSet<>();
set.add(42);
return new int[0];
}
}
@@ -0,0 +1,8 @@
// "Add 'return' statement" "true"
import java.util.*;
class T {
String[] f() {
List<String> list = Arrays.asList("a", "b");
String[] arr = {"c", "d"};
<caret>}
}
@@ -0,0 +1,8 @@
// "Add 'return' statement" "true"
import java.util.*;
class T {
int[] f() {
Set<Integer> set = new HashSet<>();
set.add(42);
<caret>}
}