}
forkedPathChecked = true;
if (!cmd.haveClasspath()) {
return;
}
AntClassLoader loader = null;
try {
loader =
AntClassLoader.newAntClassLoader(null, getProject(),
cmd.createClasspath(getProject()),
true);
String projectResourceName =
LoaderUtils.classNameToResource(Project.class.getName());
URL previous = null;
try {
for (Enumeration e = loader.getResources(projectResourceName);
e.hasMoreElements();) {
URL current = (URL) e.nextElement();
if (previous != null && !urlEquals(current, previous)) {
log("WARNING: multiple versions of ant detected "
+ "in path for junit "
+ LINE_SEP + " " + previous
+ LINE_SEP + " and " + current,
Project.MSG_WARN);
return;
}
previous = current;
}
} catch (Exception ex) {
// Ignore exception
}
} finally {
if (loader != null) {
loader.cleanup();
}
}
}