JDK-4414790 : Subsequent static code blocks not documented correctly.
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-02-13
  • Updated: 2002-06-27
  • Resolved: 2001-02-27
Related Reports
Duplicate :  
Description

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) 
======================================================================

Comments
WORK AROUND Name: ssT124754 Date: 02/13/2001 Put all documentation in the first piece of static code. This is crappy. ======================================================================
11-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION I was able to reproduce this bug. It needs to be fixed in the javadoc API. jamie.ho@Eng 2001-02-27 If this bug requires changes to the Doclet API, then please specify the change and reassign it. doug.kramer@Eng 2001-02-22 These static code blocks are not functions and never should have been returned by the doclet API as if they were functions. neal.gafter@Eng 2001-02-27
22-02-2001