javac is not generating the ConstantValue attribute for non-final static fields

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 22, 23, 24
    • Component/s: tools
    • None

      this text in section `5.5 Initialization` of the `JVMS21`:

          6. Otherwise, record the fact that initialization of the Class object for C is in
          progress by the current thread, and release LC .
          Then, initialize each final static field of C with the constant value in
          its ConstantValue attribute (§4.7.2), in the order the fields appear in the
          ClassFile structure.

      changed in `JVMS22` to:

          6. Otherwise, record the fact that initialization of the Class object for C is in
          progress by the current thread, and release LC .
          Then, initialize each static field of C with the constant value in its
          ConstantValue attribute (§4.7.2), in the order the fields appear in the
          ClassFile structure.

      see that in: `Then, initialize each static field of C` the mention to the fact that the field must also be `final` was dropped. Javac needs to catch up with this.

      Thanks to Dan Heidinga for reporting this issue

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: