{"pull_request":{"title":"Don't select bridge method for invocation.","created_at":"2012-01-01T01:49:51Z","user":{"id":50003,"login":"kohsuke","url":"https://api.github.com/users/kohsuke","gravatar_id":"0cb9832a01c22c083390f3c5dcb64105","avatar_url":"https://secure.gravatar.com/avatar/0cb9832a01c22c083390f3c5dcb64105?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"merged_at":"2012-01-01T04:15:22Z","review_comments":0,"updated_at":"2012-01-01T04:15:22Z","state":"closed","patch_url":"https://github.com/jruby/jruby/pull/108.patch","id":642574,"html_url":"https://github.com/jruby/jruby/pull/108","closed_at":"2012-01-01T04:15:22Z","deletions":0,"mergeable":null,"issue_url":"https://github.com/jruby/jruby/issues/108","base":{"user":{"id":55687,"login":"jruby","url":"https://api.github.com/users/jruby","gravatar_id":"4f169ebd30ce70024c64ff027828ae94","avatar_url":"https://secure.gravatar.com/avatar/4f169ebd30ce70024c64ff027828ae94?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"ref":"master","sha":"c16533a24b0ca2d5307614e5b06aabdb790534be","repo":{"created_at":"2009-04-05T03:54:35Z","open_issues":3,"git_url":"git://github.com/jruby/jruby.git","watchers":757,"updated_at":"2012-01-01T04:15:23Z","fork":false,"language":"Ruby","id":168370,"html_url":"https://github.com/jruby/jruby","name":"jruby","description":"JRuby, an implementation of Ruby on the JVM","master_branch":null,"ssh_url":"git@github.com:jruby/jruby.git","clone_url":"https://github.com/jruby/jruby.git","url":"https://api.github.com/repos/jruby/jruby","pushed_at":"2012-01-01T04:15:23Z","forks":161,"homepage":"http://www.jruby.org","owner":{"id":55687,"login":"jruby","url":"https://api.github.com/users/jruby","gravatar_id":"4f169ebd30ce70024c64ff027828ae94","avatar_url":"https://secure.gravatar.com/avatar/4f169ebd30ce70024c64ff027828ae94?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"size":13132,"private":false,"svn_url":"https://github.com/jruby/jruby"},"label":"jruby:master"},"additions":7,"commits":1,"body":"When selecting methods to expose to Ruby, there's no need to select bridge methods. \r\n\r\nThis eliminates redundant method calls, although that isn't why I need it.\r\n\r\nMy primary reason for this change is bit unusual; I've got a little byte code post processor to inject synthetic bridge methods to help me evolve code without breaking existing binaries, (http://bridge-method-injector.infradna.com/), and as a part of this I generate a bridge method whose return type is narrower, instead of wider.\r\n\r\nThat is, whereas normally bridge methods are as follows:\r\n<pre>\r\ninterface Base {\r\n    Object foo();\r\n}\r\n\r\nclass Impl implements Base {\r\n    String foo() {...}\r\n\r\n    // the above definition causes javac to insert the following\r\n    // bridge method\r\n    @Synthetic @Bridge\r\n    Object foo() { return <String>foo(); }\r\n}\r\n</pre>\r\n\r\nmy byte code post processing would produce this:\r\n\r\n```\r\nclass Impl /* no interface needed */ {\r\n    Object foo() {...}\r\n\r\n    @Synthetic @Bridge\r\n    String foo() { return (String)<Object>foo(); }\r\n}\r\n```\r\nThis works with javac, in the sense that it'll invoke \"Object foo()\", by preferring non-bridge methods for resolution.\r\n\r\nUnfortunately, JRuby doesn't discreminate against bridge methods, so it can end up calling \"String foo()\" depending on the exact implementation detail of the search.\r\n\r\nThis fix eliminates this issue by making JRuby ignore all bridge methods. Would you please please include this?\r\n\r\n(In the past I've made [a similar patch to Groovy](http://jira.codehaus.org/browse/GROOVY-5003))","number":108,"merged_by":{"id":154,"login":"nicksieger","url":"https://api.github.com/users/nicksieger","gravatar_id":"526d60de6472502bb570a9df2842b33b","avatar_url":"https://secure.gravatar.com/avatar/526d60de6472502bb570a9df2842b33b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"url":"https://api.github.com/repos/jruby/jruby/pulls/108","diff_url":"https://github.com/jruby/jruby/pull/108.diff","_links":{"review_comments":{"href":"https://api.github.com/repos/jruby/jruby/pulls/108/comments"},"html":{"href":"https://github.com/jruby/jruby/pull/108"},"self":{"href":"https://api.github.com/repos/jruby/jruby/pulls/108"},"comments":{"href":"https://api.github.com/repos/jruby/jruby/issues/108/comments"}},"comments":0,"merged":true,"changed_files":1,"head":{"user":{"id":50003,"login":"kohsuke","url":"https://api.github.com/users/kohsuke","gravatar_id":"0cb9832a01c22c083390f3c5dcb64105","avatar_url":"https://secure.gravatar.com/avatar/0cb9832a01c22c083390f3c5dcb64105?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"ref":"bridge","sha":"9754cbaa5696d8bcd57d0618f349d079b53662d6","repo":{"created_at":"2011-07-01T18:10:32Z","open_issues":0,"git_url":"git://github.com/kohsuke/jruby.git","watchers":1,"updated_at":"2012-01-01T01:45:38Z","fork":true,"language":"Ruby","id":1984671,"html_url":"https://github.com/kohsuke/jruby","name":"jruby","description":"JRuby, an implementation of Ruby on the JVM","master_branch":null,"ssh_url":"git@github.com:kohsuke/jruby.git","clone_url":"https://github.com/kohsuke/jruby.git","url":"https://api.github.com/repos/kohsuke/jruby","pushed_at":"2012-01-01T01:45:38Z","forks":0,"homepage":"http://www.jruby.org","owner":{"id":50003,"login":"kohsuke","url":"https://api.github.com/users/kohsuke","gravatar_id":"0cb9832a01c22c083390f3c5dcb64105","avatar_url":"https://secure.gravatar.com/avatar/0cb9832a01c22c083390f3c5dcb64105?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"size":152,"private":false,"svn_url":"https://github.com/kohsuke/jruby"},"label":"kohsuke:bridge"}},"number":108,"action":"closed"}