Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompositeFuture.allOf, anyOf, joinOf with generics #3595

Conversation

julianladisch
Copy link
Contributor

CompositeFuture.all(List), CompositeFuture.any(List) and
CompositeFuture.join(List) use the raw type of Future because
the code generator for other languages doesn't support wildcard extensions.
IDEs and other code checkers warn about the raw type because the compiler
cannot do type checks.

Jens Reimann (ctron) suggests to create allOf, anyOf and joinOf methods
in #2058. This avoids a breaking change with the existing methods and
allows not to generate the generic methods for other languages.

Resolves #1994, resolves #2058.

CompositeFuture.all(List<Future>), CompositeFuture.any(List<Future>) and
CompositeFuture.join(List<Future>) use the raw type of Future because
the code generator for other languages doesn't support wildcard extensions.
IDEs and other code checkers warn about the raw type because the compiler
cannot do type checks.

Jens Reimann (ctron) suggests to create allOf, anyOf and joinOf methods
in eclipse-vertx#2058. This avoids a breaking change with the existing methods and
allows not to generate the generic methods for other languages.

Resolves eclipse-vertx#1994, resolves eclipse-vertx#2058.

Signed-off-by: Julian Ladisch <eclipse.org-rtn@ladisch.de>
@vietj
Copy link
Member

vietj commented Oct 8, 2020

for the moment we cannot accept this as we would like this to avoid using @GenIgnore

@julianladisch
Copy link
Contributor Author

Are there any other suggestion how the issue can be resolved?

@vietj
Copy link
Member

vietj commented Oct 8, 2020

do your own wrapper in the meantime I think

@vietj
Copy link
Member

vietj commented Oct 8, 2020

I spent time trying to have wildcard working in codegen but it did not work out easily, I'll try revisiting this again soon

julianladisch added a commit to folio-org/okapi that referenced this pull request Nov 4, 2020
Coordinate a List<Future<T extends Future <?>>>, provides
all(List<T>), any(List<T>) and join(List<T>) that work like
CompositeFuture#all(List), CompositeFuture#any(List) and
CompositeFuture#join(List) but properly check the
generic type <T extends Future<?>>.

See eclipse-vertx/vert.x#3595 why Vert.x doesn't have this.
@julianladisch
Copy link
Contributor Author

Rejected.

Workaround: do your own wrapper.

@vietj
Copy link
Member

vietj commented Sep 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CompositeFuture forces you to use raw types
2 participants