Skip to content

Commit 7974a05

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Improve links, primarily to Guava and the JDK.
- Use https. - Link to docs.oracle.com instead of download.oracle.com. - Link to guava.dev instead of google.github.io/guava. - Link to `snapshot-jre` instead of `snapshot`, consistent with what we do in our `README` and in shortlinks like guava.dev/ImmutableList. (Consistency might help the snapshot docs in search-engine ratings, as touched upon in discussions of `<link rel="canonical" ...>` in b/69667335 and #7597.) - Link to JDK 25 and Guava's head/snapshot docs. - But continue to link to JDK 7 for a few `Forwarding*` classes that specifically want to show which methods existed at that point. - And continue to link to earlier JDKs when I couldn't easily find equivalents in newer JDKs' docs, like for assertions and try-with-resources (though I was still sometimes able to bump the version slightly, like from 7 to 8 for spurious wakeups and multicatch). - But I did find equivalents for various docs (e.g., jar spec, crypto spec, serialization spec), albeit with rather different URLs. - In one Google-internal class, I noticed that the newer JLS has a section title that doesn't match the old section title, so I changed the link text to match the new title. - In `ImmutableCollection`, I noticed that the relevant link to `Set` needed to change from `#immutable` to `#unmodifiable`. - Use `#foo(A,B)` instead of `#foo-A-B-`, as required by modern Javadoc. - I also noticed one appearance of a stray `%20` (in "Object common methods"), which I removed. - In `MacHashFunctionTest`, I added the new link but kept the old one in place, since the old one matches the list in the source code. Possibly we should update the source code to match the new list. - Update a couple Spring links in the EventBus `README`. - Fix a wiki link about range-check elimination in `Utf8`. One thing that did **not** do was change links to point to shortlinks like guava.dev/ImmutableList. Maybe I should. RELNOTES=n/a PiperOrigin-RevId: 862868752
1 parent 175bac9 commit 7974a05

File tree

33 files changed

+61
-55
lines changed

33 files changed

+61
-55
lines changed

android/guava-tests/test/com/google/common/base/PreconditionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ private static ImmutableList<ImmutableList<Class<?>>> allSignatures(Class<?> pre
426426
// 'test' to demonstrate some potentially ambiguous overloads. This 'test' is kind of strange,
427427
// but essentially each line will be a call to a Preconditions method that, but for a documented
428428
// change would be a compiler error.
429-
// See http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12.2 for the spec on
429+
// See https://docs.oracle.com/javase/specs/jls/se25/html/jls-15.html#jls-15.12.2 for the spec on
430430
// how javac selects overloads
431431
@SuppressWarnings("null")
432432
public void overloadSelection() {

android/guava-tests/test/com/google/common/collect/FluentIterableTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ static class B implements X, Y {}
165165
* This test passes if the {@code concat(…).filter(…).filter(…)} statement at the end compiles.
166166
* That statement compiles only if {@link FluentIterable#concat concat(aIterable, bIterable)}
167167
* returns a {@link FluentIterable} of elements of an anonymous type whose supertypes are the <a
168-
* href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.9">intersection</a> of
169-
* the supertypes of {@code A} and the supertypes of {@code B}.
168+
* href="https://docs.oracle.com/javase/specs/jls/se25/html/jls-4.html#jls-4.9">intersection</a>
169+
* of the supertypes of {@code A} and the supertypes of {@code B}.
170170
*/
171171
public void testConcatIntersectionType() {
172172
Iterable<A> aIterable = ImmutableList.of();

android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public class MacHashFunctionTest extends TestCase {
5454
private static final SecretKey SHA512_KEY =
5555
new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");
5656

57-
// From http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
57+
// From https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
58+
// TODO(cpovirk): Evaluate newer list:
59+
// https://docs.oracle.com/en/java/javase/25/docs/specs/security/standard-names.html#mac-algorithms
5860
private static final ImmutableTable<String, SecretKey, HashFunction> ALGORITHMS =
5961
new ImmutableTable.Builder<String, SecretKey, HashFunction>()
6062
.put("HmacMD5", MD5_KEY, Hashing.hmacMd5(MD5_KEY))

android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class MessageDigestHashFunctionTest extends TestCase {
3737
private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");
3838

3939
// From "How Provider Implementations Are Requested and Supplied" from
40-
// http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html
40+
// https://docs.oracle.com/en/java/javase/25/security/java-cryptography-architecture-jca-reference-guide.html#:~:text=How%20Provider%20Implementations%20Are%20Requested%20and%20Supplied
4141
// - Some providers may choose to also include alias names.
4242
// - For example, the "SHA-1" algorithm might be referred to as "SHA1".
4343
// - The algorithm name is not case-sensitive.

android/guava/src/com/google/common/base/CharMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* assigned characters, including important CJK characters and emoji.
4242
*
4343
* <p>Supplementary characters are <a
44-
* href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#supplementary">encoded
44+
* href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Character.html#supplementary">encoded
4545
* into a {@code String} using surrogate pairs</a>, and a {@code CharMatcher} treats these just as
4646
* two separate characters. {@link #countIn} counts each supplementary character as 2 {@code char}s.
4747
*

android/guava/src/com/google/common/base/Strings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static boolean validSurrogatePairAt(CharSequence string, int index) {
233233
* <p><b>Note:</b> For most string-formatting needs, use {@link String#format String.format},
234234
* {@link java.io.PrintWriter#format PrintWriter.format}, and related methods. These support the
235235
* full range of <a
236-
* href="https://docs.oracle.com/javase/9/docs/api/java/util/Formatter.html#syntax">format
236+
* href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Formatter.html#syntax">format
237237
* specifiers</a>, and alert you to usage errors by throwing {@link
238238
* java.util.IllegalFormatException}.
239239
*

android/guava/src/com/google/common/collect/ImmutableCollection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@
9595
* <p>Expressing the immutability guarantee directly in the type that user code references is a
9696
* powerful advantage. Although Java offers certain immutable collection factory methods, such as
9797
* {@link Collections#singleton(Object)} and <a
98-
* href="https://docs.oracle.com/javase/9/docs/api/java/util/Set.html#immutable">{@code Set.of}</a>,
99-
* we recommend using <i>these</i> classes instead for this reason (as well as for consistency).
98+
* href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Set.html#unmodifiable">{@code
99+
* Set.of}</a>, we recommend using <i>these</i> classes instead for this reason (as well as for
100+
* consistency).
100101
*
101102
* <h4>Creation</h4>
102103
*

android/guava/src/com/google/common/io/Closer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/**
3333
* A {@link Closeable} that collects {@code Closeable} resources and closes them all when it is
3434
* {@linkplain #close closed}. This was intended to approximately emulate the behavior of Java 7's
35-
* <a href="http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html"
35+
* <a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html"
3636
* >try-with-resources</a> statement in JDK6-compatible code. Code using this should be
3737
* approximately equivalent in behavior to the same code written with try-with-resources.
3838
*

android/guava/src/com/google/common/math/IntMath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public static int divide(int p, int q, RoundingMode mode) {
383383
* }
384384
*
385385
* @throws ArithmeticException if {@code m <= 0}
386-
* @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17.3">
386+
* @see <a href="https://docs.oracle.com/javase/specs/jls/se25/html/jls-15.html#jls-15.17.3">
387387
* Remainder Operator</a>
388388
*/
389389
public static int mod(int x, int m) {

android/guava/src/com/google/common/math/LongMath.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public static long divide(long p, long q, RoundingMode mode) {
444444
* }
445445
*
446446
* @throws ArithmeticException if {@code m <= 0}
447-
* @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17.3">
447+
* @see <a href="https://docs.oracle.com/javase/specs/jls/se25/html/jls-15.html#jls-15.17.3">
448448
* Remainder Operator</a>
449449
*/
450450
@GwtIncompatible // TODO
@@ -468,7 +468,7 @@ public static int mod(long x, int m) {
468468
* }
469469
*
470470
* @throws ArithmeticException if {@code m <= 0}
471-
* @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17.3">
471+
* @see <a href="https://docs.oracle.com/javase/specs/jls/se25/html/jls-15.html#jls-15.17.3">
472472
* Remainder Operator</a>
473473
*/
474474
@GwtIncompatible // TODO

0 commit comments

Comments
 (0)