Skip to content

Commit

Permalink
Merge pull request #248 from apache/feature/247-RelativePathResolver-…
Browse files Browse the repository at this point in the history
…should-consider-TCCL

Issue #247 - RelativePathResolver should consider TCCL
  • Loading branch information
reckart committed Aug 29, 2022
2 parents e0f6600 + 30c1cb9 commit 27a8186
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions jVinci/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.apt_generated/
/.apt_generated_tests/
/META-INF/
1 change: 1 addition & 0 deletions uimaj-adapter-vinci/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.apt_generated/
/.apt_generated_tests/
/META-INF/
1 change: 1 addition & 0 deletions uimaj-core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.apt_generated/
/.apt_generated_tests/
/META-INF/
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,22 @@ public URL resolveRelativePath(URL aRelativeUrl) {

// fallback on classloader
String f = aRelativeUrl.getFile();
URL absURL;
URL absURL = null;
if (mClassLoader != null) {
absURL = mClassLoader.getResource(f);
} else {// if no ClassLoader specified (could be the bootstrap classloader), try the system
// classloader
}

// fallback on TCCL
if (absURL == null) {
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
absURL = tccl.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 no ClassLoader specified (could be the bootstrap classloader), try the system classloader
if (absURL == null && mClassLoader == null) {
absURL = ClassLoader.getSystemClassLoader().getResource(f);
}

return absURL;
}

Expand Down
1 change: 1 addition & 0 deletions uimaj-cpe/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ checkpoint_synchPoint.xml
checkpoint_synchPoint.xml.prev
/.apt_generated/
/.apt_generated_tests/
/META-INF/
1 change: 1 addition & 0 deletions uimaj-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.apt_generated/
/.apt_generated_tests/
/META-INF/

0 comments on commit 27a8186

Please sign in to comment.