{"action":"opened","issue":{"url":"https://api.github.com/repos/puniverse/quasar/issues/206","repository_url":"https://api.github.com/repos/puniverse/quasar","labels_url":"https://api.github.com/repos/puniverse/quasar/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/puniverse/quasar/issues/206/comments","events_url":"https://api.github.com/repos/puniverse/quasar/issues/206/events","html_url":"https://github.com/puniverse/quasar/issues/206","id":160952574,"number":206,"title":"Inherit @Suspendable and throws SuspendException","user":{"login":"candrews","id":194713,"avatar_url":"https://avatars.githubusercontent.com/u/194713?v=3","gravatar_id":"","url":"https://api.github.com/users/candrews","html_url":"https://github.com/candrews","followers_url":"https://api.github.com/users/candrews/followers","following_url":"https://api.github.com/users/candrews/following{/other_user}","gists_url":"https://api.github.com/users/candrews/gists{/gist_id}","starred_url":"https://api.github.com/users/candrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/candrews/subscriptions","organizations_url":"https://api.github.com/users/candrews/orgs","repos_url":"https://api.github.com/users/candrews/repos","events_url":"https://api.github.com/users/candrews/events{/privacy}","received_events_url":"https://api.github.com/users/candrews/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-17T18:52:43Z","updated_at":"2016-06-17T18:52:43Z","closed_at":null,"body":"It would be great if the instrumentation could consider inherited  `@Suspendable` annotations and examine the inheritance hierarchy to determine if any extended method definitions include `throws SuspendException`. Such a change would make code using Quasar a lot readable (as it wouldn't have to have `throws SuspendException` or `@Suspendable` everywhere) and less error prone (if a superclass or implemented interface should be instrumented, it's more or less guaranteed than all implementations should be too).\r\n\r\nFor example, it would be great for Quasar to instrument B.run in this example:\r\n```java\r\npublic class B implements co.paralleluniverse.strands.SuspendableRunnable {\r\n    public void run() {\r\n        System.out.println(\"hello!\");\r\n    }\r\n}\r\n```\r\nAnalysis should be able to see that `run()` is an implementation of `co.paralleluniverse.strands.SuspendableRunnable.run()` which throws `SuspendException` and therefore know to instrument.\r\n\r\nSimilarly, D.run should be instrumented in this example:\r\n```java\r\npublic abstract class C implements java.lang.Runnable {\r\n    @Suspendable\r\n    public abstract void run();\r\n}\r\n\r\npublic class D extends C {\r\n    @Override\r\n    public void run(){\r\n        System.out.println(\"hello!\");\r\n    }\r\n}\r\n```\r\nAnalysis should be able to see that `C.run()` is an implementation of `B.run()` which has `@Suspendable` and therefore know to instrument.\r\n\r\nI've updated one of the Quasar tests to demonstrate this request for improvement (the tests I've added fail, of course): https://github.com/candrews/quasar/blob/inherit/quasar-core/src/test/java/co/paralleluniverse/fibers/instrument/SuspendableAnnotationTest.java"}}
{"actor":{"display_login":"candrews"}}