-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b155
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174640 | 10 | Paul Sandoz | P3 | Resolved | Fixed | b01 |
As per current spec ,
This class loader supports the loading of classes from the contents of a multi-release JAR file that is referred to by a given URL.
However even loading of a versioned resource(text file etc.) is supported by URLClassLoader.
For E.g.:
mr.jar has following structure:
META-INF/MANIFEST.MF
iterator1.txt
META-INF/
META-INF/versions/
META-INF/versions/9/
META-INF/versions/9/iterator1.txt
META-INF/versions/10/
META-INF/versions/10/iterator1.txt
URL url = Paths.get("D:\\JEP-238\\mr.jar").toUri().toURL();
URLClassLoader urlClassLoader = new URLClassLoader(new URL[]{url});
System.out.println(urlClassLoader.findResource("iterator1.txt"));
OUTPUT : jar:file:/D:/JEP-238/mr.jar!/META-INF/versions/9/iterator1.txt
Hence the spec should mention it.
It could be:
"This class loader supports the loading of classes and resources from the contents of a multi-release JAR file that is referred to by a given URL."
This class loader supports the loading of classes from the contents of a multi-release JAR file that is referred to by a given URL.
However even loading of a versioned resource(text file etc.) is supported by URLClassLoader.
For E.g.:
mr.jar has following structure:
META-INF/MANIFEST.MF
iterator1.txt
META-INF/
META-INF/versions/
META-INF/versions/9/
META-INF/versions/9/iterator1.txt
META-INF/versions/10/
META-INF/versions/10/iterator1.txt
URL url = Paths.get("D:\\JEP-238\\mr.jar").toUri().toURL();
URLClassLoader urlClassLoader = new URLClassLoader(new URL[]{url});
System.out.println(urlClassLoader.findResource("iterator1.txt"));
OUTPUT : jar:file:/D:/JEP-238/mr.jar!/META-INF/versions/9/iterator1.txt
Hence the spec should mention it.
It could be:
"This class loader supports the loading of classes and resources from the contents of a multi-release JAR file that is referred to by a given URL."
- backported by
-
JDK-8174640 spec clarification for URLClassLoader for Multirelease jars
-
- Resolved
-
- relates to
-
JDK-8166914 URLClassLoader spec needs to mention that it's MR-aware
-
- Closed
-