a File named "classpath:/path" uses ByteList's classloaders
-----------------------------------------------------------

                 Key: JRUBY-5193
                 URL: http://jira.codehaus.org/browse/JRUBY-5193
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.5
         Environment: found on os x, likely all platforms effected
            Reporter: Najati Imam
            Assignee: Thomas E Enebo
         Attachments: patch

>From the original email to the mailing list:
http://groups.google.com/group/jruby-users/browse_thread/thread/4093daf2a068b7d6

 - - -
We're running our script inside a ScriptingContainer with a custom classloader 
that helps us find scripts in particular places. When trying to File.read a 
file with a name like "classpath:/path/to/file" we expected that classpath 
request to end up in the same classloader but, nay, it didn't. The stacktrace 
revealed the problem; to wit, the resource is being loaded using 
ByteList.EMPTY_BYTELIST.getClass().getClassLoader(). QQ This seems 
inconsistent. Is there a reason for not at least attempting to use the 
classloader set on the scripting container? Here's the line 
(ChannelDescriptor.java)

            InputStream is = 
ByteList.EMPTY_BYTELIST.getClass().getClassLoader().getResourceAsStream(path);
 - - -

I've attached a patch that allows ChannelDescriptor to be provided a 
JRubyClassLoader and then used that form in ChannelStream.fopen providing the 
runtime's JRubyClassLoader. No testcase, tho.

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