trims strings by copying them, to avoid retaining excessively large strings.

This commit is contained in:
beard%netscape.com 2000-09-09 04:22:06 +00:00
parent 9bc9544d23
commit b69d93c128

View File

@ -45,7 +45,8 @@ class StringTable {
public String intern(String str) {
String result = (String) strings.get(str);
if (result == null) {
result = str;
// copy the string, to trim to minimum size.
result = str = new String(str);
strings.put(str, str);
}
return result;