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

[JEP 390] Revise "value-based class" & apply to wrappers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 16
    • 15
    • core-libs
    • b28

      Update ValueBased.html to reflect the JEP's constraints on inline class migration:

       - Is `final`,

        - Declares only `final` instance fields,

        - Extends `Object`, or a hierarchy of abstract classes that declare no instance
          fields and have no instance initialization logic,

        - Declares only `private` constructors, or has deprecated its constructors for
          removal,

        - Does not promise a unique instance will be created with each factory method
          invocation (or any other instance creation mechanism),

        - Does not rely upon or expose object identity through any of its methods,

        - Overrides `toString`, `equals`, and `hashCode`, and

        - Declares no `synchronized` methods, and discourages clients from performing
          synchronization.

      Update the specs of the 8 primitive wrapper classes (Boolean, Character, Byte, Short, Integer, Long, Float, Double) to indicate that they are value-based classes.

      No longer designate subclasses of ConstantDesc as value-based, because most of these classes declare their own fields.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: