United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4788919 stddoclet: Implement -sourcetab to convert tabs to spaces
4788919 : stddoclet: Implement -sourcetab to convert tabs to spaces

Details
Type:
Enhancement
Submit Date:
2002-12-05
Status:
Resolved
Updated Date:
2004-04-01
Project Name:
JDK
Resolved Date:
2004-04-01
Component:
docs
OS:
generic
Sub-Component:
doclet
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0

Related Reports

Sub Tasks

Description
Comments in between <pre> tags are not indented properly because the doclet 
does not know how many spaces to replaces tabs with.  We already have an 
*undocumented* option -linksourcetab to specify the number of spaces for
each tab in source files that works with the -linksource option.
These pages are entirely in the <pre> tags.  We should make the -linksourcetab
option more general (and rename it to  -sourcetab) so that it can be used in other ways.

Also, if a developer uses tab characters to align columns 
similar to a table, these should also be converted to spaces.
This implies converting tabs globally throughout the comment.

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta2

FIXED IN:
tiger-beta2

INTEGRATED IN:
tiger-b46
tiger-beta2


                                     
2004-06-14
PUBLIC COMMENTS

Fixed.  The -sourcetab option now works.
###@###.### 2004-03-29
                                     
2004-03-29
EVALUATION

Note that this is more than just a rename, as I believe -linksourcetab
originally performed -linksource as well as setting the tab.
The new -sourcetab option would only set the tab and not perform
any function to generate the source files in HTML.

###@###.### 2002-12-05

This option certainly applies to the standard doclet, as 
browsers treat tab characters as if they were a single character.
MIF Doclet users would be less likely to use this option,
as they might want keep the tabs present in the source file.

The following doc comment contains tabs.

    /**
     *		This line has an asterisk and two tabs to its left and ends with &lt;br&gt;.<br>
	This line has no asterisks and one tab to its left.
     */

The tabs on the following first line seem to be stripped out by the standard doclet.  The tab on the second line appears to be converted to 8 spaces.
Is this value of 8 hard-coded in the standard doclet?  YES

<DD>This line has an asterisk and two tabs to its left and ends with &lt;br&gt;.<br>
        This line has no asterisks and one tab to its left.

###@###.### 2002-12-05

When -sourcetab is implemented, it should convert tabs to spaces mod the 
tab's position on the line.  That is, it should insert enough spaces
to move the cursor to the next "virtual" tab stop.  So -sourcetab
would insert 8 spaces if the tab is at the start of the line, but
only 7 spaces if the line starts with space/tab.  This will make the
spacing line up in <pre> text.

###@###.### 2003-07-19

Because the developer might be using tabs to align columns similar to 
a table outside of <PRE> text, these tabs should be converted to spaces
globally throughout the doc comments.

###@###.### 2003-07-22

Suggestion for the -help text is:
-sourcetab <tab-length>   Specify number of spaces each tab takes up in source
                              
###@###.### 2004-01-24

Fixed.  The -sourcetab is now enabled and replaces the -linksourcetab option.
###@###.### 2004-03-29
                                     
2004-01-24



Hardware and Software, Engineered to Work Together