mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
simplify ? extends Object (IDEA-91631; IDEA-91144)
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
import java.util.*;
|
||||
public class IntroduceParameterProducesWarning {
|
||||
private final List<Generic<?>> elements;
|
||||
|
||||
public IntroduceParameterProducesWarning(final ArrayList<Generic<?>> anObject) {
|
||||
elements = anObject;
|
||||
}
|
||||
|
||||
public static <E> ArrayList<E> newArrayList(E... elements) {
|
||||
ArrayList<E> list = new ArrayList<E>();
|
||||
Collections.addAll(list, elements);
|
||||
return list;
|
||||
}
|
||||
|
||||
private static interface Generic<T>{
|
||||
|
||||
}
|
||||
|
||||
private static class SomeGeneric implements Generic<String> {
|
||||
}
|
||||
|
||||
private static class SomeOtherGeneric implements Generic<Object> {
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import java.util.*;
|
||||
public class IntroduceParameterProducesWarning {
|
||||
private final List<Generic<?>> elements;
|
||||
|
||||
public IntroduceParameterProducesWarning() {
|
||||
elements = <selection>newArrayList(new SomeGeneric(), new SomeOtherGeneric())</selection>;
|
||||
}
|
||||
|
||||
public static <E> ArrayList<E> newArrayList(E... elements) {
|
||||
ArrayList<E> list = new ArrayList<E>();
|
||||
Collections.addAll(list, elements);
|
||||
return list;
|
||||
}
|
||||
|
||||
private static interface Generic<T>{
|
||||
|
||||
}
|
||||
|
||||
private static class SomeGeneric implements Generic<String> {
|
||||
}
|
||||
|
||||
private static class SomeOtherGeneric implements Generic<Object> {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user