This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: MAXPATHLEN usage - PR21821
Bryce> Why couldn't StringBuilder do sharing with copy-on-write, like
Bryce> java.lang.StringBuffer does?
StringBuilder is unsynchronized, and StringBuilder.toString() doesn't
have "hand-off" semantics -- it keeps the data in the StringBuilder.
So, if you avoid copying there will be a window where the user could
potentially mutate a String. There was a thread about this a while
back on classpath-patches.
Tom