-
Bug
-
Resolution: Fixed
-
P4
-
6u10
-
b52
-
x86
-
windows_vista
-
Not verified
FULL PRODUCT VERSION :
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
java.lang.String#contentEquals(StringBuffer) synchronizes on the given StringBuffer. This is correct.
java.lang.String#contentEquals(CharSequence) does not synchronize on StringBuffers. This is not correct.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Look at the source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
str.contentEquals((CharSequence) new StringBuffer()) should synchronize on the given StringBuffer.
ACTUAL -
str.contentEquals((CharSequence) new StringBuffer()) does not synchronize on the given StringBuffer.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
java.lang.String#contentEquals(StringBuffer) synchronizes on the given StringBuffer. This is correct.
java.lang.String#contentEquals(CharSequence) does not synchronize on StringBuffers. This is not correct.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Look at the source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
str.contentEquals((CharSequence) new StringBuffer()) should synchronize on the given StringBuffer.
ACTUAL -
str.contentEquals((CharSequence) new StringBuffer()) does not synchronize on the given StringBuffer.
REPRODUCIBILITY :
This bug can be reproduced always.
- relates to
-
JDK-4982981 Methods that work with StringBuffer have no StringBuilder equivalent
-
- Resolved
-
-
JDK-8014477 (str) Race condition in String.contentEquals when comparing with StringBuffer
-
- Closed
-