pmd: fix #975 false positive in ClassCastExceptionWithToArray
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
????? ??, 2013 - 5.0.3:
|
????? ??, 2013 - 5.0.3:
|
||||||
|
|
||||||
Fixed bug 968: Issues with JUnit4 @Test annotation with expected exception (Thanks to Yiannis Paschalidis)
|
Fixed bug 968: Issues with JUnit4 @Test annotation with expected exception (Thanks to Yiannis Paschalidis)
|
||||||
|
Fixed bug 975: false positive in ClassCastExceptionWithToArray
|
||||||
Fixed bug 976: UselessStringValueOf wrong when appending character arrays
|
Fixed bug 976: UselessStringValueOf wrong when appending character arrays
|
||||||
Fixed bug 977: MisplacedNullCheck makes false positives
|
Fixed bug 977: MisplacedNullCheck makes false positives
|
||||||
Fixed bug 984: Cyclomatic complexity should treat constructors like methods
|
Fixed bug 984: Cyclomatic complexity should treat constructors like methods
|
||||||
|
@@ -297,7 +297,7 @@ in a ClassCastException.
|
|||||||
<value>
|
<value>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
//CastExpression[Type/ReferenceType/ClassOrInterfaceType[@Image !=
|
//CastExpression[Type/ReferenceType/ClassOrInterfaceType[@Image !=
|
||||||
"Object"]]//PrimaryExpression
|
"Object"]]/PrimaryExpression
|
||||||
[
|
[
|
||||||
PrimaryPrefix/Name[ends-with(@Image, '.toArray')]
|
PrimaryPrefix/Name[ends-with(@Image, '.toArray')]
|
||||||
and
|
and
|
||||||
|
@@ -46,4 +46,22 @@ public class Foo {
|
|||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
</test-code>
|
</test-code>
|
||||||
|
|
||||||
|
<test-code>
|
||||||
|
<description>#975 false positive in ClassCastExceptionWithToArray</description>
|
||||||
|
<expected-problems>0</expected-problems>
|
||||||
|
<code><![CDATA[
|
||||||
|
import org.apache.commons.dbutils.*;
|
||||||
|
import org.apache.commons.dbutils.handlers.*;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
public void foo() {
|
||||||
|
QueryRunner qr = getQueryRunner();
|
||||||
|
List<?> parms = new java.util.ArrayList();
|
||||||
|
// public <T> T QueryRunner.query(String sql, ResultSetHandler<T> rsh, Object... params)
|
||||||
|
String result = (String) qr.query( sql, new ScalarHandler(), parms.toArray() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</test-code>
|
||||||
</test-data>
|
</test-data>
|
||||||
|
Reference in New Issue
Block a user