[java:S4276] ObjIntConsumer no better than BiConsumer for all box types

Using this type:

BiConsumer< Integer, Integer >

is suggested to be replaced by

ObIntConsumer< Integer >

In this sspecial case this is not an improvement and the rule should not hit.

Of course this will also apply to other functional interfaces and generic types.

Hi Marvin,

Thank you for your message. Indeed sometimes such suggestions from the rule S4276 seem to be questionable.

I’ve created a ticket to not report issues in these cases:

https://jira.sonarsource.com/browse/SONARJAVA-3776

Feel free to have a look and share your thoughts, whether you do not agree with it.

Kind regards,
Margarita

Thanks, Margarita. Looks very fine.

Cheers

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