vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Generic of CompositeFuture::all not working under java17

Open chinfeng opened this issue 2 years ago • 4 comments

Questions

image

'all(java.util.List<io.vertx.core.Future>)' in 'io.vertx.core.CompositeFuture' cannot be applied to '(java.util.List<io.vertx.core.Future<java.lang.String>>)'

The same problem of CompositeFuture::join and CompositeFuture::any

image

Version

JDK17 / 4.3.0

chinfeng avatar May 22 '22 10:05 chinfeng

I also ran into this yesterday and thought I was doing something wrong.

I found this open issue from a while back which had a response.

How about to makeCompositeFuture#all accept List<Future<?>>

@vietj This was open in 2019, I'm guessing it's difficult to modify the code generator as you mentioned in the ticket?

tmulle avatar May 24 '22 11:05 tmulle

New to Java....

Does anyone know of how to work around this?

jjoocceeee avatar Jul 08 '22 20:07 jjoocceeee

you can use as work around your own static method that does it for you.

we cannot change this in vertx otherwise it would be a breaking change unfortunately.

it will be addressed in the next major version

vietj avatar Jul 11 '22 07:07 vietj

Added an explanation to someone's answer about this on Stack Overflow

mykelalvis avatar Aug 16 '22 15:08 mykelalvis