You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2012/08/05 09:40:54 UTC

svn commit: r1369533 - /river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java

Author: peter_firmstone
Date: Sun Aug  5 07:40:54 2012
New Revision: 1369533

URL: http://svn.apache.org/viewvc?rev=1369533&view=rev
Log:
Investigate test failure on Solaris x86, BadLocatorDiscoveryListener.

Sun Bug ID:6536522 NPE thrown instead of MalformedURLException

Modified:
    river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java

Modified: river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java
URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java?rev=1369533&r1=1369532&r2=1369533&view=diff
==============================================================================
--- river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java (original)
+++ river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassLoader.java Sun Aug  5 07:40:54 2012
@@ -592,15 +592,22 @@ public class PreferredClassLoader extend
 	     * available upon the attempt (elsewhere) to obtain the preferred
 	     * list
 	     */
+            URL baseURL = getBaseJarURL(firstURL);
 	    try {
-		URL baseURL = getBaseJarURL(firstURL);
 		((JarURLConnection) baseURL.openConnection()).getManifest();
 		exists = true;
-	    }
-	    catch (IOException e) {
+	    } catch (IOException e) {
 		// we still have no definite answer on whether the JAR file
 		// and therefore the PREFERRED.LIST exists
-	    }
+	    } catch (NullPointerException e){
+                // Sun Bug ID: 6536522
+                // NullPointerException is thrown instead of MalformedURLException
+                // Case is the same as above, we have no definite answer on
+                // whether the JAR file and therefore the PREFERRED.LIST exists.
+                System.err.println("NPE thrown while trying to open connection:" +
+                        baseURL);
+                e.printStackTrace(System.err);
+            }
 
 	    if (!exists) {
 		exists = (getPreferredConnection(firstURL, true) != null);