Only run assertion on Integer autoboxing cache size once

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs
    • b40
    • generic
    • generic
    • Verified

      The JLS mandates a certain range of integers from -128 to 127 to cached by the autoboxing mechanism, JSL 5.1.7. An assert checking one end of this range appears in Integer.valueOf. However, it would be sufficient, and more efficient, to have the assert only run once in the initialization of the IntegerCache class used to store the cached data.

            Assignee:
            Alan Bateman
            Reporter:
            Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: