isRegularFile in lambda/method reference

I would like to ask about one thing which I don’t understand.
When I use

f -> Files.isRegularFile( f )

there is a major code smell that Java 8’s “Files.exists” should not be used (squid:S3725).

But when I replace it with


the warning disappears. Why is so?
Looks like some inconsistency, the same method is called.

1 Like

Thank you very much for the feedback : this is indeed inconsistent for that rule and this problem is very likely impacting other rules.

Ticket created to handle the issue :


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