Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linking to JDK 21 from the Guava Javadoc. #1379

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

copybara-service[bot]
Copy link
Contributor

Fix linking to JDK 21 from the Guava Javadoc.

Currently, we link to JDK 8 instead. It's a long story:

I had moved us to 21 in cl/696975523, but that got undone by cl/711476575: The latter change reinstated a flag (--no-module-directories) from cl/413922237 that had been accidentally circumvented by cl/655647768. (cl/655647768 changed the VM that we use to run Maven itself, and our Javadoc configuration was wrongly triggered by the version of that VM, rather than the version used to run Javadoc.) That flag, which worked around a bug whose fixed has conveniently been backported, somehow also caused a warning/error:

[WARNING] warning: URL https://docs.oracle.com/javase/21/docs/api/element-list was redirected to https://docs.oracle.com/en/java/javase/21/docs/api/index.html -- Update the command-line options to suppress this warning.

In the cases in which it's only a warning (as when using Javadoc 21, as opposed to Javadoc 23), it is also a sign that linking to JDK 21 failed. Javadoc apparently then falls back to linking to JDK 8. (I'd say that the linking to Java 8 (rather than just failing to link altogether) is a result of JDK-8216497 except that that change seems to have been new in Javadoc 16.)

The fix is to change the link to include the /en/java/ segments. This is a change relative to where Java 8 Javadoc lives to this day. (Since Java 8 Javadoc is still at the old path, I did not touch a similar link in Caliper, which links to Java 8.)

(I suspect that we could now upgrade to Javadoc 23 if we wanted. I think we could already link to a newer JDK version if we wanted. I don't think I thought very hard about picking 21 for that.)

We do still see another warning, but shrug:

[WARNING] warning: The code being documented uses packages in the unnamed module, but the packages defined in https://docs.oracle.com/en/java/javase/21/docs/api/ are in named modules.

Also: Bump maven-javadoc-plugin, and remove a now-unused Maven property.

Also, in Truth: Prevent Truth's JDK linking from breaking similarly when we upgrade the version of Javadoc that we use to generate its docs. And remove its attempted --no-module-directories configuration, too: That flag is no longer necessary with recent Javadoc 11 versions, and it turns out that it hasn't actually been used since cl/509829752....

RELNOTES=n/a

Currently, we link to JDK 8 instead. It's a long story:

I had moved us to 21 in cl/696975523, but that got undone by cl/711476575: The latter change reinstated a flag (`--no-module-directories`) from cl/413922237 that had been accidentally circumvented by cl/655647768. (cl/655647768 changed the VM that we use to run _Maven itself_, and our Javadoc configuration was wrongly triggered by the version of _that_ VM, rather than the version used to run Javadoc.) That flag, which worked around a bug whose fixed has conveniently [been backported](https://bugs.openjdk.org/browse/JDK-8215291?focusedId=14506100&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14506100), somehow also caused [a warning/error](google/guava#6790 (comment)):

```
[WARNING] warning: URL https://docs.oracle.com/javase/21/docs/api/element-list was redirected to https://docs.oracle.com/en/java/javase/21/docs/api/index.html -- Update the command-line options to suppress this warning.
```

In the cases in which it's only a warning (as when using Javadoc 21, as opposed to Javadoc 23), it is also a sign that linking to JDK 21 failed. Javadoc apparently then falls back to linking to JDK 8. (I'd say that the linking to Java 8 (rather than just failing to link altogether) is a result of [JDK-8216497](https://bugs.openjdk.org/browse/JDK-8216497) except that that change seems to have been new in Javadoc 16.)

The fix is to change the link to include the `/en/java/` segments. This is a change relative to where Java _8_ Javadoc lives to this day. (Since Java 8 Javadoc is still at the old path, I did _not_ touch a similar link in _Caliper_, which links to Java 8.)

(I suspect that we could now upgrade to Javadoc 23 if we wanted. I think we could already _link_ to a newer JDK version if we wanted. I don't think I thought very hard about picking 21 for that.)

We do still see another warning, but _shrug_:

```
[WARNING] warning: The code being documented uses packages in the unnamed module, but the packages defined in https://docs.oracle.com/en/java/javase/21/docs/api/ are in named modules.
```

Also: Bump `maven-javadoc-plugin`, and remove a now-unused Maven property.

Also, in Truth: Prevent Truth's JDK linking from breaking similarly when we upgrade the version of Javadoc that we use to generate its docs. And remove its attempted `--no-module-directories` configuration, too: That flag is no longer necessary with recent Javadoc 11 versions, and it turns out that it hasn't actually been used since cl/509829752....

RELNOTES=n/a
PiperOrigin-RevId: 711811272
@copybara-service copybara-service bot merged commit 3919c28 into master Jan 3, 2025
@copybara-service copybara-service bot deleted the test_711793008 branch January 3, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant