{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/4032","repository_url":"https://api.github.com/repos/jruby/jruby","labels_url":"https://api.github.com/repos/jruby/jruby/issues/4032/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/4032/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/4032/events","html_url":"https://github.com/jruby/jruby/issues/4032","id":167819842,"number":4032,"title":"Incorrect error class is rescued when the super class is Java::JavaLang::RuntimeException","user":{"login":"civitaspo","id":4525500,"avatar_url":"https://avatars.githubusercontent.com/u/4525500?v=3","gravatar_id":"","url":"https://api.github.com/users/civitaspo","html_url":"https://github.com/civitaspo","followers_url":"https://api.github.com/users/civitaspo/followers","following_url":"https://api.github.com/users/civitaspo/following{/other_user}","gists_url":"https://api.github.com/users/civitaspo/gists{/gist_id}","starred_url":"https://api.github.com/users/civitaspo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civitaspo/subscriptions","organizations_url":"https://api.github.com/users/civitaspo/orgs","repos_url":"https://api.github.com/users/civitaspo/repos","events_url":"https://api.github.com/users/civitaspo/events{/privacy}","received_events_url":"https://api.github.com/users/civitaspo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-27T10:17:03Z","updated_at":"2016-08-13T07:11:30Z","closed_at":null,"body":"Hello. I found a buggy behaviour about error handling. If the behaviour is expected, please close the issue.\r\n\r\n## Issue\r\n\r\n- Incorrect error class is rescued when the super class is `Java::JavaLang::RuntimeException`.\r\n\r\n## Sample Code\r\n\r\n```\r\nrequire 'java'\r\n\r\nclass MyError1 < Java::JavaLang::RuntimeException; end\r\nclass MyError2 < Java::JavaLang::RuntimeException; end\r\n\r\nbegin\r\n  raise MyError1.new(\"my_error1\")\r\nrescue MyError2 => e\r\n  puts \"Why come here? error_class => #{e.class}, rescue MyError2.\"\r\n  puts \"e.kind_of?(MyError1) #=> #{e.kind_of?(MyError1)}\"\r\n  puts \"e.kind_of?(MyError2) #=> #{e.kind_of?(MyError2)}\"\r\nend\r\n```\r\n\r\nThe result is ...\r\n\r\n```\r\nWhy come here? error_class => MyError1, rescue MyError2.\r\ne.kind_of?(MyError1) #=> true\r\ne.kind_of?(MyError2) #=> false\r\n```\r\n\r\n### Environment\r\n\r\nProvide at least:\r\n* JRuby version (`jruby -v`) and command line (flags, JRUBY_OPTS, etc)\r\n  * `jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [darwin-x86_64]`\r\n* Operating system and platform (e.g. `uname -a`)\r\n  * `Darwin o-05796-mac.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64`\r\n\r\n### Expected Behavior\r\n\r\n* I think `MyError1` should not be rescued.\r\n"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/239606954","html_url":"https://github.com/jruby/jruby/issues/4032#issuecomment-239606954","issue_url":"https://api.github.com/repos/jruby/jruby/issues/4032","id":239606954,"user":{"login":"kares","id":45967,"avatar_url":"https://avatars.githubusercontent.com/u/45967?v=3","gravatar_id":"","url":"https://api.github.com/users/kares","html_url":"https://github.com/kares","followers_url":"https://api.github.com/users/kares/followers","following_url":"https://api.github.com/users/kares/following{/other_user}","gists_url":"https://api.github.com/users/kares/gists{/gist_id}","starred_url":"https://api.github.com/users/kares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kares/subscriptions","organizations_url":"https://api.github.com/users/kares/orgs","repos_url":"https://api.github.com/users/kares/repos","events_url":"https://api.github.com/users/kares/events{/privacy}","received_events_url":"https://api.github.com/users/kares/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T07:11:30Z","updated_at":"2016-08-13T07:11:30Z","body":"this neither worked before (in JRuby 1.7) ... kind of a new feature for handling JI, not sure what it needs."}}
{"actor":{"display_login":"kares"}}