+2005-03-09 Tom Tromey <tromey@redhat.com>
+
+ * java/net/URLClassLoader.java (addURLImpl): Reset 'thisString'.
+ (toString): Synchronize.
+
2005-03-08 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.lang/pr13107_2.xfail: Remove xfail.
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);
*/
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;
}
/**