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

Subsequent static code blocks not documented correctly.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • tools



      Name: ssT124754 Date: 02/13/2001


      javadoc -private -d /tmp/ -sourcepath /whatever/ bug

      Simple bug. When you add javadoc comments to static code the static code appears
      with the comment as would be expected. However, the second section of static
      code is given the comment from the first one, i.e. the following will produce
      two pieces of documentation both with the comment "Sets x".

      This is a complete (although obviously silly and contrived) example.


      -------------------------------
      package bug;/tmp/

      /**
       * Show a bug in Javadoc.
       */
      public class Foo {

         /**
          * Silly variables.
          */
         private static int x,y;
         /**
          * Sets {@link #x x}.
          */
         static {
            x = 3;
         }
         /**
          * Sets {@link #y y}; This message never appears!
          */
         static {
            y = 3;
         }
      }
      (Review ID: 116833)
      ======================================================================

            gafter Neal Gafter (Inactive)
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: