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

Compiler does not mark methods of final classes as final

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.0
    • tools
    • generic, x86
    • generic, windows_2000

      Methods declared in a final class are final (JLS 8.4.3.3) and should
      presumably be marked as such in the classfile.

      william.maddox@Eng 1999-06-23

      The spec does not require that the ACC_FINAL bit actually be set for these
      methods in the classfiles. It is sufficient that the class be final, and
      therefore cannot be subclassed, to insure that the methods cannot be overridden.
      This is presumably the intent of the spec. In any case, the compiler has not
      set the ACC_FINAL bits for such methods in the past, and doing so introduces
      serialization incompatibilities. In the absence of an explicit statement in
      the spec that the implicit final-ness of these methods be explicitly marked
      in the classfile with the ACC_FINAL bit, we will leave it unset.

      william.maddox@Eng 1999-09-23

            wmaddoxsunw William Maddox (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: