java:S1612: lambda performing instanceof check is not reported as code smell

Versions:

In this code snippet, there are two lambdas that can be replaced with method references, yet only one is reported:

I expected to see suggestion for using StringInverterPhotovoltaicGridTieSystem.class::isInstance method reference as well.

Hey @grimsa

Thanks for your feedback. I would rather say it’s not a bug this rule just doesn’t support instanceof check in lambda.

I’ve created a ticket to cover this case.

Regards,
Margarita

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.