Skip to content

Conversation

@hns
Copy link
Member

@hns hns commented Jun 10, 2021

This change fixes a whole slew of shortcomings in the redirection of relative links in doc comments. The basic idea is that relative links are authored to work in their "native primary" environment (e.g. the package summary page for a package or the class page for a class and its members), and have to be rewritten when used in other contexts such as "use" or index pages.

A list of omissions that are fixed in this change:

  • Relative links in class or member comments were not redirected when inherited by other classes
  • Relative links in package comments were not rewritten when displayed in other package summaries as "related packages"
  • Fragment links used in foreign contexts were not completed with the file name
  • Relative links in module comments were not redirected at all

While fixing above issues I also made sure link rewriting is kept to a minimum, avoiding it as much as possible for elements that live in the same package.

Furthermore, the test for redirected relative links was a bit out of order. The javadoc command issued by the test returned ERROR because one of the source files contained non-valid HTML (an anchor with a name attribute to test whether that attribute would be modified). Because of this, the checkLinks() method was never invoked, which is a problem for a test that is supposed to make sure generated links are valid. I changed the test to use the valid id attribute instead of name and made sure checkLinks() is executed again.

I also added checks for the newly supported cases. I added a whole new test for modules since retrofitting the existing test to cover modules would not have been practical.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4459/head:pull/4459
$ git checkout pull/4459

Update a local copy of the PR:
$ git checkout pull/4459
$ git pull https://git.openjdk.java.net/jdk pull/4459/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4459

View PR using the GUI difftool:
$ git pr show -t 4459

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4459.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 10, 2021

👋 Welcome back hannesw! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@hns The following label will be automatically applied to this pull request:

  • javadoc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.org label Jun 10, 2021
@hns hns marked this pull request as ready for review June 10, 2021 10:57
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 10, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 10, 2021

Webrevs

Copy link
Member

@pavelrappo pavelrappo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you haven't already, please run doccheck on the JDK API documentation to make sure the issues mentioned in the JBS issue are gone.

@hns
Copy link
Member Author

hns commented Jun 10, 2021

If you haven't already, please run doccheck on the JDK API documentation to make sure the issues mentioned in the JBS issue are gone.

I have checked the mentioned issues. The ones in MemoryAddress were actual documentation errors which have been fixed in the meantime. The others are solved by this change.

@hns
Copy link
Member Author

hns commented Jun 11, 2021

This PR is succeeded by openjdk/jdk17#17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javadoc javadoc-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants