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

serialver should emit declaration with the 'private' modifier

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 1.4.2, 5.0, 6, 7, 8
    • core-libs

    Backports

      Description

        The serialver tool computes a the serialVersionUID for a serializable class and emits a line of code suitable for pasting into a source file. For example, "serialver java.lang.String" emits:

        java.lang.String: static final long serialVersionUID = -6849794470754667710L;

        Unfortunately this does not follow the recommendation in the java.io.Serializable class doc, which "strongly advises" the field be declared private.

        Attachments

          Issue Links

            Activity

              People

                smarks Stuart Marks
                smarks Stuart Marks
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: