I don’t know, if this example hits it exactly. But let’s try.
In Eclipse (SonarLint) this line is NOT complained about. But Qube does. The project is bound to Qube.
public void foo()
{
Runnable r = () ->
{
for ( X x : xs )
{
String s = (String) x.getObject(); // FP
}
};
}
The X.getObject() method returns an Object. Hence the cast to String is necessary.
There are some other cases, where this is wrong. All of them seem to be inside a lambda expression. Don’t know, if that matters.