...
However, if the particular JVM running this code memoized integer values from -32,768 to 32,767, all of the int
values in the example would have been autoboxed to singleton the corresponding Integer
objects, and the example code would have operated as expected. Using reference equality instead of object equality requires that all values encountered fall within the interval of values memoized by the JVM. The JLS lacks a specification of this interval; rather, it specifies a minimum range that must be memoized. Consequently, successful prediction of this program's behavior would require implementation-specific details of the JVM.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="93c106a08fdbbc48-3240bebb-47e84067-a2389700-ed5a61a65e5ff8aedc35f0f1"><ac:plain-text-body><![CDATA[ | [[Bloch 2009 | AA. References#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="ca287f4d2a9728ef-d753bd77-4acb496b-89799b15-f111a8f33f87a557dd2c9723"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. References#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="a9614a2d724c0e7f-12a50127-4d0a49dd-accbb25a-8b06df0f04d2b902ebf4e396"><ac:plain-text-body><![CDATA[ | [[Pugh 2009 | AA. References#Pugh 09]] | Using == to Compare Objects Rather than | ]]></ac:plain-text-body></ac:structured-macro> |
...