Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,18 @@ private Stream<EvaluationResult> evaluate(JavaClasses javaClasses) {

private void withCompileClasspath(Callable<?> callable) throws Exception {
ClassLoader previous = Thread.currentThread().getContextClassLoader();
try {
List<URL> urls = new ArrayList<>();
for (File file : getCompileClasspath().getFiles()) {
urls.add(file.toURI().toURL());
}
ClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader());
Thread.currentThread().setContextClassLoader(classLoader);
callable.call();
List<URL> urls = new ArrayList<>();
for (File file : getCompileClasspath().getFiles()) {
urls.add(file.toURI().toURL());
}
finally {
Thread.currentThread().setContextClassLoader(previous);
try (URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader())) {
Thread.currentThread().setContextClassLoader(classLoader);
try {
callable.call();
}
finally {
Thread.currentThread().setContextClassLoader(previous);
}
}
}

Expand Down
Loading