This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]