See comment inline
================
private static TestSuite open0(File root, Map tsInfo) throws Fault {
String[] classPath = StringArray.split((String) (tsInfo.get("classpath")));
ClassLoader cl;
if (classPath.length == 0)
cl = null;
else {
try {
File rootDir = (root.isDirectory() ? root : root.getParentFile());
URL[] p = new URL[classPath.length];
for (int i = 0; i < classPath.length; i++) {
String cpi = classPath[i];
if (cpi.toLowerCase().startsWith("http:"))
p[i] = new URL(cpi);
else {
File f = new File(cpi);
if (!f.isAbsolute())
f = new File(rootDir, cpi);
// The right conversion would be to call toURI().toURL, not just toURL()
p[i] = f.toURL();
}
}
cl = new URLClassLoader(p, TestSuite.class.getClassLoader());
}
catch (MalformedURLException e) {
throw new Fault(i18n, "ts.badClassPath",
new Object[] {root, e.getMessage()});
}
}
================
private static TestSuite open0(File root, Map tsInfo) throws Fault {
String[] classPath = StringArray.split((String) (tsInfo.get("classpath")));
ClassLoader cl;
if (classPath.length == 0)
cl = null;
else {
try {
File rootDir = (root.isDirectory() ? root : root.getParentFile());
URL[] p = new URL[classPath.length];
for (int i = 0; i < classPath.length; i++) {
String cpi = classPath[i];
if (cpi.toLowerCase().startsWith("http:"))
p[i] = new URL(cpi);
else {
File f = new File(cpi);
if (!f.isAbsolute())
f = new File(rootDir, cpi);
// The right conversion would be to call toURI().toURL, not just toURL()
p[i] = f.toURL();
}
}
cl = new URLClassLoader(p, TestSuite.class.getClassLoader());
}
catch (MalformedURLException e) {
throw new Fault(i18n, "ts.badClassPath",
new Object[] {root, e.getMessage()});
}
}