URLClassLoader.java (addURLImpl): Reset 'thisString'.
* java/net/URLClassLoader.java (addURLImpl): Reset 'thisString'. (toString): Synchronize. From-SVN: r96205
This commit is contained in:
parent
d3592adfe0
commit
41041fc2ac
2 changed files with 26 additions and 15 deletions
|
@ -799,6 +799,9 @@ public class URLClassLoader extends SecureClassLoader
|
|||
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);
|
||||
|
@ -1020,25 +1023,28 @@ public class URLClassLoader extends SecureClassLoader
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue