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

RFE: Replace uses of StringBuffer with StringBuilder

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • client-libs
    • 2d
    • tiger
    • generic
    • solaris_9

      New in 1.5, StringBuilder is a drop in replacement for StringBuffer but is
      supposed to be faster due to being unsynchronised, it certainly will not be
      slower.

      There are a small number of places, certainly in 2D code and perhaps across
      other class libraries we should make this replacement as at least some of these
      uses affect start-up time.
      (The compiler is already being updated to use StringBuilder for "+" style
      string concatenations).
      The 2D ones that sprint to mind are on Solaris in X11GraphicsEnvironment
      and MFontConfiguration. The latter reads a properties file and whilst what's
      probably needed is to rework that entirely there may also be some benefit
      from java.util.Properties using StringBuilder internally (it currently
      uses StringBuffer).

      It may be "noise" in terms of start-up performance but the risk is low and
      the change simple.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: