...
Use reference equality to determine whether two references point to the same object.The
Automated Detection
Coverity Prevent |
...
5.0 | The BAD_EQ |
...
checker can detect instances where |
...
the |
...
operator is being used for equality of objects when, ideally, |
...
the |
...
method should have been used. |
...
The |
...
operator could consider the objects to be different, whereas |
...
the |
...
method would consider them to be the same. |
...
ES: Comparison of String objects using == or != |
...
Related Guidelines
CWE ID 595, "Comparison of Object References Instead of Object Contents" | |
| CWE ID 597, "Use of Wrong Operator in String Comparison" |
Rule 79: Use |
...