=== on 24 Jul 2013, 13:29:16 Dinesh Bolkensteyn wrote:
Implemented by \http://jira.codehaus.org/browse/SONARJAVA-224
=== on 18 Apr 2017, 10:53:00 Freddy Mallet wrote:
Removing the rule from Sonar Way, following user feedback about FPs when value on left side can not be null.
=== on 27 Oct 2022, 15:00:00 Michael Gumowski wrote:
After internal discussion, the rationale behind removing the rule from Sonar Way still holds.
* It is always a good practice to put the hardcoded string on the left side of the `equals()` call, since then it can never fail.
* However, if the value which is tested against the String can not be null (being protected by a null-check, or the value is known to be necessarily not null), then the issue which is raised can be considered by some users as FP.
* To make sure we only raise an issue when it makes sense and not generate noise, we would have to tie this rule with the Symbolic Execution (SE) engine. This is too much effort for such a simple code smell rules.