forked from phoedos/pmd
Renamed AvoidConcatenatingNonLiteralsInStringBuffer to InefficientStringBuffering; new name is a bit more concise.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3950 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -18,6 +18,7 @@ Fixed bug 1314086 - Added logging-jakarta-commons as a short name for rulesets/l
|
|||||||
Implemented RFE 1311309 - Suppressed RuleViolation counts are now included in the reports.
|
Implemented RFE 1311309 - Suppressed RuleViolation counts are now included in the reports.
|
||||||
Implemented RFE 1220371 - Rule violation suppression via annotations. Per the JLS, @SuppressWarnings can be placed before the following nodes: TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE.
|
Implemented RFE 1220371 - Rule violation suppression via annotations. Per the JLS, @SuppressWarnings can be placed before the following nodes: TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE.
|
||||||
Applied patch 1306999 - Renamed CloseConnection to CloseResource and added support for checking Statement and ResultSet objects.
|
Applied patch 1306999 - Renamed CloseConnection to CloseResource and added support for checking Statement and ResultSet objects.
|
||||||
|
Renamed AvoidConcatenatingNonLiteralsInStringBuffer to InefficientStringBuffering; new name is a bit more concise.
|
||||||
Implemented RFE 1275547 - OverrideBothEqualsAndHashcode now skips Comparator implementations.
|
Implemented RFE 1275547 - OverrideBothEqualsAndHashcode now skips Comparator implementations.
|
||||||
|
|
||||||
September 15, 2005 - 3.3:
|
September 15, 2005 - 3.3:
|
||||||
|
@ -8,12 +8,12 @@ import net.sourceforge.pmd.Rule;
|
|||||||
import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
|
import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
|
||||||
import test.net.sourceforge.pmd.testframework.TestDescriptor;
|
import test.net.sourceforge.pmd.testframework.TestDescriptor;
|
||||||
|
|
||||||
public class AvoidConcatenatingNonLiteralsInStringBufferTest extends SimpleAggregatorTst {
|
public class InefficientStringBufferingTest extends SimpleAggregatorTst {
|
||||||
|
|
||||||
private Rule rule;
|
private Rule rule;
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
rule = findRule("strings", "AvoidConcatenatingNonLiteralsInStringBuffer");
|
rule = findRule("strings", "InefficientStringBuffering");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAll() {
|
public void testAll() {
|
@ -67,9 +67,9 @@ public class Foo {
|
|||||||
</example>
|
</example>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule name="AvoidConcatenatingNonLiteralsInStringBuffer"
|
<rule name="InefficientStringBuffering"
|
||||||
message="Avoid concatenating nonliterals in a StringBuffer constructor or append()"
|
message="Avoid concatenating nonliterals in a StringBuffer constructor or append()"
|
||||||
class="net.sourceforge.pmd.rules.AvoidConcatenatingNonLiteralsInStringBuffer">
|
class="net.sourceforge.pmd.rules.InefficientStringBuffering">
|
||||||
<description>
|
<description>
|
||||||
Avoid concatenating non literals in a StringBuffer constructor or append().
|
Avoid concatenating non literals in a StringBuffer constructor or append().
|
||||||
</description>
|
</description>
|
||||||
|
@ -21,7 +21,7 @@ import net.sourceforge.pmd.ast.Node;
|
|||||||
*
|
*
|
||||||
* @author mgriffa
|
* @author mgriffa
|
||||||
*/
|
*/
|
||||||
public class AvoidConcatenatingNonLiteralsInStringBuffer extends AbstractRule {
|
public class InefficientStringBuffering extends AbstractRule {
|
||||||
|
|
||||||
public Object visit(ASTAdditiveExpression node, Object data) {
|
public Object visit(ASTAdditiveExpression node, Object data) {
|
||||||
ASTBlockStatement bs = (ASTBlockStatement) node.getFirstParentOfType(ASTBlockStatement.class);
|
ASTBlockStatement bs = (ASTBlockStatement) node.getFirstParentOfType(ASTBlockStatement.class);
|
Reference in New Issue
Block a user