@@ -56,16 +56,16 @@ public JSUtil() {
5656
5757
5858 private static Map <String , Object > getFileCache () {
59- if (JSUtil . fileCache == null && (JSUtil . fileCache = JSUtil . J2S .getSetJavaFileCache (null )) == null ) {
60- JSUtil . fileCache = new Hashtable <String , Object >();
61- JSUtil . J2S .getSetJavaFileCache (JSUtil . fileCache );
59+ if (fileCache == null && (fileCache = J2S .getSetJavaFileCache (null )) == null ) {
60+ fileCache = new Hashtable <String , Object >();
61+ J2S .getSetJavaFileCache (fileCache );
6262 }
63- return JSUtil . fileCache ;
63+ return fileCache ;
6464 }
6565
6666 private static Object getCachedFileData (String path ) {
67- return (JSUtil . useCache && JSUtil . fileCache != null ?
68- JSUtil . fileCache .get (path ) : null );
67+ return (useCache && fileCache != null ?
68+ fileCache .get (path ) : null );
6969 }
7070
7171 /**
@@ -105,7 +105,7 @@ private static Object getFileContents(Object uriOrJSFile, boolean asBytes) {
105105 data = (asBytes ? Rdr .getStreamAsBytes (stream , null ) : Rdr .streamToUTF8String (stream ));
106106 } catch (Exception e ) {
107107 // bypasses AjaxURLConnection
108- data = JSUtil . J2S .getFileData (uri , null , false , asBytes );
108+ data = J2S .getFileData (uri , null , false , asBytes );
109109 }
110110 }
111111 return data ;
@@ -120,7 +120,7 @@ private static Object getFileContents(Object uriOrJSFile, boolean asBytes) {
120120 */
121121 public static String getFileAsString (String filename ) {
122122 Object data = getFileContents (filename , false );
123- return JSUtil . ensureString (data );
123+ return ensureString (data );
124124 }
125125
126126 public static byte [] getFileAsBytes (Object file , boolean checkNotFound ) {
@@ -167,7 +167,7 @@ else if (data instanceof InputStream)
167167 }
168168
169169 public static boolean haveCachedResource (String resourceName , boolean isJavaPath ) {
170- String path = JSUtil . J2S .getResourcePath (resourceName , isJavaPath );
170+ String path = J2S .getResourcePath (resourceName , isJavaPath );
171171 return (path != null && getCachedFileData (path ) != null );
172172 }
173173
@@ -192,14 +192,14 @@ public static String getJavaResource(String resourceName, boolean isJavaPath,
192192 if (data == null
193193 && (data = J2S .getFileData (path , null , false , false )) != null
194194 && useCache && doCache )
195- JSUtil . cacheFileData (path , data );
196- String sdata = JSUtil . ensureString (data );
195+ cacheFileData (path , data );
196+ String sdata = ensureString (data );
197197 boolean ok = (sdata != null && sdata .indexOf ("[Exception" ) != 0 );
198198 System .out .println ("Processing " + path + " ["
199199 + (ok ? "" + sdata .length () : sdata ) + "]" );
200200 return (!ok ? null : !doProcess ? sdata
201- : path .endsWith (".css" ) ? JSUtil . processCSS (sdata , path ) : path
202- .endsWith (".js" ) ? JSUtil . processJS (sdata , resourceName ) : sdata );
201+ : path .endsWith (".css" ) ? processCSS (sdata , path ) : path
202+ .endsWith (".js" ) ? processJS (sdata , resourceName ) : sdata );
203203 }
204204
205205 static void cacheFileData (String path , Object data ) {
@@ -224,7 +224,7 @@ public static void loadJavaResourcesFromZip(ClassLoader cl, String zipFileName,
224224 try {
225225 BufferedInputStream bis = new BufferedInputStream (cl .getResourceAsStream (zipFileName ));
226226 String prefix = J2S .getResourcePath (null , true ); // will end with /
227- fileList = JSUtil . getZipTools ().cacheZipContentsStatic (bis , prefix , mapByteData , false );
227+ fileList = getZipTools ().cacheZipContentsStatic (bis , prefix , mapByteData , false );
228228 } catch (Exception e ) {
229229 System .out .println ("JSUtil could not cache files from " + zipFileName );
230230 return ;
@@ -260,7 +260,7 @@ static String processCSS(String css, String path) {
260260 path = path .substring (0 , path .lastIndexOf ("/" ) + 1 ) + "images/" ;
261261 css = PT .rep (css , "images/" , path );
262262 }
263- JSUtil . jQuery .$ ("head" ).append (JSUtil . jQuery .$ ("<style type='text/css'>" + css + "</style>" ));
263+ jQuery .$ ("head" ).append (jQuery .$ ("<style type='text/css'>" + css + "</style>" ));
264264 return css ;
265265 }
266266
@@ -276,7 +276,7 @@ static String processJS(String js, String resourceName) {
276276 */
277277 {}
278278 } catch (Throwable e ) {
279- JSUtil . alert ("error processing " + js );
279+ alert ("error processing " + js );
280280 return null ;
281281 }
282282 return js ;
@@ -348,8 +348,8 @@ public static String getStackTrace() {
348348 */
349349 public static void notImplemented (String msg ) {
350350 String s = null ;
351- if (JSUtil . mapNotImpl == null )
352- JSUtil . mapNotImpl = new Hashtable <String , Boolean >();
351+ if (mapNotImpl == null )
352+ mapNotImpl = new Hashtable <String , Boolean >();
353353 /**
354354 * @j2sNative
355355 *
@@ -360,9 +360,9 @@ public static void notImplemented(String msg) {
360360 */
361361 {
362362 }
363- if (JSUtil . mapNotImpl .containsKey (s ))
363+ if (mapNotImpl .containsKey (s ))
364364 return ;
365- JSUtil . mapNotImpl .put (s , Boolean .TRUE );
365+ mapNotImpl .put (s , Boolean .TRUE );
366366 System .out .println (s + " has not been implemented in SwingJS. "
367367 + (msg == "" ? "" : (msg == null ? "" : msg ) + getStackTrace (-5 )));
368368
@@ -509,7 +509,7 @@ public static void showWebPage(URL url, Object target) {
509509 * @param msg
510510 */
511511 public static void warn (String msg ) {
512- JSUtil . alert (msg );
512+ alert (msg );
513513 }
514514
515515 /**
0 commit comments