{"action":"created","issue":{"url":"https://api.github.com/repos/junit-team/junit5/issues/1414","repository_url":"https://api.github.com/repos/junit-team/junit5","labels_url":"https://api.github.com/repos/junit-team/junit5/issues/1414/labels{/name}","comments_url":"https://api.github.com/repos/junit-team/junit5/issues/1414/comments","events_url":"https://api.github.com/repos/junit-team/junit5/issues/1414/events","html_url":"https://github.com/junit-team/junit5/issues/1414","id":321780951,"node_id":"MDU6SXNzdWUzMjE3ODA5NTE=","number":1414,"title":"Change to assertThrows in #1394 makes some existing call sites ambiguous","user":{"login":"cushon","id":478458,"node_id":"MDQ6VXNlcjQ3ODQ1OA==","avatar_url":"https://avatars0.githubusercontent.com/u/478458?v=4","gravatar_id":"","url":"https://api.github.com/users/cushon","html_url":"https://github.com/cushon","followers_url":"https://api.github.com/users/cushon/followers","following_url":"https://api.github.com/users/cushon/following{/other_user}","gists_url":"https://api.github.com/users/cushon/gists{/gist_id}","starred_url":"https://api.github.com/users/cushon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cushon/subscriptions","organizations_url":"https://api.github.com/users/cushon/orgs","repos_url":"https://api.github.com/users/cushon/repos","events_url":"https://api.github.com/users/cushon/events{/privacy}","received_events_url":"https://api.github.com/users/cushon/received_events","type":"User","site_admin":false},"labels":[{"id":420911923,"node_id":"MDU6TGFiZWw0MjA5MTE5MjM=","url":"https://api.github.com/repos/junit-team/junit5/labels/component:%20Jupiter","name":"component: Jupiter","color":"11ee99","default":false},{"id":309743833,"node_id":"MDU6TGFiZWwzMDk3NDM4MzM=","url":"https://api.github.com/repos/junit-team/junit5/labels/status:%20team%20discussion","name":"status: team discussion","color":"207de5","default":false},{"id":293473932,"node_id":"MDU6TGFiZWwyOTM0NzM5MzI=","url":"https://api.github.com/repos/junit-team/junit5/labels/theme:%20programming%20model","name":"theme: programming model","color":"c7def8","default":false},{"id":165165178,"node_id":"MDU6TGFiZWwxNjUxNjUxNzg=","url":"https://api.github.com/repos/junit-team/junit5/labels/type:%20bug","name":"type: bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/junit-team/junit5/milestones/23","html_url":"https://github.com/junit-team/junit5/milestone/23","labels_url":"https://api.github.com/repos/junit-team/junit5/milestones/23/labels","id":3194954,"node_id":"MDk6TWlsZXN0b25lMzE5NDk1NA==","number":23,"title":"5.3 M1","description":"","creator":{"login":"marcphilipp","id":214207,"node_id":"MDQ6VXNlcjIxNDIwNw==","avatar_url":"https://avatars2.githubusercontent.com/u/214207?v=4","gravatar_id":"","url":"https://api.github.com/users/marcphilipp","html_url":"https://github.com/marcphilipp","followers_url":"https://api.github.com/users/marcphilipp/followers","following_url":"https://api.github.com/users/marcphilipp/following{/other_user}","gists_url":"https://api.github.com/users/marcphilipp/gists{/gist_id}","starred_url":"https://api.github.com/users/marcphilipp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcphilipp/subscriptions","organizations_url":"https://api.github.com/users/marcphilipp/orgs","repos_url":"https://api.github.com/users/marcphilipp/repos","events_url":"https://api.github.com/users/marcphilipp/events{/privacy}","received_events_url":"https://api.github.com/users/marcphilipp/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":21,"state":"open","created_at":"2018-03-17T10:10:34Z","updated_at":"2018-06-05T10:08:40Z","due_on":"2018-06-24T07:00:00Z","closed_at":null},"comments":15,"created_at":"2018-05-10T01:43:48Z","updated_at":"2018-06-05T11:28:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I initially reported this as a comment in #1394 after that bug was closed. I wanted to start a new bug in case the comment got missed.\r\n\r\nWe started using the new `assertThrows` in our code base, and found that there is a small fraction of cases where this change is incompatible with existing uses of the method.\r\n\r\nIf the argument is a lambda the compiler will perform type inference and select one of the two overloads. However for method references to some generic methods that throw checked exceptions, type inference isn't powerful enough to disambiguate the overloads:\r\n\r\n```java\r\n// error: both method <T#1>assertThrows(Class<? extends T#1>,Runnable) and\r\n// method <T#2>assertThrows(Class<? extends T#2>,Callable<?>) in Z match\r\nassertThrows(ExecutionException.class, future::get);\r\n```\r\n\r\nThis isn't a common problem: it affects about 1% of files in our codebase that use `assertThrows`. The vast majority of those are specifically using `future::get`, and we may have an unusual number of expected exception tests on `Future`s. There's also a simple work-around of using `() -> future.get()` instead of `future::get`.\r\n\r\nThis seems OK from my perspective. What do you think? Is this a concern, or is it an acceptable breaking change?"},"comment":{"url":"https://api.github.com/repos/junit-team/junit5/issues/comments/394674993","html_url":"https://github.com/junit-team/junit5/issues/1414#issuecomment-394674993","issue_url":"https://api.github.com/repos/junit-team/junit5/issues/1414","id":394674993,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDY3NDk5Mw==","user":{"login":"sbrannen","id":104798,"node_id":"MDQ6VXNlcjEwNDc5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/104798?v=4","gravatar_id":"","url":"https://api.github.com/users/sbrannen","html_url":"https://github.com/sbrannen","followers_url":"https://api.github.com/users/sbrannen/followers","following_url":"https://api.github.com/users/sbrannen/following{/other_user}","gists_url":"https://api.github.com/users/sbrannen/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrannen/subscriptions","organizations_url":"https://api.github.com/users/sbrannen/orgs","repos_url":"https://api.github.com/users/sbrannen/repos","events_url":"https://api.github.com/users/sbrannen/events{/privacy}","received_events_url":"https://api.github.com/users/sbrannen/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T11:28:02Z","updated_at":"2018-06-05T11:28:02Z","author_association":"MEMBER","body":"Or.... is your compiler simply selecting \"an\" overload that just happens to compile and work?"}}
{"actor":{"display_login":"sbrannen"}}