koraktor/mavanagaiata

View on GitHub
src/main/java/com/github/koraktor/mavanagaiata/mojo/TagMojo.java

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings
Open

                describe += dirtyFlag;

UseStringBufferForStringAppends

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

The use of the '+=' operator for appending strings causes the JVM to create and use an internal StringBuffer. If a non-trivial number of these concatenations are being used then the explicit use of a StringBuilder or threadsafe StringBuffer is recommended to avoid this.

Example:

public class Foo {
 void bar() {
 String a;
 a = 'foo';
 a += ' bar';
 // better would be:
 // StringBuilder a = new StringBuilder('foo');
 // a.append(' bar');
 }
}

There are no issues that match your filters.

Category
Status