JDK-4788919 : stddoclet: Implement -sourcetab to convert tabs to spaces
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-12-05
  • Updated: 2017-05-16
  • Resolved: 2004-04-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b46Fixed
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
14-06-2004

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

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
24-01-2004