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

incorrect use of `@serial`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 18
    • client-libs
    • b22

      `@serial` is a doc comment tag that should be used on serializable fields of serializable objects, or on classes or packages to control the documentation.

      In no case is it applicable to any methods on serializable objects.

      The following instances have been observed in JDK documentation comments.

      open/src/java.desktop/share/classes/java/applet/Applet.java:111: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Button.java:487: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Checkbox.java:663: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java:478: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Choice.java:711: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Container.java:3726: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Font.java:1944: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/Label.java:169: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/MenuComponent.java:450: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/event/FocusEvent.java:389: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/event/KeyEvent.java:2009: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.desktop/share/classes/java/awt/event/MouseEvent.java:1197: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
           * @serial
      open/src/java.base/share/classes/java/security/Provider.java:866: warning: Tag @serial cannot be used in method documentation. It can only be used in the following types of documentation: package, class/interface, field.
          * @serial

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: