Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4469477

static factories in primitive wrapper classes shouldn't promise new objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta2
    • generic
    • generic
    • Verified

      The primitive wrapper classes contain numerous static factory methods, like valueOf and toString. Unfortunately, the specs for these methods often promise that *new* objects are returned. One of the main advantages of static factories over constructors is that previously allocated objects with the same value can be returned instead.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: