changeset 1257:d1cbd5d9d782

2008-12-05 Mark Wielaard <mwielaard@redhat.com> * rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: JarIndex.getIndex() can return null when there is no index for the jar. In that case we shouldn't store the null result.
author Lillian Angel <langel@redhat.com>
date Fri, 05 Dec 2008 10:56:29 -0500
parents 81363fed525c
children b3016fa940b5
files ChangeLog rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 05 14:08:01 2008 +0100
+++ b/ChangeLog	Fri Dec 05 10:56:29 2008 -0500
@@ -1,3 +1,9 @@
+2008-12-05  Mark Wielaard  <mwielaard@redhat.com>
+
+	* rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java:
+	JarIndex.getIndex() can return null when there is no index for the
+	jar. In that case we shouldn't store the null result.
+
 2008-12-05  Matthias Klose  <doko@ubuntu.com>
 
 	* patches/icedtea-lucene-crash.patch: Update for b14.
--- a/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Dec 05 14:08:01 2008 +0100
+++ b/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Dec 05 10:56:29 2008 -0500
@@ -494,8 +494,12 @@
 
                         // there is currently no mechanism to cache files per 
                         // instance.. so only index cached files
-                        if (localFile != null)
-                        	jarIndexes.add(JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), null));
+                        if (localFile != null) {
+                          JarFile file = new JarFile(localFile.getAbsolutePath());
+			  JarIndex index = JarIndex.getJarIndex(file, null);
+			  if (index != null)
+			    jarIndexes.add(index);
+                        }
 
                         if (JNLPRuntime.isDebug())
                             System.err.println("Activate jar: "+location);
@@ -692,7 +696,8 @@
                 // Currently this loads jars directly from the site. We cannot cache it because this 
                 // call is initiated from within the applet, which does not have disk read/write permissions
                 for (JarIndex index: jarIndexes) {
-                    LinkedList<String> jarList = index.get(name.replace('.', '/'));
+
+		    LinkedList<String> jarList = index.get(name.replace('.', '/'));
 
                     if (jarList != null) {
                         for (String jarName: jarList) {