[Java:S1125] Not redundant, if one case is null

public void foo( Boolean b ) {}

boolean b = ...;
foo( b ? true : null ); // FP

Please don’t ask for sense here. It’s just a stripped down example. But you can see, there is no redundant boolean literal here, since the else case of ternary operator is not false, but null.

Hello Marvin,

Thank you for your report. I have created a ticket.

Cheers,
Sebastian

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