mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-66185 Malformed format string inspection: Instruct the inspection that int -> char conversion is correct
Utility collection population method signature is corrected in order to covariantly return given IS-A Collection instead of Collection
This commit is contained in:
@@ -488,7 +488,7 @@ public class ContainerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> Collection<T> addAll(@NotNull Collection<T> collection, @NotNull T... elements) {
|
||||
public static <T, A extends T, C extends Collection<T>> C addAll(@NotNull C collection, @NotNull A... elements) {
|
||||
//noinspection ManualArrayToCollectionCopy
|
||||
for (T element : elements) {
|
||||
collection.add(element);
|
||||
@@ -842,6 +842,11 @@ public class ContainerUtil {
|
||||
return result.toArray(emptyArray);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T> Set<T> set(T ... items) {
|
||||
return addAll(new HashSet<T>(), items);
|
||||
}
|
||||
|
||||
public static <T> void addIfNotNull(final T element, @NotNull Collection<T> result) {
|
||||
if (element != null) {
|
||||
result.add(element);
|
||||
|
||||
Reference in New Issue
Block a user