@@ -104,7 +104,7 @@ private static List<URL> getUrlsFromClassPathOfJarManifestIfPossible(URL url) {
104104 return Collections .<URL >emptyList ();
105105 }
106106 try {
107- return getUrlsFromManifestClassPathAttribute (jarFile );
107+ return getUrlsFromManifestClassPathAttribute (url , jarFile );
108108 }
109109 catch (IOException ex ) {
110110 throw new IllegalStateException (
@@ -126,8 +126,8 @@ private static JarFile getJarFileIfPossible(URL url) {
126126 return null ;
127127 }
128128
129- private static List <URL > getUrlsFromManifestClassPathAttribute (JarFile jarFile )
130- throws IOException {
129+ private static List <URL > getUrlsFromManifestClassPathAttribute (URL jarUrl ,
130+ JarFile jarFile ) throws IOException {
131131 Manifest manifest = jarFile .getManifest ();
132132 if (manifest == null ) {
133133 return Collections .<URL >emptyList ();
@@ -139,16 +139,12 @@ private static List<URL> getUrlsFromManifestClassPathAttribute(JarFile jarFile)
139139 }
140140 String [] entries = StringUtils .delimitedListToStringArray (classPath , " " );
141141 List <URL > urls = new ArrayList <>(entries .length );
142- File parent = new File (jarFile .getName ()).getParentFile ();
143- List <File > nonExistentEntries = new ArrayList <>();
142+ List <URL > nonExistentEntries = new ArrayList <>();
144143 for (String entry : entries ) {
145144 try {
146- File referenced = new File (entry );
147- if (!referenced .isAbsolute ()) {
148- referenced = new File (parent , entry );
149- }
150- if (referenced .exists ()) {
151- urls .add (referenced .toURI ().toURL ());
145+ URL referenced = new URL (jarUrl , entry );
146+ if (new File (referenced .getFile ()).exists ()) {
147+ urls .add (referenced );
152148 }
153149 else {
154150 nonExistentEntries .add (referenced );
0 commit comments