classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] RFC: Don't call protected addURL() method from URLClassLoad


From: Mark Wielaard
Subject: [cp-patches] RFC: Don't call protected addURL() method from URLClassLoader constructors
Date: Wed, 19 Oct 2005 18:26:42 +0200

Hi,

This is the last piece needed to get JBoss (4.0.3) to start up. JBoss
has some ClassLoaders that subclass URLClassLoader and override the
protected addURL() method. These ClassLoaders don't expect addURL() to
be called while they are calling super() in their own constructor since
they haven't had a change to setup all their state correctly then.

This patch makes sure that addURLs() as called from the URLClassLoader
constructors don't call the protected addURL() method.

2005-10-19  Mark Wielaard  <address@hidden>

    * java/net/URLClassLoader.java (addURLs): Don't call addURL(), but
    call urls.add() and addURLImpl() directly on each URL.

Andrew, I know you hacked on this code to get Jonas running nicely.
Could you check that this doesn't break anything for you? We don't want
to loose that nice 96.79% success rate!

Works fine for some other applications that use URLClassLoaders
extensively, like Eclipse.

Cheers,

Mark
Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLClassLoader.java,v
retrieving revision 1.40
diff -u -r1.40 URLClassLoader.java
--- java/net/URLClassLoader.java        2 Oct 2005 22:58:41 -0000       1.40
+++ java/net/URLClassLoader.java        19 Oct 2005 16:20:48 -0000
@@ -760,7 +760,10 @@
   private void addURLs(URL[] newUrls)
   {
     for (int i = 0; i < newUrls.length; i++)
-      addURL(newUrls[i]);
+      {
+       urls.add(newUrls[i]);
+       addURLImpl(newUrls[i]);
+      }
   }
 
   /**

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]