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

5.5: ConstantValue can initialize non-final fields

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: