|
SemmleCode Professional comes with a wide range of pre-packaged analyses, from architectural properties and metrics, to statement-level checks for likely bugs and violations of best practice.
Reference Equality Test on Strings
This query finds code that compares two String objects using == or
!=. These operators compare object identity, which may not be intended.
How to Interpret the Query Results
The query flags all occurrences of such an equality test and provides a list of all found occurrences in the results view.
How to Address the Query Results
Usually, non-primitive objects (such as strings) should be compared using their equals methods.
Source Code
References
|