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

(str) Excess Synchronisation: Replace StringBuffer by StringBuilder when possible

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      Since Java 5.0, StringBuilder has been introduced.
      This is a great performance enhancement in server application.

      A lot of java.* et javax.* still use old synchronized StringBuffer with no need as
      java.net.URLDecoder.decode(String, String) for exemple.

      It just can be simply replaced by StringBuilder instead.


      JUSTIFICATION :
      Synchronisation is costly, especially in high load multithreaded application wich are developped to limit synchronisation cost.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Replace StringBuffer by StringBuilder in the Java APIs where no synchronisation is needed.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: