harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r764270 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
Date Sun, 12 Apr 2009 01:56:26 GMT
Author: ndbeyer
Date: Sun Apr 12 01:56:25 2009
New Revision: 764270

URL: http://svn.apache.org/viewvc?rev=764270&view=rev
Log:
correct null check in getSubHandler, make all instance variables final

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java?rev=764270&r1=764269&r2=764270&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
Sun Apr 12 01:56:25 2009
@@ -302,20 +302,18 @@
     }
 
     class URLJarHandler extends URLHandler {
-        JarFile jf;
-        String prefixName;
-        IndexFile index = null;
-        Map<URL, URLHandler> subHandlers = new HashMap<URL, URLHandler>();
+        final JarFile jf;
+        final String prefixName;
+        final IndexFile index;
+        final Map<URL, URLHandler> subHandlers = new HashMap<URL, URLHandler>();
 
         public URLJarHandler(URL url, URL jarURL, JarFile jf, String prefixName) {
             super(url);
             this.jf = jf;
             this.prefixName = prefixName;
             this.codeSourceUrl = jarURL;
-            JarEntry je = jf.getJarEntry("META-INF/INDEX.LIST"); //$NON-NLS-1$
-            if (je != null) {
-                index = IndexFile.readIndexFile(jf, je, url);
-            }
+            final JarEntry je = jf.getJarEntry("META-INF/INDEX.LIST"); //$NON-NLS-1$
+            this.index = (je == null ? null : IndexFile.readIndexFile(jf, je, url));
         }
 
         public URLJarHandler(URL url, URL jarURL, JarFile jf, String prefixName, IndexFile
index) {
@@ -474,7 +472,7 @@
 
         private synchronized URLHandler getSubHandler(URL url) {
             URLHandler sub = subHandlers.get(url);
-            if (url != null) {
+            if (sub != null) {
                 return sub;
             }
             String protocol = url.getProtocol();



Mime
View raw message