8305206: Add @spec tags in java.base/java.* (part 1)

Reviewed-by: alanb, naoto, darcy, lancea, dfuchs, iris, mchung
This commit is contained in:
Jonathan Gibbons 2023-04-04 00:09:38 +00:00
parent ccbb0e8d89
commit c6bd489cc8
60 changed files with 268 additions and 2 deletions

View file

@ -117,6 +117,14 @@ import java.net.StandardSocketOptions; // javadoc
* MembershipKey key = dc.join(group, ni);
* </pre>
*
* @spec https://www.rfc-editor.org/info/rfc2236
* RFC 2236: Internet Group Management Protocol, Version 2
* @spec https://www.rfc-editor.org/info/rfc2710
* RFC 2710: Multicast Listener Discovery (MLD) for IPv6
* @spec https://www.rfc-editor.org/info/rfc3376
* RFC 3376: Internet Group Management Protocol, Version 3
* @spec https://www.rfc-editor.org/info/rfc3810
* RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6
* @since 1.7
*/

View file

@ -262,6 +262,13 @@ import java.util.TreeMap;
* of chars) and sequences of bytes. </p>
*
*
* @spec http://www.iana.org/assignments/character-sets Character Sets
* @spec https://www.rfc-editor.org/info/rfc2278
* RFC 2278: IANA Charset Registration Procedures
* @spec https://www.rfc-editor.org/info/rfc2279
* RFC 2279: UTF-8, a transformation format of ISO 10646
* @spec https://www.rfc-editor.org/info/rfc2781
* RFC 2781: UTF-16, an encoding of ISO 10646
* @author Mark Reinhold
* @author JSR-51 Expert Group
* @since 1.4
@ -741,6 +748,7 @@ public abstract class Charset
*
* @return {@code true} if, and only if, this charset is known by its
* implementor to be registered with the IANA
* @spec http://www.iana.org/assignments/character-sets Character Sets
*/
public final boolean isRegistered() {
return !name.startsWith("X-") && !name.startsWith("x-");

View file

@ -88,6 +88,8 @@
* NullPointerException} to be thrown.
*
*
* @spec https://www.rfc-editor.org/info/rfc2278
* RFC 2278: IANA Charset Registration Procedures
* @since 1.4
* @author Mark Reinhold
* @author JSR-51 Expert Group

View file

@ -1719,6 +1719,10 @@ public final class Files {
* @throws SecurityException
* If a security manager is installed and it denies an unspecified
* permission required by a file type detector implementation.
*
* @spec https://www.rfc-editor.org/info/rfc2045
* RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One:
* Format of Internet Message Bodies
*/
public static String probeContentType(Path path)
throws IOException

View file

@ -58,6 +58,8 @@ import java.util.*;
* <p> ACL entries are immutable and are safe for use by multiple concurrent
* threads.
*
* @spec https://www.rfc-editor.org/info/rfc3530
* RFC 3530: Network File System (NFS) version 4 Protocol
* @since 1.7
*/

View file

@ -55,6 +55,9 @@ public enum AclEntryPermission {
* <p> <a href="http://www.ietf.org/rfc/rfc3530.txt">RFC&nbsp;3530: Network
* File System (NFS) version 4 Protocol</a> defines <em>named attributes</em>
* as opaque files associated with a file in the file system.
*
* @spec https://www.rfc-editor.org/info/rfc3530
* RFC 3530: Network File System (NFS) version 4 Protocol
*/
READ_NAMED_ATTRS,
@ -64,6 +67,9 @@ public enum AclEntryPermission {
* <p> <a href="http://www.ietf.org/rfc/rfc3530.txt">RFC&nbsp;3530: Network
* File System (NFS) version 4 Protocol</a> defines <em>named attributes</em>
* as opaque files associated with a file in the file system.
*
* @spec https://www.rfc-editor.org/info/rfc3530
* RFC 3530: Network File System (NFS) version 4 Protocol
*/
WRITE_NAMED_ATTRS,

View file

@ -139,6 +139,8 @@ import java.io.IOException;
* any attempt to create a file that would be less secure as a result of the
* translation.
*
* @spec https://www.rfc-editor.org/info/rfc3530
* RFC 3530: Network File System (NFS) version 4 Protocol
* @since 1.7
*/

View file

@ -409,6 +409,9 @@ public final class FileTime
* are not present. The year before "{@code 0001}" is "{@code -0001}".
*
* @return the string representation of this file time
*
* @spec https://www.w3.org/TR/NOTE-datetime Date and Time Formats
* @spec https://www.w3.org/TR/xmlschema-2 XML Schema Part 2: Datatypes Second Edition
*/
@Override
public String toString() {

View file

@ -124,6 +124,8 @@
* or method in any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown.
*
* @spec https://www.rfc-editor.org/info/rfc3530
* RFC 3530: Network File System (NFS) version 4 Protocol
* @since 1.7
*/

View file

@ -100,6 +100,8 @@ public abstract class FileTypeDetector {
* provider then the {@link SecurityManager#checkRead(String)} method
* is invoked to check read access to the file.
*
* @spec https://www.rfc-editor.org/info/rfc2045
* RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
* @see java.nio.file.Files#probeContentType
*/
public abstract String probeContentType(Path path)