Tobias Schlottke created JRUBY-6616:
---------------------------------------

             Summary: Strange behaviour/race condition using __send__
                 Key: JRUBY-6616
                 URL: https://jira.codehaus.org/browse/JRUBY-6616
             Project: JRuby
          Issue Type: Bug
            Reporter: Tobias Schlottke
            Assignee: Thomas E Enebo


Hi there,

I've got a strange error/race condition in my app which occurs in the jmx gem:

It occurs here: https://github.com/enebo/jmxjr/blob/master/lib/jmx.rb#L163
Without any special treatment, it complains that a Proc is expected, but a 
string was given.

If I change this to
self.class.__send__(:define_method, rname, Proc.new { self[attr.name] })  

The exception changes and it complains that define_method does not exist on the 
instance, even if self.class is begin called.

If I change __send__ to send the exception disappears.

The funny thing is, that another exception appears afterwards, in a totally 
different place.

I guess this might be some strange scoping problem.
I cant cleanly reproduce this, but could provide access to the machine.

-Tobias




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.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