In intellij (with sonarlint 8.5.1.7509 connected to Sonarqube 9.9.0.65466) the quick fix for
public void foo(TreeMap<Object, Object> map) {
map.lowerKey(new Object());
}
is to replace TreeMap
with SortedMap
, but lowerKey
is not a member of SortedMap
. The fix should suggest NavigableMap
, which declares the method. The equivalent problem exists for lower
with TreeSet
.