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

5.5: ConstantValue can initialize non-final fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 19
    • specification
    • vm

      JVMS 4.7.2 describes the runtime behavior of the ConstantValue attribute by talking about how the attribute is used to initialize static fields. It fails to mention that the fields must also be final (per 5.5). This leaves the false impression that a non-final static field could be initialized with a ConstantValue attribute.

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

              Created:
              Updated:
              Resolved: