Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 1242492
Votes 1
Synopsis stddoclet: Add links to source code, using -src option
Category doclet:tbd
Reported Against 1.3 , 1.2.2 , 1.0fcs , 1.2beta2 , 1.2beta4
Release Fixed 1.4(merlin-beta2)
State 10-Fix Delivered, Verified, request for enhancement
Priority: 5-Very Low
Related Bugs 4113492 , 4171951 , 4172027 , 4276611
Submit Date 17-MAR-1996
Description
javadoc needs an option that will take and make a link from the method name
to the Source file where that method is defined. With this a VERY NICE source
brouser could be available through the standard documentation program
(javadoc).

=====

This RFE has been implemented.  When -src is used, the doclet generates links from classes and members to the appropriate locations in the source code.  A very simple .java to .html converter has been added to com.sun.tools.doclets.  In the near future, this converter will be improved.


 xxxxx@xxxxx  2001-06-20

-src has been renamed as -linksource.
 xxxxx@xxxxx  2001-10-18javadoc needs an option that will take and make a link from the method name
to the Source file where that method is defined. With this a VERY NICE source
brouser could be available through the standard documentation program
(javadoc).

Example:

...

Where the only difference is the  
'<a href="src.java.awt.Label.html#getAlignment()">SRC</a>'

and the creation of the src.java.awt.Label.html file with the appropriate <a name=> tags.
Work Around
N/A
Evaluation
This requires three features:
- Add a -src option to javadoc, which specifies the path to the source code.
- Write a converter to convert .java files to .html files with the required
  <a name="xxx"></a> tags.
- Add capability within templates to insert <a href="yyy.html#xxx">method</a>

I feel this is important and do-able in 1.2 timeframe.  It would be a shame
not to include this, since we include the source code.
 xxxxx@xxxxx  1997-10-06

On Feb 17, 1998, the TRC (Josh Bloch, Mark Reinhold, Bill Shannon) decided 
that we would not implement this as part of the standard doclet, because it 
would encourage too much dependence on the source code.
 xxxxx@xxxxx  1998-03-31

I agree completely that the API docs should not include the source.  However,
there are legitimate reason to want to view source (eg. you are developing it).
This is one of the most requested additions to javadoc - I am reopening this
RFE because this capability would allow a quite reasonable poor man's source
browser.  Of course, now with Doclets, a user could do this themselves.
 xxxxx@xxxxx  1998-09-09

Source file, line, and column are being added to the javadoc API.
That should be enough to allow the standard doclet to do what is
requested.

The simplest way to do it would be to simply link directly to the
raw source file (possibly preceded by a user-speficied base path).

 xxxxx@xxxxx  2001-03-29

Location of fix:

SourceToHTMLConverter.java
Configuration.java
MethodSubWriter.java
ClassWriter.java
FieldSubWriter.java
standard.properties

 xxxxx@xxxxx  2001-06-20

-src has been renamed as -linksource (Fix for 4489854).
Verified for -linksource.
 xxxxx@xxxxx  2001-10-18
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang