Xerces2-J
  1. Xerces2-J
  2. XERCESJ-1107

[PATCH] Cleanup inefficient StringBuffer code

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor 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.

      1. sb_cleanup.diff
        12 kB
        Dave Brosius

        Activity

        Dave Brosius created issue -
        Dave Brosius made changes -
        Field Original Value New Value
        Attachment sb_cleanup.diff [ 12315044 ]
        Michael Glavassevich made changes -
        Assignee Michael Glavassevich [ mrglavas@ca.ibm.com ]
        Michael Glavassevich made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Michael Glavassevich added a comment -

        Thanks Dave, your patch is in SVN.

        Show
        Michael Glavassevich added a comment - Thanks Dave, your patch is in SVN.
        Michael Glavassevich made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael Glavassevich made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Michael Glavassevich added a comment -

        Reopening so that I can update the fix version field.

        Show
        Michael Glavassevich added a comment - Reopening so that I can update the fix version field.
        Michael Glavassevich made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Michael Glavassevich made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 2.8.0 [ 12310842 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12331435 ] Default workflow, editable Closed status [ 12575330 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12575330 ] jira [ 12598001 ]

          People

          • Assignee:
            Michael Glavassevich
            Reporter:
            Dave Brosius
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development