File tree 1 file changed +4
-3
lines changed
src/java.base/share/classes/jdk/internal/loader
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ private static class Loader implements Closeable {
597
597
/*
598
598
* Returns the base URL for this Loader.
599
599
*/
600
- URL getBaseURL () {
600
+ final URL getBaseURL () {
601
601
return base ;
602
602
}
603
603
@@ -1199,7 +1199,8 @@ static boolean isRelative(String child) {
1199
1199
*/
1200
1200
private static class FileLoader extends Loader {
1201
1201
/* Canonicalized File */
1202
- private File dir ;
1202
+ private final File dir ;
1203
+ private final URL normalizedBase ;
1203
1204
1204
1205
/*
1205
1206
* Creates a new FileLoader for the specified URL with a file protocol.
@@ -1209,6 +1210,7 @@ private FileLoader(URL url) throws IOException {
1209
1210
String path = url .getFile ().replace ('/' , File .separatorChar );
1210
1211
path = ParseUtil .decode (path );
1211
1212
dir = (new File (path )).getCanonicalFile ();
1213
+ normalizedBase = new URL (getBaseURL (), "." );
1212
1214
}
1213
1215
1214
1216
/*
@@ -1227,7 +1229,6 @@ URL findResource(final String name, boolean check) {
1227
1229
Resource getResource (final String name , boolean check ) {
1228
1230
final URL url ;
1229
1231
try {
1230
- URL normalizedBase = new URL (getBaseURL (), "." );
1231
1232
url = new URL (getBaseURL (), ParseUtil .encodePath (name , false ));
1232
1233
1233
1234
if (url .getFile ().startsWith (normalizedBase .getFile ()) == false ) {
You can’t perform that action at this time.
0 commit comments