Don't fail in loadJARs when there are no jar files to load

The loadJARs method throws an exception if the class loader which
needs to be extended is not an URLClassLoader. However, there is
no reason to fail when there are not jars to load.

Change-Id: I263384af81e7af1e2e8d8e0a3aee428f029c9d35
This commit is contained in:
Saša Živkov
2017-05-17 14:51:01 +02:00
parent a3844fca7f
commit 027764a06c

View File

@@ -56,6 +56,10 @@ public final class IoUtil {
}
public static void loadJARs(Collection<Path> jars) {
if (jars.isEmpty()) {
return;
}
ClassLoader cl = IoUtil.class.getClassLoader();
if (!(cl instanceof URLClassLoader)) {
throw noAddURL("Not loaded by URLClassLoader", null);