Include duplicate jar when jarhell check fails

When the jarhell check fails due to a duplicate jar on the classpath,
the exception message includes the full classpath but not the duplicated
jar. For a long classpath, this can make it difficult to find the jar
that is duplicated. This commit changes the exception message to include
the duplicated jar.

Relates #24953
This commit is contained in:
Sergey Novikov 2017-06-03 00:22:01 +02:00 committed by Jason Tedor
parent 8999104b14
commit 57b4002357
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ public class JarHell {
URL url = PathUtils.get(element).toUri().toURL();
if (urlElements.add(url) == false) {
throw new IllegalStateException("jar hell!" + System.lineSeparator() +
"duplicate jar on classpath: " + classPath);
"duplicate jar [" + element + "] on classpath: " + classPath);
}
} catch (MalformedURLException e) {
// should not happen, as we use the filesystem API