jborgers / PMD-jPinpoint-rules

PMD rule set for responsible Java and Kotlin coding: performance, sustainability, multi-threading, data mixup and more.
Apache License 2.0
43 stars 10 forks source link

Fix Request for NonComparableMapKeys: false positives for boxed primitives #421

Closed jborgers closed 1 week ago

jborgers commented 1 week ago
import java.util.HashMap;
import java.util.Map;

public final class Foo {
    final int key = 3;
    void foo() {
        Map<Integer, Integer> map = new HashMap<>();
        map.put(1,2); // <--- false positive
        map.put(key, 4); // <--- false positive
    }
}