From: <ka...@us...> - 2009-09-03 20:16:20
|
Revision: 3235 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3235&view=rev Author: kappa1 Date: 2009-09-03 20:15:46 +0000 (Thu, 03 Sep 2009) Log Message: ----------- 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. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2009-08-12 14:48:37 UTC (rev 3234) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2009-09-03 20:15:46 UTC (rev 3235) @@ -52,6 +52,7 @@ 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 @@ 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(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |