Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6914123

(str) Missing synchronization in java.lang.String#contentEquals(CharSequence)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6u10
    • Fix Version/s: 8
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b52
    • CPU:
      x86
    • OS:
      windows_vista
    • Verification:
      Not verified

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jgish Jim Gish
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: