You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Dave Brosius (JIRA)" <xe...@xml.apache.org> on 2005/10/22 08:37:19 UTC

[jira] Created: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

[PATCH] Cleanup inefficient StringBuffer code
---------------------------------------------

         Key: XERCESJ-1107
         URL: http://issues.apache.org/jira/browse/XERCESJ-1107
     Project: Xerces2-J
        Type: Improvement
    Versions: 2.7.1    
    Reporter: Dave Brosius
    Priority: Minor


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Updated: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Dave Brosius (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]

Dave Brosius updated XERCESJ-1107:
----------------------------------

    Attachment: sb_cleanup.diff

> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Priority: Minor
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Reopened: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]
     
Michael Glavassevich reopened XERCESJ-1107:
-------------------------------------------


Reopening so that I can update the fix version field.

> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Assignee: Michael Glavassevich
>     Priority: Minor
>      Fix For: 2.8.0
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Closed: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]
     
Michael Glavassevich closed XERCESJ-1107:
-----------------------------------------


> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Assignee: Michael Glavassevich
>     Priority: Minor
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Assigned: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]

Michael Glavassevich reassigned XERCESJ-1107:
---------------------------------------------

    Assign To: Michael Glavassevich

> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Assignee: Michael Glavassevich
>     Priority: Minor
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Closed: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]
     
Michael Glavassevich closed XERCESJ-1107:
-----------------------------------------

    Fix Version: 2.8.0
     Resolution: Fixed

> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Assignee: Michael Glavassevich
>     Priority: Minor
>      Fix For: 2.8.0
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Resolved: (XERCESJ-1107) [PATCH] Cleanup inefficient StringBuffer code

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]
     
Michael Glavassevich resolved XERCESJ-1107:
-------------------------------------------

    Resolution: Fixed

Thanks Dave, your patch is in SVN.

> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
>          Key: XERCESJ-1107
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1107
>      Project: Xerces2-J
>         Type: Improvement
>     Versions: 2.7.1
>     Reporter: Dave Brosius
>     Assignee: Michael Glavassevich
>     Priority: Minor
>  Attachments: sb_cleanup.diff
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org