Merge branch 'pr/3277'

refs #3277
This commit is contained in:
Clément Fournier committed 2021-05-28 13:01:02 +02:00
commit b520361d71
4 files changed
+411 -125

No files matched your search

+2
View File
@@ -121,6 +121,8 @@ This release ships with 3 new Java rules.
* [#3248](https://github.com/pmd/pmd/issues/3248): \[java] Documentation is wrong for SingletonClassReturningNewInstance rule
* [#3249](https://github.com/pmd/pmd/pull/3249): \[java] AvoidFieldNameMatchingTypeName: False negative with interfaces
* [#3268](https://github.com/pmd/pmd/pull/3268): \[java] ConstructorCallsOverridableMethod: IndexOutOfBoundsException with annotations
* java-performance
* [#1438](https://github.com/pmd/pmd/issues/1438): \[java] InsufficientStringBufferDeclaration false positive for initial calculated StringBuilder size
* javascript
* [#699](https://github.com/pmd/pmd/issues/699): \[javascript] Update Rhino library to 1.7.13
* [#2081](https://github.com/pmd/pmd/issues/2081): \[javascript] Failing with OutOfMemoryError parsing a Javascript file
@@ -517,7 +517,7 @@ sb.append(System.getProperty("java.io.tmpdir"));
<rule name="InsufficientStringBufferDeclaration"
language="java"
since="3.6"
message="StringBuffer constructor is initialized with size {0}, but has at least {1} characters appended."
message="{0} has been initialized with size {1}, but has at least {2} characters appended."
class="net.sourceforge.pmd.lang.java.rule.performance.InsufficientStringBufferDeclarationRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_performance.html#insufficientstringbufferdeclaration">
<description>
@@ -530,10 +530,10 @@ is assumed if the length of the constructor can not be determined.
<priority>3</priority>
<example>
<![CDATA[
StringBuffer bad = new StringBuffer();
StringBuilder bad = new StringBuilder();
bad.append("This is a long string that will exceed the default 16 characters");
StringBuffer good = new StringBuffer(41);
StringBuilder good = new StringBuilder(41);
good.append("This is a long string, which is pre-sized");
]]>
</example>