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

Clarify ObjectInputValidation documentation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 6u5
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      I would like to propose the following clarifications to the ObjectInputValidation Javadoc:

      1) The documentation should address why one would want to use the ObjectInputValidation mechanism as opposed to doing the validation at the end of the readObject() or readResolve() methods.

      The documentation at http://java.sun.com/javase/6/docs/api/java/io/ObjectInputStream.html#registerValidation(java.io.ObjectInputValidation,%20int) indicates that the callback is invoked when the entire object graph has finished deserializing but it isn't clear why this would make a difference.

      2) The Javadoc at http://java.sun.com/javase/6/docs/api/java/io/ObjectInputValidation.html should indicate when the callback is invoked instead of only discussing it at http://java.sun.com/javase/6/docs/api/java/io/ObjectInputStream.html#registerValidation(java.io.ObjectInputValidation,%20int)

      3) The exception is documented as "InvalidObjectException - If the object cannot validate itself." but there is no guarantee that the validation object is the same object being validated. I would suggest that this read "InvalidObjectException - If the object is invalid" instead.

      4) http://java.sun.com/javase/6/docs/api/java/io/InvalidObjectException.html reads "Since: JDK1.1, JDK1.1". Is this a typo?


      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/javase/6/docs/api/java/io/ObjectInputValidation.html

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: