我正在尝试遵循这些步骤。
我对“制作项目”步骤有疑问:
invalid inferred types for T,A; inferred type does not conform to declared bound(s)
inferred: java.lang.Object
bound(s): T
in ("return addAll(newHashSet(items));")
@NotNull
public static <T> Set<T> set(@NotNull T ... items) {
return addAll(newHashSet(items));
}
@NotNull
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);
}
return collection;
}
看起来很奇怪 - 源代码是实际的,我认为这可能是项目配置中的问题。有任何想法吗?