Menu

#1342 UseConcurrentHashMap false positive (with documentation example)

PMD-5.3.2
closed
None
PMD
3-Major
Bug
2015-04-30
2015-04-28
Rei Angelus
No

If we declare an map with the interface Map by instantiate it with ConcurrentHashMap (such as the PMD documentation example), an "Use Concurrent Hash Map" error occurs.

:::xml
<test-code>
<description><![CDATA
UseConcurrentHashMap false positive (with documentation example)
]></description>
<expected-problems>0</expected-problems>
<![CDATA[
public class ConcurrentApp {
public void getMyInstance() {

Map map2 = new ConcurrentHashMap();  // preferred for use with multiple threads

}
}
]]>

</test-code>

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-04-30
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.2
     

Log in to post a comment.