RFR: JDK-8195796: Reduce the size of relative URLs in generated docs

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Jan 19 22:26:42 UTC 2018


Please review some work to reduce the size of relative URLs within a 
documentation bundle.
The work is fully described in the JBS issue.

The work was done in 3 steps, which is reflected in the webrev.  You can 
either view the
top-level cumulative webrev, or individual webrevs for each of the 3 
steps. The work
will be pushed as a single changeset.

Step 1.
Add new methods normalize and relativize to DocPaths. There's a new unit 
test for the
new functionaility.   I cleaned up the doc comments as well.

Step 2.
Change DocLink to use a DocPath internally, instead of a String.
Add a new method to leverage the new DocPath functionality, to generate 
simplified
DocLinks.   I cleaned up the doc comments as well.

Step 3.
Update Links to use the new DocLink functionality. This is conceptually 
the simplest
of the 3 steps, but it causes simple, derivative changes in both source 
and tests.
Start by reviewing Links.java ... Links is changed from being a 
singleton object
to a per-file object, and a number of methods are changed from being 
static methods
to instance methods, to avail themselves of the information about what 
file the link
will be generated in.

A number of tests are affected. Almost without exception, all the 
changes are to remove
unnecessary content from href values, depending on the file in which the 
link is
generated.

JBS: https://bugs.openjdk.java.net/browse/JDK-8195796
Webrev: http://cr.openjdk.java.net/~jjg/8195796/webrev.00/
     See the 3 links, labelled "Steps", on the index page, for the 
webrevs for each
     of the steps described above.

-- Jon


More information about the javadoc-dev mailing list