incubator-awf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Stevenson (Moved) (JIRA)" <>
Subject [jira] [Moved] (AWF-7) Use StringBuilder instead of String concatenation in for loop
Date Wed, 29 Feb 2012 10:09:59 GMT


Tony Stevenson moved DEFT-39 to AWF-7:

    Reporter: Niklas Gustavsson
         Key: AWF-7  (was: DEFT-39)
     Project: Apache AWF  (was: Deft)
> Use StringBuilder instead of String concatenation in for loop
> -------------------------------------------------------------
>                 Key: AWF-7
>                 URL:
>             Project: Apache AWF
>          Issue Type: Bug
>            Reporter: Niklas Gustavsson
> re: HttpResponse.createInitalLineAndHeaders
> Ran CodePro tools -> Audit code using -> Effective Java, and found this.
> Explanation: The code to concatenate two strings is not very efficient because it creates
a StringBuffer for each concatenation. When placed in a loop, this can result in the creation
and collection of large numbers of temporary objects. You can create the StringBuffer before
entering the loop, and append to it within the loop, thus reducing the overhead.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message