Add some tests to reproduce reported bugs

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7636 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse
2012-02-28 09:40:10 +00:00
parent 3bd0358b76
commit 01cb7b943d
3 changed files with 28 additions and 0 deletions

View File

@ -27,6 +27,7 @@ TODO - Release blockers - Must implement before this release can be finally fini
and pmd-java:typeof).
Fixed bug 3470274: Using Label for lines in XMLRenderer
Fixed bug 3175710: NPE in InsufficientStringBufferDeclaration
---

View File

@ -80,4 +80,20 @@ public class Foo {
}
]]></code>
</test-code>
<test-code regressionTest="false">
<description><![CDATA[
[3394465] False positive for UselessStringValueOf
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class TestClass {
public void testMethod() {
char[] idFormat = {'0', '0', '0', '0', '0'};
String abc = "1" + String.valueOf(idFormat);
System.out.println(abc); // Output 100000
}
}
]]></code>
</test-code>
</test-data>

View File

@ -135,6 +135,17 @@ Interface with array declaration
<code><![CDATA[
public interface Foo {
public String[] getArr();
}
]]></code>
</test-code>
<test-code regressionTest="false">
<description><![CDATA[
3220206: False positive using a ternary operator
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public byte[] getContent() {
return this.content == null ? null : content.clone();
}
]]></code>
</test-code>