A long, long time ago, I wrote the following code:
private String intern(String s)
{
int l = s.length();
if (l==0) return "";
// Trim away internal fragmentation memory from the string
s = (new StringBuffer(l)).append(s).toString();
return s.intern();
}
Clearly I wouldn't have gone to all this trouble unless I was fixing
a real problem, but I didn't keep any notes on how I reached this
conclusion. Is it the case that if you intern a string for the first
time, and that string has internal fragmentation, that the whole
space-wasting string gets interned? Anyone have a reference on that
issue?
-Joshua
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden