You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2018/11/05 14:06:43 UTC

svn commit: r1845793 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java

Author: schor
Date: Mon Nov  5 14:06:43 2018
New Revision: 1845793

URL: http://svn.apache.org/viewvc?rev=1845793&view=rev
Log:
[UIMA-5902]

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java?rev=1845793&r1=1845792&r2=1845793&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/impl/RelativePathResolver_impl.java Mon Nov  5 14:06:43 2018
@@ -48,7 +48,7 @@ public class RelativePathResolver_impl i
 
   public RelativePathResolver_impl() {
     this(null);
-    mClassLoader = getClass().getClassLoader();
+    mClassLoader = getClass().getClassLoader();  // default value, maybe overridden by setPathResolverClassLoader
   }
 
   public RelativePathResolver_impl(ClassLoader aClassLoader) {
@@ -141,17 +141,15 @@ public class RelativePathResolver_impl i
     URL absURL;
     if (mClassLoader != null) {
       absURL = mClassLoader.getResource(f);
-    } else // if no ClassLoader specified (could be the bootstrap classloader), try the system
+    } else {// if no ClassLoader specified (could be the bootstrap classloader), try the system
     // classloader
-    {
-      absURL = ClassLoader.getSystemClassLoader().getResource(f);
+    
+      // https://issues.apache.org/jira/browse/UIMA-5902
+      ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+      absURL = (tccl != null) ? tccl.getResource(f)  
+                              : ClassLoader.getSystemClassLoader().getResource(f);
     }
-    if (absURL != null) {
-      return absURL;
-    }
-
-    // no file could be found
-    return null;
+    return absURL;
   }
 
   /**