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

Annotation to mark serial-related fields and methods

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 11
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      The serialization related fields (serialVersionUID and serialPersistentFields) and methods (writeObject, writeReplace, readObject, readObjectNoData, readResolve), have names that are possible to misspell. The serialization mechanism will silently ignore misspelled (or otherwise misdeclared) fields and methods.

      Similar to how the java.lang.Override annotation type is used to signal the compiler should verify the method is in fact overridden, it would be helpful to some kind of "SerialRelated" annotation to facilitate automated checking of the declarations of serial fields and methods.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: