RubyRegex match_m fails if run within a DummyDynamicScope
---------------------------------------------------------

                 Key: JRUBY-5072
                 URL: http://jira.codehaus.org/browse/JRUBY-5072
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Extensions
            Reporter: Tim Felgentreff


When running C extensions, we will not always have a proper scope available 
when calling up into Ruby. The Json gem's tests currently fail trying to match 
a string with the following error:

{quote}
Java::JavaLang::ClassCastException: org.jruby.RubyNil cannot be cast to 
org.jruby.RubyMatchData
    org.jruby.RubyRegexp.match_m(RubyRegexp.java:1330)
    
org.jruby.RubyRegexp$i_method_1_0$RUBYINVOKER$match_m.call(org/jruby/RubyRegexp$i_method_1_0$RUBYINVOKER$match_m.gen:65535)
    org.jruby.RubyClass.finvoke(RubyClass.java:682)
    org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:457)
    org.jruby.cext.JRuby.callRubyMethod1(JRuby.java:77)
{quote}

This is because the Backref is retrieved from the DummyScope, which was 
supposed to hold the match data (as set in the search method),however,dummy 
scopes do not save backrefs and just return RubyNil, it seems.

-- 
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