Class name misreported for certain instantiations of Proc objects
-----------------------------------------------------------------

                 Key: JRUBY-5026
                 URL: http://jira.codehaus.org/browse/JRUBY-5026
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.1
         Environment: Mac OS X 10.6.4 Intel
            Reporter: Ben Klang
            Assignee: Thomas E Enebo
            Priority: Minor


I have found a bug that seems to affect the reported class name on instantiated 
custom Proc objects.

Depending on how the object is instantiated, JRuby will report the object's 
class name as either the direct class that was instantiated or as the parent 
Proc class.  Here's some example code to reproduce the issue:

{noformat}
module Adhearsion
  class Foo

    def self.new_bar(&block)
      Bar.new(&block)
    end

    class Bar < Proc
      def initialize(&block)
        super(&block)
      end
    end
  end
end
{noformat}

With the above code I tried two different ways of getting a 
Adhearsion::Foo::Bar object:

{noformat}
x = Adhearsion::Foo::Bar.new { puts "x" }
puts x.class # => Adhearsion::Foo::Bar

x = Adhearsion::Foo.new_bar { puts "x" }
puts x.class # => Proc
{noformat}

Under Ruby MRI 1.8.7 both "puts x.class" return "Adhearsion::Foo::Bar".  Under 
JRuby the second call returns "Proc".  This interferes with type checking that 
we are using in our framework when run under Adhearsion.

In case you need more information, the original problem report is here:
https://adhearsion.lighthouseapp.com/projects/5871-adhearsion/tickets/92-menu-method-under-jruby-does-not-appear-to-work

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to