mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
surround with array fix: ensure result is free from generics array creation error (IDEA-166489; IDEA-166490)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// "Surround with array initialization" "true"
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
public List<?>[] test(List<Number> list) {
|
||||
return new List[]{list};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Surround with array initialization" "true"
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
public void test(List<?>[] t){}
|
||||
|
||||
void foo(List<Number> list) {
|
||||
test(new List[]{list});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Surround with array initialization" "true"
|
||||
class A<T> {
|
||||
|
||||
public Object[] test(T t) {
|
||||
return new Object[]{t};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Surround with array initialization" "true"
|
||||
class A<T> {
|
||||
|
||||
public void test(Object[] t) {
|
||||
}
|
||||
|
||||
void foo(T t){
|
||||
test(new Object[]{t});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Surround with array initialization" "true"
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
public List<?>[] test(List<Number> list) {
|
||||
return lis<caret>t;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Surround with array initialization" "true"
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
public void test(List<?>[] t){}
|
||||
|
||||
void foo(List<Number> list) {
|
||||
test(lis<caret>t);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Surround with array initialization" "true"
|
||||
class A<T> {
|
||||
|
||||
public Object[] test(T t) {
|
||||
return <caret>t;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Surround with array initialization" "false"
|
||||
class A<T> {
|
||||
|
||||
public T[] test(T t) {
|
||||
return <caret>t;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Surround with array initialization" "false"
|
||||
class A<T> {
|
||||
|
||||
public void test(T[] t) {
|
||||
}
|
||||
|
||||
void foo(T t){
|
||||
test(<caret>t);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Surround with array initialization" "true"
|
||||
class A<T> {
|
||||
|
||||
public void test(Object[] t) {
|
||||
}
|
||||
|
||||
void foo(T t){
|
||||
test(<caret>t);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user