FP on S1319 when using methods not from interface

In sonarlint in intellij connected to Sonarqube,

public void foo(ConcurrentHashMap<?,?> map) {
	map.forEachEntry(1, e->{});

has a false positives for java:S1319. The parameter cannot be replaced with any superinterface of ConcurrentHashMap because forEachEntry is not declared in any interface. I think it’s pretty rare to use a method on a Collection that isn’t declared in one of the collections interfaces, but it seems like doing so should prevent the rule from raising an issue. At the very least, there should be no quick fix in such cases, since applying it introduces a compile error.

Hi @Connor_Balin,

Thank you for reporting.
This is indeed FP, and here is a ticket to track progress [SONARJAVA-4590] - Jira

All the best,