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

Annotation to mark serial-related fields and methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 14
    • 11
    • core-libs
    • b11

      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.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: