jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-1191

method() on alias calls wrong super (but not in our opinion)

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.0, JRuby 1.0.1
  • Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
  • Component/s: Interpreter
  • Labels:
    None

Description

Here is reduced testcase:

# Test weird likely-a-bug where method() will repurpose where super goes to
class Foo222
  def a; 'a'; end
  def b; 'b'; end
end

class Bar222 < Foo222
  def a; super; end
  alias b a
end

test_equal('a', Bar222.new.b)
test_equal('b', Bar222.new.method(:b).call)

Charlie sent a message to ruby-core on this since this seems like a bug, but we will patch this for now since the fix is pretty simple and we want to be compatible.

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. JRUBY-1192 Proposed MRI bug...method() on aliased method should behave the same as the aliased call itself

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Thomas E Enebo added a comment - 06/Jul/07 4:28 PM

Fixed in commit 3698

Show
Thomas E Enebo added a comment - 06/Jul/07 4:28 PM Fixed in commit 3698
Hide
Permalink
Mike Perham added a comment - 05/Oct/07 11:30 AM

We still seem to be seeing this issue in JRuby 1.0.1. The output of your testcase for us in 1.0.1 is:

puts Bar222.new.b
puts Bar222.new.method(:b).call

a
a

Show
Mike Perham added a comment - 05/Oct/07 11:30 AM We still seem to be seeing this issue in JRuby 1.0.1. The output of your testcase for us in 1.0.1 is:
puts Bar222.new.b
puts Bar222.new.method(:b).call
a a
Hide
Permalink
Mike Perham added a comment - 05/Oct/07 11:34 AM

Is this the expected output? I ask because we were the ones that originally reported this issue, find that our code works fine with CRuby but still breaks against 1.0.1 with the following error:

ArgumentError (wrong number of arguments(2 for 4)):
/vendor/plugins/rails_monitor/lib/base_monitor.rb:47:in `monitor_invocation'
/vendor/plugins/rails_monitor/lib/connection_monitor.rb:27:in `initialize_with_monitor'
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new'
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send'
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection='
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/query_cache.rb:54:in `connection='
/Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
/vendor/plugins/rails_monitor/lib/record_monitor.rb:73:in `retrieve_connection_with_monitor'

Show
Mike Perham added a comment - 05/Oct/07 11:34 AM Is this the expected output? I ask because we were the ones that originally reported this issue, find that our code works fine with CRuby but still breaks against 1.0.1 with the following error:
ArgumentError (wrong number of arguments(2 for 4)): /vendor/plugins/rails_monitor/lib/base_monitor.rb:47:in `monitor_invocation' /vendor/plugins/rails_monitor/lib/connection_monitor.rb:27:in `initialize_with_monitor' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection=' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/query_cache.rb:54:in `connection=' /Users/mperham/jruby-1.0.1/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection' /vendor/plugins/rails_monitor/lib/record_monitor.rb:73:in `retrieve_connection_with_monitor'
Hide
Permalink
Oliver Schmelzle added a comment - 05/Oct/07 3:18 PM

The associated commit was 3968 (not 3698 as stated above).

Show
Oliver Schmelzle added a comment - 05/Oct/07 3:18 PM The associated commit was 3968 (not 3698 as stated above).
Hide
Permalink
Oliver Schmelzle added a comment - 05/Oct/07 3:19 PM

This fix didn't make it into JRuby 1.0.1 (contrary to the statement above).

Please merge it into JRuby 1.0.2 if the schedule permits. Thanks.

Show
Oliver Schmelzle added a comment - 05/Oct/07 3:19 PM This fix didn't make it into JRuby 1.0.1 (contrary to the statement above). Please merge it into JRuby 1.0.2 if the schedule permits. Thanks.
Hide
Permalink
Thomas E Enebo added a comment - 05/Oct/07 3:45 PM

This looks like we did not commit a 1.0 branch fix for this...reopening....We will get this for 1.0.2.

Show
Thomas E Enebo added a comment - 05/Oct/07 3:45 PM This looks like we did not commit a 1.0 branch fix for this...reopening....We will get this for 1.0.2.
Hide
Permalink
Thomas E Enebo added a comment - 25/Oct/07 2:30 PM

Fixed in commit 4733 on 1.0 branch (already fixed on trunk)

Show
Thomas E Enebo added a comment - 25/Oct/07 2:30 PM Fixed in commit 4733 on 1.0 branch (already fixed on trunk)
Hide
Permalink
Vladimir Sizikov added a comment - 17/Nov/09 7:27 AM

See also JRUBY-1192.

Show
Vladimir Sizikov added a comment - 17/Nov/09 7:27 AM See also JRUBY-1192.

People

  • Assignee:
    Thomas E Enebo
    Reporter:
    Thomas E Enebo
Vote (0)
Watch (2)

Dates

  • Created:
    06/Jul/07 4:25 PM
    Updated:
    17/Nov/09 7:27 AM
    Resolved:
    25/Oct/07 2:30 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.