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

ObjectStreamClass: hide 'final' flag for anonymous classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      Anonymous inner classes are supposed to be marked ACC_FINAL, but have not been for many years. See JDK-8129576.

      The main reason the compiler behavior has not been fixed is due to concern that doing so will change the serialization UIDs for all anonymous classes, and this is an unnecessary incompatible change.

      After discussion, the proposal is to modify the serialization spec, and its implementation in ObjectStreamClass, so that the flags for anonymous classes (per Class.isAnonymousClass) always exclude ACC_FINAL, regardless of its actual setting. This will allow compiler behavior to be corrected without perturbing UIDs.

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

              Created:
              Updated:
              Resolved: