You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
The rule suggests replacing when (a) the subtype cannot be replaced due to the api contract and (b) Properties now delegates to a ConcurrentHashMap. This rule should not apply to subtypes where the api is out of the author's control.
Code Sample demonstrating the issue:
JCache returns Properties in its api, so this code is flagged.
Expected outcome:
PMD reports a violation, but the user cannot make the suggested refactoring.
#
File
Line
Problem
1
jcache/CacheManagerImpl.java
48
Consider replacing this Hashtable with the newer java.util.Map
Affects PMD Version:
7.0-rc1 upgrading from 6.55
Rule:
ReplaceHashtableWithMap
Description:
The rule suggests replacing when (a) the subtype cannot be replaced due to the api contract and (b) Properties now delegates to a ConcurrentHashMap. This rule should not apply to subtypes where the api is out of the author's control.
Code Sample demonstrating the issue:
JCache returns Properties in its api, so this code is flagged.
Expected outcome:
PMD reports a violation, but the user cannot make the suggested refactoring.
Running PMD through: Gradle
This requires workaround in gradle/gradle#24502
The text was updated successfully, but these errors were encountered: