From 92de2b2d5f21af38380b437af51e49c7ac142258 Mon Sep 17 00:00:00 2001 From: Nizar Benalla Date: Mon, 22 Jul 2024 13:27:12 +0000 Subject: [PATCH] 8336039: Doccheck: HTML warnings, broken links and missing files in java.base documentation Reviewed-by: liach, djelinski --- .../lang/classfile/components/CodeStackTracker.java | 4 ++-- .../classes/java/lang/classfile/package-info.java | 12 ++++++------ .../share/classes/java/lang/foreign/Arena.java | 2 +- .../classes/java/lang/foreign/MemorySegment.java | 8 ++++---- .../classes/java/lang/foreign/SymbolLookup.java | 2 +- .../classes/java/net/spi/InetAddressResolver.java | 4 ++-- .../share/classes/java/text/MessageFormat.java | 3 +-- .../share/classes/javax/security/auth/Subject.java | 4 ++-- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/java.base/share/classes/java/lang/classfile/components/CodeStackTracker.java b/src/java.base/share/classes/java/lang/classfile/components/CodeStackTracker.java index 97ced9ab385..1b711cfad0e 100644 --- a/src/java.base/share/classes/java/lang/classfile/components/CodeStackTracker.java +++ b/src/java.base/share/classes/java/lang/classfile/components/CodeStackTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import jdk.internal.javac.PreviewFeature; * and calculating max stack size. *

* Sample use: - *

+ * * {@snippet lang=java : * var stackTracker = CodeStackTracker.of(); * codeBuilder.transforming(stackTracker, trackedBuilder -> { diff --git a/src/java.base/share/classes/java/lang/classfile/package-info.java b/src/java.base/share/classes/java/lang/classfile/package-info.java index 49413d35660..b5991b0e951 100644 --- a/src/java.base/share/classes/java/lang/classfile/package-info.java +++ b/src/java.base/share/classes/java/lang/classfile/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,11 +33,11 @@ * The main class for reading classfiles is {@link java.lang.classfile.ClassModel}; we * convert bytes into a {@link java.lang.classfile.ClassModel} with {@link * java.lang.classfile.ClassFile#parse(byte[])}: - *

+ * * {@snippet lang=java : * ClassModel cm = ClassFile.of().parse(bytes); * } - *

+ * * There are several additional overloads of {@code parse} that let you specify * various processing options. *

@@ -377,7 +377,7 @@ *

* Then we can compose {@code fooToBar} and {@code instrumentCalls} with {@link * java.lang.classfile.CodeTransform#andThen(java.lang.classfile.CodeTransform)}: - *

+ * * {@snippet lang=java : * var cc = ClassFile.of(); * byte[] newBytes = cc.transform(cc.parse(bytes), @@ -443,7 +443,7 @@ * or more, zero or one, exactly one), and a list of components. The elements * of a class are fields, methods, and the attributes that can appear on * classes: - *

+ * * {@snippet lang="text" : * ClassElement = * FieldModel*(UtfEntry name, Utf8Entry descriptor) @@ -468,7 +468,7 @@ * | PermittedSubclassesAttribute?(List permittedSubclasses) * | DeclarationElement* * } - *

+ * * where {@code DeclarationElement} are the elements that are common to all declarations * (classes, methods, fields) and so are factored out: * diff --git a/src/java.base/share/classes/java/lang/foreign/Arena.java b/src/java.base/share/classes/java/lang/foreign/Arena.java index c9a79c9700d..9585e613805 100644 --- a/src/java.base/share/classes/java/lang/foreign/Arena.java +++ b/src/java.base/share/classes/java/lang/foreign/Arena.java @@ -61,7 +61,7 @@ import java.util.function.Consumer; * by the garbage collector. The scope of an automatic arena is an automatic scope. As * such, the regions of memory backing memory segments allocated with the automatic arena * are deallocated at some unspecified time after the automatic arena (and all - * the segments allocated by it) becomes unreachable, + * the segments allocated by it) becomes {@linkplain java.lang.ref##reachability unreachable}, * as shown below: * {@snippet lang = java: * MemorySegment segment = Arena.ofAuto().allocate(100, 1); // @highlight regex='ofAuto()' diff --git a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java index 83a8b09f9d4..82f6b358a07 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java +++ b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java @@ -517,7 +517,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * * @apiNote When using this method to pass a segment address to some external * operation (e.g. a JNI function), clients must ensure that the segment is - * kept reachable + * kept {@linkplain java.lang.ref##reachability reachable} * for the entire duration of the operation. A failure to do so might result * in the premature deallocation of the region of memory backing the memory * segment, in case the segment has been allocated with an @@ -785,7 +785,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * backing region of memory is no longer available. Furthermore, if the * provided scope is the scope of an {@linkplain Arena#ofAuto() automatic arena}, * the cleanup action must not prevent the scope from becoming - * unreachable. + * {@linkplain java.lang.ref##reachability unreachable}. * A failure to do so will permanently prevent the regions of memory * allocated by the automatic arena from being deallocated. * @@ -836,7 +836,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * backing region of memory is no longer available. Furthermore, if the * provided scope is the scope of an {@linkplain Arena#ofAuto() automatic arena}, * the cleanup action must not prevent the scope from becoming - * unreachable. + * {@linkplain java.lang.ref##reachability unreachable}. * A failure to do so will permanently prevent the regions of memory * allocated by the automatic arena from being deallocated. * @@ -2662,7 +2662,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * invalidated, either {@link Arena#close() explicitly}, or automatically, by the * garbage collector. A segment scope that is invalidated automatically is an * automatic scope. An automatic scope is always {@link #isAlive() alive} - * as long as it is reachable. + * as long as it is {@linkplain java.lang.ref##reachability reachable}. * Segments associated with an automatic scope are: *