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

Add missing @serial tags to re-enable -serialwarn option

XMLWordPrintable

      Back when doclint was introduced, to avoid some duplicate messages, a pragmatic decision was made to disable warnings generated by the Standard Doclet when DocLint was enabled.

      This had the unexpected side effect of disabling the effect of the `-serialwarn` when DocLint was enabled, which is the default case in the main JDK build.

      Fixing JDK-8252717 will implicitly fix `-serialwarn` which exposes 413 warnings in the JDK build.
      The warnings are all about missing @serial tags, of the following form

      open/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java:74: warning: in class com.sun.jdi.ClassNotLoadedException, missing @serial tag for default serializable field: className.
          private String className;
                         ^

      The warnings are distributed as follows:

       238 src/java.base
       111 src/java.desktop
        14 src/java.xml
        14 src/java.management
         8 src/jdk.jshell
         7 src/java.sql.rowset
         5 src/jdk.jdi
         3 src/java.sql
         3 src/java.scripting
         2 src/java.datatransfer
         1 src/jdk.xml.dom
         1 src/jdk.dynalink
         1 src/jdk.attach
         1 src/java.xml.crypto
         1 src/java.smartcardio
         1 src/java.security.jgss

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

              Created:
              Updated:
              Resolved: