RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

Peter Levart peter.levart at gmail.com
Mon May 13 22:34:05 UTC 2013

On 05/14/2013 12:09 AM, Peter Levart wrote:
> I noticed a synchronization bug in String.contentEquals method. If 
> called with a StringBuffer argument while concurrent thread is 
> modifying the StringBuffer, the method can either throw 
> ArrayIndexOutOfBoundsException or return true even though the content 
> of the StringBuffer has never been the same as the String's.
> Here's a proposed patch:
> http://cr.openjdk.java.net/~plevart/jdk8-tl/String.contentEquals/webrev.01/
> Regards, Peter

Or even better (with some code clean-up):


Regards, Peter

More information about the core-libs-dev mailing list