Thread context classloader should not be saved
----------------------------------------------

                 Key: JRUBY-905
                 URL: http://jira.codehaus.org/browse/JRUBY-905
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 0.9.9
            Reporter: Robert Egglestone
            Priority: Minor
         Attachments: thread_classloader_should_be_changable.patch

JRubyClassLoader currently stores the thread context classloader at 
initialization time as its parent class loader (as set in Ruby.java).

However, the thread context classloader is intended to be changeable, and so it 
doesn't make sense to save its value as the parent classloader to be used on 
all future calls. This is made more problematic by JRubyClassLoader in Ruby 
being static, which means that the value the thread context classloader happens 
to have at the time of the first JRuby initialization is used across the entire 
VM.

In my case, this causes an issue when I create classes at runtime in a separate 
classloader, and then try to access them from JRuby.

The attached patch creates a parent classloader which delegates to the current 
context classloader.

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