From c0c79e522f22b87d78070e7e221fa57eaf420e32 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 4 Sep 2015 21:48:18 +0200 Subject: [PATCH] #1371 fix unit test --- .../rule/strings/InsufficientStringBufferDeclarationRule.java | 2 -- .../rule/strings/xml/InsufficientStringBufferDeclaration.xml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/strings/InsufficientStringBufferDeclarationRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/strings/InsufficientStringBufferDeclarationRule.java index c2c79ebb65..1a167da5d4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/strings/InsufficientStringBufferDeclarationRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/strings/InsufficientStringBufferDeclarationRule.java @@ -211,8 +211,6 @@ public class InsufficientStringBufferDeclarationRule extends AbstractJavaRule { } } } - StringBuffer sb = new StringBuffer(); - sb.append(3); return anticipatedLength; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/strings/xml/InsufficientStringBufferDeclaration.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/strings/xml/InsufficientStringBufferDeclaration.xml index e8704306af..c56f42f5a8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/strings/xml/InsufficientStringBufferDeclaration.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/strings/xml/InsufficientStringBufferDeclaration.xml @@ -991,7 +991,7 @@ public class Test { public class StringBufferTest { public void test() { final StringBuffer stringBuffer = new StringBuffer().append("Added ").append(" a "); - stringBuffer.append("string "); + stringBuffer.append("string longer than 16 characters"); } } ]]>