Skip to content

Bump more links to Java 26, and remove an unused reference definition. - #815

Merged
cpovirk merged 3 commits into
mainfrom
more26
Jul 15, 2026
Merged

cpovirk merged 3 commits into
mainfrom
more26

Conversation

@cpovirk

@cpovirk cpovirk commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

We should probably get in the habit of bumping these at the same time as we bump the version we use to generate Javadoc (as done in PRs like #793).

We should probably get in the habit of bumping these at the same time as we bump the version we use to generate Javadoc (as done in PRs like #793).
cpovirk added a commit that referenced this pull request Jul 8, 2026
This adds support for `##` links.

It's very possible that I should just bump this all the way to 26: We want to use the newest version of Javadoc to build our release Javadoc, just as we already do for snapshot Javadoc. So, if we were to skip building Javadoc under earlier versions, that could act as a free check during [the release process](#305) that we're using the right version. Then we'd want to bump this version [when we bump our Java version elsewhere](#815). The downside would be that local users who build with Java 21 can no longer build Javadoc (though I'm not sure it's that hard to just [have Gradle download a newer version for them](https://github.com/jspecify/jspecify/issues/813)—and how many people really care whether they can build our Javadoc locally, especially as long as it doesn't fail in a way that breaks the whole build?). But that might become the case anyway if we [start to use Markdown Javadoc](#817), which would raise the minimum [to Java 23](https://openjdk.org/jeps/467), and maybe we'd unknowingly use a feature that requires something even newer.
cpovirk added a commit that referenced this pull request Jul 9, 2026
…l testing under 9).

This PR applies 26 for javadoc, javac, and one run of our integration tests. It applies Java 9 for an additional run of our integration tests, and it keeps the existing run under Java 8.

We could consider additional testing of releases between the endpoints of Java 9 and Java 26, presumably on LTS releases 11+17+21+25, but I'm guessing it wouldn't buy us much.

Then, make the CI run Gradle under (and only 26) and stop setting `JAVA_VERSION`. That should matter little, since the other changes of this PR make us ignore the `JAVA_VERSION` environment variable (which contributed to #812) and the fallback default of "whichever Java version the user used to run Gradle." We do still need to keep this Java version compatible with the Gradle version that we use, but broadly, I hope to keep on the newest version of each. This PR does let us advance our toolchain version (javadoc+javac+testing) ahead of the version we use to run Gradle if we find that useful at some point.

We should bump the "26" in both `build.gradle` and `.github/workflows/build.yml` whenever we [bump the Java version elsewhere](#815). As noted above, we can bump one before the other if necessary.

(I notice that we don't have any [required status checks](https://github.com/jspecify/jspecify/settings/branch_protection_rules/34801738), even though we have "Require status checks to pass before merging" checked. Maybe I'll register at least the new One True "Build" check after I merge this PR.)

If I remember, I will wait to merge this PR until after #812: That way, if we ever choose to go back to a `JAVA_VERSION`-based approach (or to copy that approach for another project), we'll have a corrected version to refer back to.)

- Fixes #271 (by following https://jakewharton.com/build-on-latest-java-test-through-lowest-java/)
- Fixes #813
- Fixes #812 (if I didn't remember to merge that one first)
- Slightly simplifies #305
Comment thread docs/docs/spec.md Outdated
[JLS 8.4.1]: https://docs.oracle.com/javase/specs/jls/se23/html/jls-8.html#jls-8.4.1
[JLS 8.4.8.1]: https://docs.oracle.com/javase/specs/jls/se23/html/jls-8.html#jls-8.4.8.1
[JVMS 5.4.5]: https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-5.html#jvms-5.4.5
[Java SE 23]: https://docs.oracle.com/javase/specs/jls/se26/html/index.html

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should the "Java SE 23" also be updated, here and in the use?
Did we ensure that all features from SE 24-26 are covered?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ouch, thanks for catching that. This was a total blind search-and-replace job by me, and I remember checking some links (like https://docs.oracle.com/en/java/javase/26/language/pattern-matching.html), but I didn't pay any attention to the left side of this line.

There might not be anything else that we need to cover, but I'd want to at least think about developments in pattern matching. The point of this PR, though, isn't to do that, so I've reverted the change on this line.

@cpovirk cpovirk assigned cpovirk and wmdietl and unassigned cpovirk Jul 13, 2026

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You propose: "We should probably get in the habit of bumping these at the same time as we bump the version we use to generate Javadoc."

An alternative would be to consistently update the links together with the spec-supported JDK version. Then there is only one version used in the specification. The version used for generating Javadoc seems quite separate from the spec.

But the changes here look consistent with the first policy.

@wmdietl wmdietl assigned cpovirk and unassigned wmdietl Jul 15, 2026
cpovirk added a commit that referenced this pull request Jul 15, 2026
…l testing under 9). (#818)

This PR applies 26 for javadoc, javac, and one run of our integration tests. It applies Java 9 for an additional run of our integration tests, and it keeps the existing run under Java 8.

We could consider additional testing of releases between the endpoints of Java 9 and Java 26, presumably on LTS releases 11+17+21+25, but I'm guessing it wouldn't buy us much.

Then, make the CI run Gradle under (and only 26) and stop setting `JAVA_VERSION`. That should matter little, since the other changes of this PR make us ignore the `JAVA_VERSION` environment variable (which contributed to #812) and the fallback default of "whichever Java version the user used to run Gradle." We do still need to keep this Java version compatible with the Gradle version that we use, but broadly, I hope to keep on the newest version of each. This PR does let us advance our toolchain version (javadoc+javac+testing) ahead of the version we use to run Gradle if we find that useful at some point.

We should bump the "26" in both `build.gradle` and `.github/workflows/build.yml` whenever we [bump the Java version elsewhere](#815). As noted above, we can bump one before the other if necessary.

(I notice that we don't have any [required status checks](https://github.com/jspecify/jspecify/settings/branch_protection_rules/34801738), even though we have "Require status checks to pass before merging" checked. Maybe I'll register at least the new One True "Build" check after I merge this PR.)

If I remember, I will wait to merge this PR until after #812: That way, if we ever choose to go back to a `JAVA_VERSION`-based approach (or to copy that approach for another project), we'll have a corrected version to refer back to.)

- Fixes #271 (by following https://jakewharton.com/build-on-latest-java-test-through-lowest-java/)
- Fixes #813
- Fixes #812 (if I didn't remember to merge that one first)
- Slightly simplifies #305
cpovirk added a commit that referenced this pull request Jul 15, 2026
Currently, `NonNull` links to `Nullable.html#projection`, but there is no such anchor by that name. I've added one at the definition. This is still not as clear as having a section would be, but I'm not sure whether we want a section. Another option would be to change the text in `NonNull` to refer to "nullable projection" as...

```
"when `Nullable` is [applied to](Nullable#meaning-per-each-kind-of-type-usage-heading) a type variable
```

...or something to that effect.

(For the anchor, I introduced a `span`. If I make it completely empty, then I get a warning from Javadoc. Thus, I decided to make it cover the "title" of the list item.)

As for using [`##` links](https://docs.oracle.com/en/java/javase/26/docs/specs/javadoc/doc-comment-spec.html#:~:text=references%20to%20arbitrary%20URI%20fragments): That's what I had come here to do before I found the problem with `#projection`. Compare google/guava#8346. From what I've seen, their main advantage is when linking to other projects (since you can link to, say, `Character##supplementary` instead of `https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/Character.html#supplementary`. But I figure we might as well use them for links inside JSpecify, too.

I also raised the minimum version for which we generate Javadoc to 21. That version adds support for `##` links.

It's very possible that I should have just bumped it all the way to 26: We want to use the newest version of Javadoc to build our release Javadoc, just as we already do for snapshot Javadoc. So, if we were to skip building Javadoc under earlier versions, that could act as a free check during [the release process](#305) that we're using the right version. Then we'd want to bump this version [when we bump our Java version elsewhere](#815). The downside would be that local users who build with Java 21 can no longer build Javadoc (though I'm not sure it's that hard to just [have Gradle download a newer version for them](https://github.com/jspecify/jspecify/issues/813)—and how many people really care whether they can build our Javadoc locally, especially as long as it doesn't fail in a way that breaks the whole build?). But that might become the case anyway if we [start to use Markdown Javadoc](#817), which would raise the minimum [to Java 23](https://openjdk.org/jeps/467), and maybe we'd unknowingly use a feature that requires something even newer.

But since I wrote all that, we've merged #818, which makes the existing check obsolete. I will clean it up in a separate PR.
@cpovirk

cpovirk commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

That is a good point. On the one hand, a new version of the spec might contain corrections, or it might cover new features for which our existing rules naturally apply. But on the other, we might end up linking to a section that covers new features for which our existing rules would be incorrect.

I have pushed a new commit that limits the version number we use in the spec to 23. That means that I'm no longer making actual changes to spec.md except to remove an unused link, though I did keep making changes to the (obsolete?) docs/locale/ja/LC_MESSAGES/tsttcpw.po, just bumping it to 23 instead of to 26.

@cpovirk

cpovirk commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

(It's fair to observe that the links I'm updating in the Javadoc include JLS links for package-info and for receiver parameters, along with a link to a page about records, whose features could also change from version to version. I think that those particular JLS sections are likely to remain good references across versions (or maybe we can do better than a JLS link for at least one), and I think the world is probably better off when a Google search for "Java records" is more likely to lead to the most recent such documentation available, so I feel OK with this approach. It's still possible that I'm "defaulting" to linking to new pages more than makes sense here; we've just slowly found more and more (small) reasons that that's a good practice for Javadoc, so I'm carrying over those lessons to a different context where they might not apply.)

@cpovirk
cpovirk merged commit 97c8864 into main Jul 15, 2026
12 checks passed
@cpovirk
cpovirk deleted the more26 branch July 15, 2026 16:50
@cpovirk

cpovirk commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

(@kevinb9n, this, too, will conflict with you PR, though I think you may have bumped a version in a link or two already. Also, oops, sorry, I see now that the package-info link that I flagged in your PR was preexisting!)

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.

2 participants