{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/4262","repository_url":"https://api.github.com/repos/jruby/jruby","labels_url":"https://api.github.com/repos/jruby/jruby/issues/4262/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/4262/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/4262/events","html_url":"https://github.com/jruby/jruby/issues/4262","id":186866974,"number":4262,"title":"Method#owner returns wrong implementation module","user":{"login":"etehtsea","id":100999,"avatar_url":"https://avatars.githubusercontent.com/u/100999?v=3","gravatar_id":"","url":"https://api.github.com/users/etehtsea","html_url":"https://github.com/etehtsea","followers_url":"https://api.github.com/users/etehtsea/followers","following_url":"https://api.github.com/users/etehtsea/following{/other_user}","gists_url":"https://api.github.com/users/etehtsea/gists{/gist_id}","starred_url":"https://api.github.com/users/etehtsea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etehtsea/subscriptions","organizations_url":"https://api.github.com/users/etehtsea/orgs","repos_url":"https://api.github.com/users/etehtsea/repos","events_url":"https://api.github.com/users/etehtsea/events{/privacy}","received_events_url":"https://api.github.com/users/etehtsea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-02T17:26:24Z","updated_at":"2016-11-02T19:31:13Z","closed_at":null,"body":"`Kernel#method` used in examples but it seems that both methods are relying on [implementationModule variable](https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyMethod.java#L259).\r\n\r\nJRuby master (actually proper implementation called in `RubyIO`):\r\n\r\n```\r\n>> s0.method(:inspect)\r\n=> #<Method: UNIXSocket(Kernel)#inspect>\r\n```\r\n\r\nMRI:\r\n```\r\n[17] pry(main)> s0.method(:inspect)\r\n=> #<Method: UNIXSocket(IO)#inspect>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/257973877","html_url":"https://github.com/jruby/jruby/issues/4262#issuecomment-257973877","issue_url":"https://api.github.com/repos/jruby/jruby/issues/4262","id":257973877,"user":{"login":"headius","id":10135,"avatar_url":"https://avatars.githubusercontent.com/u/10135?v=3","gravatar_id":"","url":"https://api.github.com/users/headius","html_url":"https://github.com/headius","followers_url":"https://api.github.com/users/headius/followers","following_url":"https://api.github.com/users/headius/following{/other_user}","gists_url":"https://api.github.com/users/headius/gists{/gist_id}","starred_url":"https://api.github.com/users/headius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headius/subscriptions","organizations_url":"https://api.github.com/users/headius/orgs","repos_url":"https://api.github.com/users/headius/repos","events_url":"https://api.github.com/users/headius/events{/privacy}","received_events_url":"https://api.github.com/users/headius/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T19:31:13Z","updated_at":"2016-11-02T19:31:13Z","body":"I don't think this is related to `Method#owner`. I think this is due to `IO` not defining its own `inspect` method. Instead, it just overrides the Java impl. As a result, the only `inspect` in any method table is the one from `Kernel`.\r\n\r\n```\r\n$ jruby -rsocket -e 'p UNIXSocket.instance_method(:inspect).owner'\r\nKernel\r\n```\r\n\r\n\r\nIf I modify RubyIO to actually define `inspect` as a Ruby method, then it matches your result:\r\n\r\n```\r\n$ jruby -rsocket -e 'p UNIXSocket.instance_method(:inspect).owner'\r\nIO\r\n```\r\n\r\nI'll go ahead with that fix."}}
{"actor":{"display_login":"headius"}}