Skip to content

Commit efae334

Browse files
committed
Fix injectMissingFileInfo not applying for FoxLoader in rare cases.
1 parent 4354e14 commit efae334

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

loader/src/main/java/com/fox2code/foxloader/launcher/FoxClassLoader.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,19 @@ private CodeSource codeSourceFromURL(final URL url) {
268268
public void injectMissingFileInfo(FileInfo fileInfo) {
269269
fileInfo.assertLocalFile();
270270
final String urlStr = fileInfo.source.toString();
271-
boolean inCls = false;
272-
for (URL url : this.getURLs()) {
273-
if (url.toString().equals(urlStr)) {
271+
boolean inCls = FoxLauncher.foxLoaderFile == fileInfo.file;
272+
if (!inCls) {
273+
for (URL url : this.getURLs()) {
274+
if (url.toString().equals(urlStr)) {
275+
inCls = true;
276+
break;
277+
}
278+
}
279+
if (!inCls && this.reIndevURL != null &&
280+
this.reIndevURL.toString().equals(urlStr)) {
274281
inCls = true;
275-
break;
276282
}
277283
}
278-
if (!inCls && this.reIndevURL != null &&
279-
this.reIndevURL.toString().equals(urlStr)) {
280-
inCls = true;
281-
}
282284
if (inCls) {
283285
this.fileInfoCache.putIfAbsent(urlStr, fileInfo);
284286
}

0 commit comments

Comments
 (0)