Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MITRE CWE

CWE ID 595, "Comparison of Object References Instead of Object Contents"

 

CWE ID 597, "Use of Wrong Operator in String Comparison"

The Elements of Java Style

Rule 79: Use equals(), not ==, to test for equality of objects

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bd7533f8789caead-07c244af-48de446b-9e7a93e0-74ca38517b37d9398c768238"><ac:plain-text-body><![CDATA[

[[FindBugs 2008

AA. References#FindBugs 08]]

ES: Comparison of String objects using == or !=

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="71588dcb2558e29c-9c4c08a2-48a74529-914bb65d-d5aa1f580023fdbaf869665a"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. References#JLS 05]]

[§3.10.5, "String Literals"

http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5]

]]></ac:plain-text-body></ac:structured-macro>

 

§5.6.2, "Binary Numeric Promotion"

...