5.5: ConstantValue can initialize non-final fields

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 19
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: