Repository navigation
Conversation
…s in a loop. The method is building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuilder explicitly. http://findbugs.sourceforge.net/bugDescriptions.html#SBSC_USE_STRINGBUFFER_CONCATENATION
davsclaus
approved these changes
Oct 10, 2017
Contributor
|
I'm gonna merge this |
oscerd
approved these changes
Oct 11, 2017
Contributor
|
@oscerd oh I just merged There is a build error in this example, I wonder if you could take a look |
Contributor
|
Thanks for the PR it has been merged. Do you mind closing this? |
Contributor
Author
|
Thanks. |
Contributor
|
@davsclaus I'll take a look :-) |
Contributor
|
@davsclaus I can't reproduce the error on my side. Not sure why. |
…a in a loop. The method is building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuilder explicitly. http://findbugs.sourceforge.net/bugDescriptions.html#SBSC_USE_STRINGBUFFER_CONCATENATION
Contributor
|
@brucekuiliu you need to create a new PR you cannot reopen old ones that has been merged. |
Contributor
Author
|
I see, many thanks. |
Croway
pushed a commit
to Croway/camel
that referenced
this pull request
Mar 14, 2024
[ENTESB-18702] Experimental lazy loading of file attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The method is building a String using concatenation in a loop.
In each iteration, the String is converted to a StringBuilder, appended to, and converted back to a String.
This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.
Better performance can be obtained by using a StringBuilder explicitly.
http://findbugs.sourceforge.net/bugDescriptions.html#SBSC_USE_STRINGBUFFER_CONCATENATION