[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:


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

Kind regards,

Thanks, Margarita. Looks very fine.


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