javabugs:S6555 vs java:S2259

Hello,

The javabugs:S6555 and java:S2259 rules look very similar. Can someone please explain the difference between them?

Are they coming from 2 different rulesets somehow?

Thank you.

Hi,

The underlying concept is pretty much the same. The javabugs version is a newer implementation on a more robust underlying engine.

AFAIK, we’ve stopped maintaining java:S2259 but haven’t quite figured out what to do with it yet.

 
HTH,
Ann

Hi Ann,

Thanks, got it.

Is the recommendation to replace the old one with the new one in production profiles? Is there anything we should know when we do the switch, or are there no changes for the users?

Thanks,
Bhathiya

Hi Bhathiya,

Yes, you should adopt the javabugs rules if you have access to them. The difference you’ll see is more accurate detection, so you may have additional issues after the switch.

 
HTH,
Ann

1 Like

Hi Ann
Just to double check: your recommendation is to switch off S2259 completely and use only S6555, correct?

Hi @asterium,

Welcome to the community!

My recommendation is to in general prefer javabugs rules to seeming equivalents from the java repository. And in this specific case, yes. Prefer S6555 over S2259.

 
HTH,
Ann

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