{"action":"opened","issue":{"url":"https://api.github.com/repos/eclipse-vertx/vert.x/issues/2627","repository_url":"https://api.github.com/repos/eclipse-vertx/vert.x","labels_url":"https://api.github.com/repos/eclipse-vertx/vert.x/issues/2627/labels{/name}","comments_url":"https://api.github.com/repos/eclipse-vertx/vert.x/issues/2627/comments","events_url":"https://api.github.com/repos/eclipse-vertx/vert.x/issues/2627/events","html_url":"https://github.com/eclipse-vertx/vert.x/issues/2627","id":360509999,"node_id":"MDU6SXNzdWUzNjA1MDk5OTk=","number":2627,"title":"CompositeFuture cannot take a list of futures where the list type parameter has a type parameter","user":{"login":"queer","id":23562067,"node_id":"MDQ6VXNlcjIzNTYyMDY3","avatar_url":"https://avatars0.githubusercontent.com/u/23562067?v=4","gravatar_id":"","url":"https://api.github.com/users/queer","html_url":"https://github.com/queer","followers_url":"https://api.github.com/users/queer/followers","following_url":"https://api.github.com/users/queer/following{/other_user}","gists_url":"https://api.github.com/users/queer/gists{/gist_id}","starred_url":"https://api.github.com/users/queer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queer/subscriptions","organizations_url":"https://api.github.com/users/queer/orgs","repos_url":"https://api.github.com/users/queer/repos","events_url":"https://api.github.com/users/queer/events{/privacy}","received_events_url":"https://api.github.com/users/queer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-15T05:37:39Z","updated_at":"2018-09-15T05:37:39Z","closed_at":null,"author_association":"NONE","body":"Apologies if the title is unclear; I couldn't think of a good way to word it...\r\n\r\nSuppose you do something like the following:\r\n```Java\r\nList<Future<JsonObject>> futures = new ArrayList<>();\r\nfor(Service service : services) {\r\n    futures.add(service.doSomeUpdate());\r\n}\r\nCompositeFuture.all(futures)... // do whatever here\r\n```\r\nThis gives me the following error:\r\n```\r\n/path/to/Whatever.java:[114,32] no suitable method found for all(java.util.List<io.vertx.core.Future<io.vertx.core.json.JsonObject>>)\r\n    [...]\r\n    method io.vertx.core.CompositeFuture.all(java.util.List<io.vertx.core.Future>) is not applicable\r\n      (argument mismatch; java.util.List<io.vertx.core.Future<io.vertx.core.json.JsonObject>> cannot be converted to java.util.List<io.vertx.core.Future>)\r\n```\r\nThis can be resolved by convincing the compiler to see it as a `List<Future>` instead of a `List<Future<T>>`, such as\r\n```Java\r\n// Could declare `futures` as this, but then potentially losing type safety\r\nList<Future> futures = new ArrayList<>();\r\n// Or do an ugly thing like this to convince the compiler it doesn't have a type param\r\nCompositeFuture.all(Arrays.asList(futures.toArray(new Future[0])))...\r\n```\r\nbut doing this feels like an unnecessary hack to get around the problem. "}}
{"actor":{"display_login":"queer"}}