Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
asd
  • Loading branch information
mkristian committed Dec 6, 2014
1 parent d51d452 commit 3cb1927
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/org/jruby/util/URLResource.java
Expand Up @@ -149,8 +149,9 @@ public ChannelDescriptor openDescriptor(ModeFlags flags, int perm) throws Resour
}

public static FileResource createClassloaderURI(Ruby runtime, String pathname) {
// retrieve the classloader from the runtime if available otherwise mimic how the runtime got its classloader
ClassLoader cl = runtime != null ? runtime.getJRubyClassLoader().getParent() : URLResource.class.getClassLoader();
// retrieve the classloader from the runtime if available otherwise mimic how the runtime got its classloader and
// take this
ClassLoader cl = runtime != null ? runtime.getJRubyClassLoader() : URLResource.class.getClassLoader();
if (cl == null ) {
cl = Thread.currentThread().getContextClassLoader();
}
Expand Down Expand Up @@ -300,7 +301,7 @@ private static String[] listFiles(String pathname) {
public static URL getResourceURL(Ruby runtime, String location)
{
if (location.startsWith(URI + CLASSLOADER)){
return runtime.getJRubyClassLoader().getParent().getResource(location.substring(URI_CLASSLOADER.length()));
return runtime.getJRubyClassLoader().getResource(location.substring(URI_CLASSLOADER.length()));
}
try
{
Expand Down

0 comments on commit 3cb1927

Please sign in to comment.