mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
make type denotable: ensure that array type is not created over wildcard
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import java.util.function.IntFunction;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class MyTest {
|
||||
private static void getArguments(final Stream<Class<String>> classStream) {
|
||||
IntFunction<Class<?>[]> m = (value) -> new Class<?>[value];
|
||||
final Class<?>[] classes = classStream.toArray(m);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class MyTest {
|
||||
private static void getArguments(final Stream<Class<String>> classStream) {
|
||||
final Class<?>[] classes = classStream.toArray(<selection>(value) -> new Class<?>[value]</selection>);
|
||||
}
|
||||
}
|
||||
@@ -512,6 +512,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("m", false, false, false, "I<? extends I<?>>"));
|
||||
}
|
||||
|
||||
public void testDenotableType3() {
|
||||
doTest(new MockIntroduceVariableHandler("m", false, false, false, "java.util.function.IntFunction<java.lang.Class<?>[]>"));
|
||||
}
|
||||
|
||||
public void testReturnNonExportedArray() {
|
||||
doTest(new MockIntroduceVariableHandler("i", false, false, false, "java.io.File[]") {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user