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

Javadoc doesn't specify serialVersionUID for several java.sql.* classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-libs
    • None
    • b91
    • generic
    • generic
    • Verified

      Problem description
      ===================
      Javadoc doesn't specify the serialVersionUID for (new in Mustang) serializable classes in java.sql package:
        java.sql.SQLClientInfoException
        java.sql.SQLDataException
        java.sql.SQLDataSetSyncException
        java.sql.SQLFeatureNotSupportedException
        java.sql.SQLIntegrityConstraintViolationException
        java.sql.SQLInvalidAuthorizationSpecException
        java.sql.SQLNonTransientConnectionException
        java.sql.SQLNonTransientException
        java.sql.SQLRecoverableException
        java.sql.SQLRuntimeException
        java.sql.SQLSyntaxErrorException
        java.sql.SQLTimeoutException
        java.sql.SQLTransactionRollbackException
        java.sql.SQLTransientConnectionException
        java.sql.SQLTransientException
      though the serialVersionUIDs are shown in the javadoc Serialized Form for
      others java.sql.* serializable classes.

      According to javadoc specification for the java.io.Serializable interface:
        ---Excerpt-from-spec---
        If a serializable class does not explicitly declare a serialVersionUID,
        then the serialization runtime will calculate a default serialVersionUID
        value for that class based on various aspects of the class, as described
        in the Java(TM) Object Serialization Specification. However, it is strongly
        recommended that all serializable classes explicitly declare serialVersionUID
        values, since the default serialVersionUID computation is highly sensitive
        to class details that may vary depending on compiler implementations, and can
        thus result in unexpected InvalidClassExceptions during deserialization.
        Therefore, to guarantee a consistent serialVersionUID value across different
        java compiler implementations, a serializable class must declare an explicit
        serialVersionUID value. It is also strongly advised that explicit
        serialVersionUID declarations use the private modifier where possible, since
        such declarations apply only to the immediately declaring class--serialVersionUID
        fields are not useful as inherited members.
        ---End-of-excerpt---
      the serialVersionUID should be included in the Serialized Form generated for each class.

            ahandasunw Amit Handa (Inactive)
            ygaevsky Yuri Gaevsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: