Description
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):
http://cr.openjdk.java.net/~plevart/jdk8-tl/String.contentEquals/webrev.02/
>> 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):
http://cr.openjdk.java.net/~plevart/jdk8-tl/String.contentEquals/webrev.02/
Attachments
Issue Links
- relates to
-
JDK-6914123 (str) Missing synchronization in java.lang.String#contentEquals(CharSequence)
- Closed