Given:
public static <T> CompletableFuture<? extends List<? extends T>> supplyAllOf(
List<? extends CompletableFuture<? extends T>> input)
{
return CompletableFuture.allOf(input.toArray(new CompletableFuture<?>[input.size()])).
thenApply(ignored -> input.stream().map(CompletableFuture::join).collect(Collectors.toList()));
}
I get a warning from this compiler (using -Xlint):
found raw type: java.util.concurrent.CompletableFuture
missing type arguments for generic class java.util.concurrent.CompletableFuture<T>
but if I replaced CompletableFuture::joinwith e -> e.join(), the warning will disappear.
Is this a compiler error? If not, why do I see this behavior?
source
share