mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-01-08 01:39:57 +01:00
Java caching properly disabled, this should prevent the AppletLoader from continuing to load jars from the java cache which have become corrupt.
The infamous "Fatal Error occured (5): null" bug should now go away on refresh as the files are redownloaded.
This commit is contained in:
parent
02f54eb831
commit
58703c742d
|
|
@ -52,6 +52,7 @@ import java.io.PrintWriter;
|
|||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.SocketPermission;
|
||||
import java.net.URL;
|
||||
|
|
@ -779,11 +780,15 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
|||
state = STATE_DOWNLOADING;
|
||||
|
||||
URLConnection urlconnection;
|
||||
|
||||
// disable the java caching
|
||||
Field field = URLConnection.class.getDeclaredField("defaultUseCaches");
|
||||
field.setAccessible(true);
|
||||
field.setBoolean(URLConnection.class, false);
|
||||
|
||||
// calculate total size of jars to download
|
||||
for (int i = 0; i < urlList.length; i++) {
|
||||
urlconnection = urlList[i].openConnection();
|
||||
urlconnection.setDefaultUseCaches(false);
|
||||
totalSizeDownload += urlconnection.getContentLength();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue