Commit 41041fc2 by Tom Tromey Committed by Tom Tromey

URLClassLoader.java (addURLImpl): Reset 'thisString'.

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

From-SVN: r96205
parent d3592adf
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> 2005-03-08 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.lang/pr13107_2.xfail: Remove xfail. * testsuite/libjava.lang/pr13107_2.xfail: Remove xfail.
......
...@@ -799,6 +799,9 @@ public class URLClassLoader extends SecureClassLoader ...@@ -799,6 +799,9 @@ public class URLClassLoader extends SecureClassLoader
if (newUrl == null) if (newUrl == null)
return; // Silently ignore... return; // Silently ignore...
// Reset the toString() value.
thisString = null;
// Check global cache to see if there're already url loader // Check global cache to see if there're already url loader
// for this url. // for this url.
URLLoader loader = (URLLoader) urlloaders.get(newUrl); URLLoader loader = (URLLoader) urlloaders.get(newUrl);
...@@ -1020,25 +1023,28 @@ public class URLClassLoader extends SecureClassLoader ...@@ -1020,25 +1023,28 @@ public class URLClassLoader extends SecureClassLoader
*/ */
public String toString() public String toString()
{ {
if (thisString == null) synchronized (urlloaders)
{ {
StringBuffer sb = new StringBuffer(); if (thisString == null)
sb.append(this.getClass().getName());
sb.append("{urls=[" );
URL[] thisURLs = getURLs();
for (int i = 0; i < thisURLs.length; i++)
{ {
sb.append(thisURLs[i]); StringBuffer sb = new StringBuffer();
if (i < thisURLs.length - 1) sb.append(this.getClass().getName());
sb.append(','); 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(']'); return thisString;
sb.append(", parent=");
sb.append(getParent());
sb.append('}');
thisString = sb.toString();
} }
return thisString;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment