[kaffe] CVS kaffe (robilad): Resynced with GNU classpath: URLClassLoader fixlet

Kaffe CVS cvs-commits at kaffe.org
Fri Mar 11 07:18:20 PST 2005


PatchSet 5514 
Date: 2005/03/11 15:13:51
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU classpath: URLClassLoader fixlet

2005-03-11  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-03-09  Tom Tromey  <tromey at redhat.com>

        * java/net/URLClassLoader.java (addURLImpl): Reset 'thisString'.
        (toString): Synchronize.

Members: 
	ChangeLog:1.3688->1.3689 
	libraries/javalib/java/net/URLClassLoader.java:1.24->1.25 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3688 kaffe/ChangeLog:1.3689
--- kaffe/ChangeLog:1.3688	Thu Mar 10 01:07:25 2005
+++ kaffe/ChangeLog	Fri Mar 11 15:13:51 2005
@@ -1,3 +1,12 @@
+2005-03-11  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
+	2005-03-09  Tom Tromey  <tromey at redhat.com>
+
+        * java/net/URLClassLoader.java (addURLImpl): Reset 'thisString'.
+        (toString): Synchronize.
+
 2005-03-10  Dalibor Topic  <robilad at kaffe.org>
 
 	* libraries/javalib/gnu/java/nio/channels/FileChannelImpl.java
Index: kaffe/libraries/javalib/java/net/URLClassLoader.java
diff -u kaffe/libraries/javalib/java/net/URLClassLoader.java:1.24 kaffe/libraries/javalib/java/net/URLClassLoader.java:1.25
--- kaffe/libraries/javalib/java/net/URLClassLoader.java:1.24	Wed Mar  2 23:02:58 2005
+++ kaffe/libraries/javalib/java/net/URLClassLoader.java	Fri Mar 11 15:13:54 2005
@@ -731,6 +731,9 @@
         if (newUrl == null)
           return; // Silently ignore...
 
+	// Reset the toString() value.
+	thisString = null;
+
         // Check global cache to see if there're already url loader
         // for this url.
         URLLoader loader = (URLLoader) urlloaders.get(newUrl);
@@ -944,25 +947,28 @@
    */
   public String toString()
   {
-    if (thisString == null)
+    synchronized (urlloaders)
       {
-	StringBuffer sb = new StringBuffer();
-	sb.append(this.getClass().getName());
-	sb.append("{urls=[" );
-	URL[] thisURLs = getURLs();
-	for (int i = 0; i < thisURLs.length; i++)
+	if (thisString == null)
 	  {
-	    sb.append(thisURLs[i]);
-	    if (i < thisURLs.length - 1)
-	      sb.append(',');
+	    StringBuffer sb = new StringBuffer();
+	    sb.append(this.getClass().getName());
+	    sb.append("{urls=[" );
+	    URL[] thisURLs = getURLs();
+	    for (int i = 0; i < thisURLs.length; i++)
+	      {
+		sb.append(thisURLs[i]);
+		if (i < thisURLs.length - 1)
+		  sb.append(',');
+	      }
+	    sb.append(']');
+	    sb.append(", parent=");
+	    sb.append(getParent());
+	    sb.append('}');
+	    thisString = sb.toString();
 	  }
-	sb.append(']');
-	sb.append(", parent=");
-	sb.append(getParent());
-	sb.append('}');
-	thisString = sb.toString();
+	return thisString;
       }
-    return thisString;
   }
 
   /**




More information about the kaffe mailing list