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

doclint raises "warning: no comment" on variable in a static initialization block

XMLWordPrintable

    • x86_64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      Linux x64
      OpenJDK 8 u282 b08 for x64

      A DESCRIPTION OF THE PROBLEM :
      javac launched with -Werror -Xlint -Xdoclint:all/package raises a false warning "no comment" on a variable declared in a static initialization block.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create the following class
      /**
       * Class to demo a Xdoclint bug.
       */
      public class Foo {
      static {
      int i = 0;
      }
      }

      2. run javac as follows
      javac -Werror -Xlint -Xdoclint:all/package Foo.java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Compilation succeeds.
      ACTUAL -
      Foo.java:6: warning: no comment
      int i = 0;
      ^
      error: warnings found and -Werror specified
      1 error
      1 warning

      ---------- BEGIN SOURCE ----------
      /**
       * Class to demo a Xdoclint bug.
       */
      public class Foo {
      static {
      int i = 0;
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


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

              Created:
              Updated:
              Resolved: