...
This noncompliant code example attempts to count the number of indices in arrays list1
and list2
that have equivalent values. Recall that class Integer
is required to memoize only those integer values in the range -128 to 127 to 128; it might return a non-unique object for any value outside that range. Consequently, when comparing autoboxed integer values outside that range, the ==
operator might return false
, and the output of this example might be 0.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="10ee2cb31d441ac3-c04806a7-4a5e4c82-a9c1b291-9b1d37acba1e5ab99833eefe"><ac:plain-text-body><![CDATA[ | [[Bloch 2009 | AA. Bibliography#Bloch 09]] | 4. "Searching for the One" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c724c42b9bd5eacd-ac80c8fd-414e41c6-bb1ca458-6dd72fa0a2ba9f95ae105c4a"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [§5.1.7, "Boxing Conversion" | http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="693a5de9cf48e737-0968666e-4ec943db-85a5ae71-9fdf85a39924a0cd3f01af4b"><ac:plain-text-body><![CDATA[ | [[Pugh 2009 | AA. Bibliography#Pugh 09]] | Using == to compare objects rather than .equals | ]]></ac:plain-text-body></ac:structured-macro> |
...