incubator-awf-dev mailing list archives

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

     [ https://issues.apache.org/jira/browse/AWF-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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: https://issues.apache.org/jira/browse/AWF-7
>             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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message