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

[lw4] Record component may not have the name isValueObject

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools
    • generic
    • generic

      http://cr.openjdk.java.net/~dlsmith/jep8277163/jep8277163-20220519/specs/value-objects-jls.html

      8.10.1 Record Components
      ...

      It is a compile-time error for a record declaration to declare a record component with the name clone, finalize, getClass, hashCode, isValueObject, notify, notifyAll, toString, or wait.

      ATM, javac does not enforce the restriction for isValueObject, so

      record R(int finalize, int hashCode, int isValueObject) {}

      produces two errors rather than three.

            vromero Vicente Arturo Romero Zaldivar
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: