Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1107

[PATCH] Cleanup inefficient StringBuffer code

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8.0
    • Component/s: None
    • Labels:
      None

      Description

      StringBuffers are used through the code, but in a way that reduces their performance below, perhaps, what normal String concatenation would be.

      Doing

      StringBuffer s = new StringBuffer();
      s.append(a + b);

      is the same as

      StringBuffer s = new StringBuffer();
      s.append(new StringBuffer(a).append(b).toString());

      So, don't do normal concatentation in an append call, since one went to the trouble to use StringBuffer's in the first place.

        Attachments

          Activity

            People

            • Assignee:
              mrglavas@ca.ibm.com Michael Glavassevich
              Reporter:
              dbrosius Dave Brosius
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: