Affects PMD Version: 6.44.0
Rule: LooseCouplingRule
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#loosecoupling
Description:
Code Sample demonstrating the issue:
public class TheClass {
private ObjectMapper objectMapper = new ObjectMapper();
public BiMap<String, Integer> getCountriesDictionary() throws IOException {
final Map<String, Integer> out = objectMapper.readValue(".....", HashMap.class);
return HashBiMap.create(out);
}
}
Expected outcome:
PMD reports a violation at line objectMapper.readValue(".....", HashMap.class);, but that's wrong. That's a false positive.
Running PMD through: Gradle
Affects PMD Version: 6.44.0
Rule: LooseCouplingRule
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#loosecoupling
Description:
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line
objectMapper.readValue(".....", HashMap.class);, but that's wrong. That's a false positive.Running PMD through: Gradle