File tree Expand file tree Collapse file tree
src/java.base/share/classes/jdk/internal/loader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ private static class Loader implements Closeable {
597597 /*
598598 * Returns the base URL for this Loader.
599599 */
600- URL getBaseURL () {
600+ final URL getBaseURL () {
601601 return base ;
602602 }
603603
@@ -1199,7 +1199,8 @@ static boolean isRelative(String child) {
11991199 */
12001200 private static class FileLoader extends Loader {
12011201 /* Canonicalized File */
1202- private File dir ;
1202+ private final File dir ;
1203+ private final URL normalizedBase ;
12031204
12041205 /*
12051206 * Creates a new FileLoader for the specified URL with a file protocol.
@@ -1209,6 +1210,7 @@ private FileLoader(URL url) throws IOException {
12091210 String path = url .getFile ().replace ('/' , File .separatorChar );
12101211 path = ParseUtil .decode (path );
12111212 dir = (new File (path )).getCanonicalFile ();
1213+ normalizedBase = new URL (getBaseURL (), "." );
12121214 }
12131215
12141216 /*
@@ -1227,7 +1229,6 @@ URL findResource(final String name, boolean check) {
12271229 Resource getResource (final String name , boolean check ) {
12281230 final URL url ;
12291231 try {
1230- URL normalizedBase = new URL (getBaseURL (), "." );
12311232 url = new URL (getBaseURL (), ParseUtil .encodePath (name , false ));
12321233
12331234 if (url .getFile ().startsWith (normalizedBase .getFile ()) == false ) {
You can’t perform that action at this time.
0 commit comments