JDK-4321096 : Honor indenting spaces for
 when no asterisks (*) are present
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.2
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-03-13
  • Updated: 2002-06-27
  • Resolved: 2001-02-26
Related Reports
Duplicate :  
Description

Name: rlT66838			Date: 03/13/2000


java version "1.2.2"

1. To reproduce: run Javadoc on the following class.

2. Source code:

public class MyDoc implements Runnable {

  /**
    Convenient way to do nothing.  A very simple
    example that does nothing in a separate thread is,
    <PRE>
      new Thread(new MyDoc())
                 .start());
    </PRE>
    */
  public void run() {}

}

Javadoc works rather well in this situation if each line of the doc
comment is prefixed with " * ".  But without the leading "*", Javadoc
strips all leading white space.

Even with the leading "*", Javadoc behavior is slightly non-intuitive:
most people follow the "*" with one space, and Javadoc leaves that at
the beginning of the output line, so <PRE> text "always" has a leading
space (1 more than expected).

Even the "*"s are hard for people trying to maintain Javadoc comments
because they get in the way when moving text from line to line.

It would be really nice if Javadoc would keep a reference level of indentation
and strip only that many leading spaces.  For example, it could use the
indentation of the first line following the /** as the reference, and never
strip more than that many spaces from following lines.  It could adjust
for leading "*" by not including spaces before the first "*" in this
calculation.
(Review ID: 102367) 
======================================================================

Comments
WORK AROUND Name: rlT66838 Date: 03/13/2000 Use leading "*" on your Javadoc lines, and adjust by hand for the one extra space, if you care. ======================================================================
11-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION Note that this works as documented -- you must include asterisks ahead of each line if you want leading spaces to be honored. However, his request seem reasonable, and others have requested this. Robert mentioned that that the compiler strips off the spaces. doug.kramer@Eng 2000-12-08 Unlikely to happen soon given other priorities. neal.gafter@Eng 2000-12-13
08-12-2000