Versions Compared

Key

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

...

Related Guidelines

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="697435e20531b2dd-e4749eb2-45174ae2-915eb211-d2510190fed483d1aaf23226"><ac:plain-text-body><![CDATA[

[[FindBugs 2008

AA. Bibliography#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="d2fdcb73c0e1f904-6b8d8ff9-4efd47b9-a30e8930-17f96f09239ab002d99336b4"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. Bibliography#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"

...