Merge branch 'pr-549'
This commit is contained in:
@ -23,11 +23,11 @@ public class ASTType extends AbstractJavaTypeNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getTypeImage() {
|
public String getTypeImage() {
|
||||||
ASTPrimitiveType prim = getFirstDescendantOfType(ASTPrimitiveType.class);
|
ASTClassOrInterfaceType refType = getFirstDescendantOfType(ASTClassOrInterfaceType.class);
|
||||||
if (prim != null) {
|
if (refType != null) {
|
||||||
return prim.getImage();
|
return refType.getImage();
|
||||||
}
|
}
|
||||||
return getFirstDescendantOfType(ASTClassOrInterfaceType.class).getImage();
|
return getFirstDescendantOfType(ASTPrimitiveType.class).getImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getArrayDepth() {
|
public int getArrayDepth() {
|
||||||
|
@ -1531,4 +1531,22 @@ public class Something {
|
|||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
</test-code>
|
</test-code>
|
||||||
|
|
||||||
|
<test-code>
|
||||||
|
<description>#521 UnusedPrivateMethod returns false positives with primitive data type in map argument</description>
|
||||||
|
<expected-problems>0</expected-problems>
|
||||||
|
<code><![CDATA[
|
||||||
|
public class Foo {
|
||||||
|
public Foo() {
|
||||||
|
Map<String, double[]> map = new LinkedHashMap<>();
|
||||||
|
addToMap(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addToMap(Map<String, double[]> map) {
|
||||||
|
map.put("foo", new double[]{0., 1.});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</test-code>
|
||||||
|
|
||||||
</test-data>
|
</test-data>
|
||||||
|
@ -13,6 +13,7 @@ This is a major release.
|
|||||||
* [Java Type Resolution](#Java_Type_Resolution)
|
* [Java Type Resolution](#Java_Type_Resolution)
|
||||||
* [Metrics Framework](#Metrics_Framework)
|
* [Metrics Framework](#Metrics_Framework)
|
||||||
* [Configuration Error Reporting](#Configuration_Error_Reporting)
|
* [Configuration Error Reporting](#Configuration_Error_Reporting)
|
||||||
|
* [Java Symbol Table](#Java_Symbol_Table)
|
||||||
* [Modified Rules](#Modified_Rules)
|
* [Modified Rules](#Modified_Rules)
|
||||||
* [Removed Rules](#Removed_Rules)
|
* [Removed Rules](#Removed_Rules)
|
||||||
* [Fixed Issues](#Fixed_Issues)
|
* [Fixed Issues](#Fixed_Issues)
|
||||||
@ -79,6 +80,13 @@ and include them to such reports.
|
|||||||
* The deprecated rule `UseSingleton` has been removed from the ruleset `java-design`. The rule has been renamed
|
* The deprecated rule `UseSingleton` has been removed from the ruleset `java-design`. The rule has been renamed
|
||||||
long time ago to `UseUtilityClass`.
|
long time ago to `UseUtilityClass`.
|
||||||
|
|
||||||
|
|
||||||
|
#### Java Symbol Table
|
||||||
|
|
||||||
|
* A [bug in symbol table](https://github.com/pmd/pmd/pull/549/commits/0958621ca884a8002012fc7738308c8dfc24b97c) prevented
|
||||||
|
the symbol table analysis to properly match primitive arrays types. The issue [affected the `java-unsedcode/UnusedPrivateMethod`](https://github.com/pmd/pmd/issues/521)
|
||||||
|
rule, but other rules may now produce improved results as consequence of this fix.
|
||||||
|
|
||||||
### Fixed Issues
|
### Fixed Issues
|
||||||
|
|
||||||
* apex
|
* apex
|
||||||
@ -95,6 +103,8 @@ and include them to such reports.
|
|||||||
* [#408](https://github.com/pmd/pmd/issues/408): \[java] DFA not analyzing asserts
|
* [#408](https://github.com/pmd/pmd/issues/408): \[java] DFA not analyzing asserts
|
||||||
* java-sunsecure
|
* java-sunsecure
|
||||||
* [#468](https://github.com/pmd/pmd/issues/468): \[java] ArrayIsStoredDirectly false positive
|
* [#468](https://github.com/pmd/pmd/issues/468): \[java] ArrayIsStoredDirectly false positive
|
||||||
|
* java-unusedcode
|
||||||
|
* [#521](https://github.com/pmd/pmd/issues/521): \[java] UnusedPrivateMethod returns false positives with primitive data type in map argument
|
||||||
* java-unnecessarycode
|
* java-unnecessarycode
|
||||||
* [#412](https://github.com/pmd/pmd/issues/412): \[java] java-unnecessarycode/UnnecessaryFinalModifier missing cases
|
* [#412](https://github.com/pmd/pmd/issues/412): \[java] java-unnecessarycode/UnnecessaryFinalModifier missing cases
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user