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

Add missing @serial tags to other modules

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 25
    • client-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      Add a @serialData doc comment tag to the writeExternal method in java.awt.datatransfer.DataFlavor.

      Problem

      Enabling the -serialwarn option in documentation build complains about a missing @serialData javadoc tag in the writeExternal(ObjectOutput) method of class java.awt.datatransfer.DataFlavor.

      Solution

      Add the missing @serialData tag with a description of the serialized data.

      Specification

      A @serialData tag is added to the writeExternal(ObjectOutput) method in java.awt.datatransfer.DataFlavor, containing a textual description of the serialized data as follows:

      diff --git a/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java b/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
      index 3a18834a567..cfb89118ff7 100644
      --- a/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
      +++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
      @@ -1286,6 +1286,9 @@ public boolean isFlavorTextType() {
      
           /**
            * Serializes this {@code DataFlavor}.
      +     *
      +     * @serialData The {@code mimeType} field with the {@code humanPresentableName} parameter set,
      +     * followed by the {@code representationClass} field
            */
          public synchronized void writeExternal(ObjectOutput os) throws IOException {
              if (mimeType != null) {

      This adds a "Serial Data:" item to the entry for the class in the Serialized Form page with the following content:

      Serial Data: The mimeType field with the humanPresentableName parameter set, followed by the representationClass field

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Nizar Benalla
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: