8273616: Fix trivial doc typos in the java.base module

Reviewed-by: jrose, iris, lancea, dfuchs, rriggs
This commit is contained in:
Pavel Rappo 2021-09-13 17:46:13 +00:00
parent 7c26ddb575
commit b4b121018d
34 changed files with 55 additions and 55 deletions

View File

@ -46,7 +46,7 @@ public class CharArrayReader extends Reader {
protected int markedPos = 0;
/**
* The index of the end of this buffer. There is not valid
* The index of the end of this buffer. There is no valid
* data at or beyond this index.
*/
protected int count;

View File

@ -28,7 +28,7 @@ package java.io;
import java.util.Arrays;
/**
* This class implements a character buffer that can be used as an Writer.
* This class implements a character buffer that can be used as a Writer.
* The buffer automatically grows when data is written to the stream. The data
* can be retrieved using toCharArray() and toString().
* <P>

View File

@ -2022,7 +2022,7 @@ public class File
} else {
// Name exceeds the maximum path component length: shorten it
// Attempt to shorten the prefix length to no less then 3
// Attempt to shorten the prefix length to no less than 3
prefixLength = shortenSubName(prefixLength, excess, 3);
excess = prefixLength + nusLength + suffixLength - nameMax;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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
@ -65,7 +65,7 @@ final class FileCleanable extends PhantomCleanable<FileDescriptor> {
* Register a Cleanable with the FileDescriptor
* if the FileDescriptor is non-null and valid.
* @implNote
* A exception (OutOfMemoryException) will leave the FileDescriptor
* An exception (OutOfMemoryException) will leave the FileDescriptor
* having allocated resources and leak the fd/handle.
*
* @param fdo the FileDescriptor; may be null

View File

@ -879,14 +879,14 @@ public class ObjectInputStream
* objects is disabled until enableResolveObject is called. The
* enableResolveObject method checks that the stream requesting to resolve
* object can be trusted. Every reference to serializable objects is passed
* to resolveObject. To insure that the private state of objects is not
* to resolveObject. To ensure that the private state of objects is not
* unintentionally exposed only trusted streams may use resolveObject.
*
* <p>This method is called after an object has been read but before it is
* returned from readObject. The default resolveObject method just returns
* the same object.
*
* <p>When a subclass is replacing objects it must insure that the
* <p>When a subclass is replacing objects it must ensure that the
* substituted object is compatible with every field where the reference
* will be stored. Objects whose type is not a subclass of the type of the
* field or array element abort the deserialization by raising an exception

View File

@ -568,7 +568,7 @@ public class ObjectOutputStream
* Object (as opposed to type Serializable) to allow for cases where
* non-serializable objects are replaced by serializable ones.
*
* <p>When a subclass is replacing objects it must insure that either a
* <p>When a subclass is replacing objects it must ensure that either a
* complementary substitution must be made during deserialization or that
* the substituted object is compatible with every field where the
* reference will be stored. Objects whose type is not a subclass of the
@ -1419,7 +1419,7 @@ public class ObjectOutputStream
}
/**
* Writes representation of a "ordinary" (i.e., not a String, Class,
* Writes representation of an "ordinary" (i.e., not a String, Class,
* ObjectStreamClass, array, or enum constant) serializable object to the
* stream.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -458,7 +458,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param codePointOffset the offset in code points
* @return the index within this sequence
* @throws IndexOutOfBoundsException if {@code index}
* is negative or larger then the length of this sequence,
* is negative or larger than the length of this sequence,
* or if {@code codePointOffset} is positive and the subsequence
* starting with {@code index} has fewer than
* {@code codePointOffset} code points,

View File

@ -9313,7 +9313,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
* @return the index within the char sequence
* @throws NullPointerException if {@code seq} is null.
* @throws IndexOutOfBoundsException if {@code index}
* is negative or larger then the length of the char sequence,
* is negative or larger than the length of the char sequence,
* or if {@code codePointOffset} is positive and the
* subsequence starting with {@code index} has fewer than
* {@code codePointOffset} code points, or if

View File

@ -2247,7 +2247,7 @@ public abstract class ClassLoader {
* for consistency with the existing {@link #getPackages} method.
*
* @return The array of {@code Package} objects that have been defined by
* this class loader; or an zero length array if no package has been
* this class loader; or a zero length array if no package has been
* defined by this class loader.
*
* @jvms 5.3 Creation and Loading

View File

@ -440,7 +440,7 @@ public abstract class Process {
* terminated and the timeout value is less than, or equal to, zero, then
* this method returns immediately with the value {@code false}.
*
* <p>The default implementation of this methods polls the {@code exitValue}
* <p>The default implementation of this method polls the {@code exitValue}
* to check if the process has terminated. Concrete implementations of this
* class are strongly encouraged to override this method with a more
* efficient implementation.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2021, 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
@ -862,7 +862,7 @@ public class Throwable implements Serializable {
* @param stackTrace the stack trace elements to be associated with
* this {@code Throwable}. The specified array is copied by this
* call; changes in the specified array after the method invocation
* returns will have no affect on this {@code Throwable}'s stack
* returns will have no effect on this {@code Throwable}'s stack
* trace.
*
* @throws NullPointerException if {@code stackTrace} is

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, 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
@ -30,7 +30,7 @@ import java.lang.invoke.MethodHandles.Lookup;
/**
* An interface providing full static information about a particular
* call to a
* <a href="package-summary.html#bsm">bootstrap method</a> of an
* <a href="package-summary.html#bsm">bootstrap method</a> of a
* dynamic call site or dynamic constant.
* This information includes the method itself, the associated
* name and type, and any associated static arguments.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021, 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
@ -1399,7 +1399,7 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
* a new array of type {@code arrayType}, whose elements
* comprise (in order) the replaced arguments.
* <p>
* The caller type must provides as least enough arguments,
* The caller type must provide at least enough arguments,
* and of the correct type, to satisfy the target's requirement for
* positional arguments before the trailing array argument.
* Thus, the caller must supply, at a minimum, {@code N-1} arguments,
@ -1493,7 +1493,7 @@ assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
* array or a single element of an array to be collected.
* Note that the dynamic type of the trailing argument has no
* effect on this decision, only a comparison between the symbolic
* type descriptor of the call site and the type descriptor of the method handle.)
* type descriptor of the call site and the type descriptor of the method handle.
*
* @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
* @return a new method handle which can collect any number of trailing arguments
@ -1548,7 +1548,7 @@ assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
* except that {@link #isVarargsCollector isVarargsCollector}
* will be false.
* The fixed-arity method handle may (or may not) be the
* a previous argument to {@code asVarargsCollector}.
* previous argument to {@code asVarargsCollector}.
* <p>
* Here is an example, of a list-making variable arity method handle:
* <blockquote><pre>{@code

View File

@ -57,7 +57,7 @@ import java.util.Objects;
*
* <p>The identity of a function object produced by deserializing the serialized
* form is unpredictable, and therefore identity-sensitive operations (such as
* reference equality, object locking, and {@code System.identityHashCode()} may
* reference equality, object locking, and {@code System.identityHashCode()}) may
* produce different results in different implementations, or even upon
* different deserializations in the same implementation.
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, 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
@ -382,7 +382,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
* {@code invokevirtual} instruction is linked.
* <p>
* Apart from type descriptor checks, a VarHandles's capability to
* access it's variables is unrestricted.
* access its variables is unrestricted.
* If a VarHandle is formed on a non-public variable by a class that has access
* to that variable, the resulting VarHandle can be used in any place by any
* caller who receives a reference to it.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, 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
@ -39,7 +39,7 @@ import java.io.IOException;
* The application's content handler factory (an instance of a class that
* implements the interface {@code ContentHandlerFactory} set up by a call to
* {@link URLConnection#setContentHandlerFactory(ContentHandlerFactory)
* setContentHandlerFactory} is called with a {@code String} giving the
* setContentHandlerFactory}) is called with a {@code String} giving the
* MIME type of the object being received on the socket. The factory returns an
* instance of a subclass of {@code ContentHandler}, and its
* {@code getContent} method is called to create the object.

View File

@ -169,7 +169,7 @@ public class CookieManager extends CookieHandler
/**
* To set the cookie policy of this cookie manager.
*
* <p> A instance of {@code CookieManager} will have
* <p> An instance of {@code CookieManager} will have
* cookie policy ACCEPT_ORIGINAL_SERVER by default. Users always
* can call this method to set another cookie policy.
*

View File

@ -1376,7 +1376,7 @@ public class DatagramSocket implements java.io.Closeable {
* {@code java.net.MulticastSocket}.
* @return {@code null} if {@code bindaddr == NO_DELEGATE}, otherwise returns a
* delegate for the requested {@code type}.
* @throws SocketException if an exception occurs while creating or binding the
* @throws SocketException if an exception occurs while creating or binding
* the delegate.
*/
static <T extends DatagramSocket> T createDelegate(SocketAddress bindaddr, Class<T> type)

View File

@ -474,7 +474,7 @@ public final class HttpCookie implements Cloneable {
/**
* Returns {@code true} if sending this cookie should be restricted to a
* secure protocol, or {@code false} if the it can be sent using any
* secure protocol, or {@code false} if it can be sent using any
* protocol.
*
* @return {@code false} if the cookie can be sent over any standard

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@ -186,7 +186,7 @@ class Inet4Address extends InetAddress {
}
/**
* Utility routine to check if the InetAddress is an link local address.
* Utility routine to check if the InetAddress is a link local address.
*
* @return a {@code boolean} indicating if the InetAddress is
* a link local address; or false if address is not a link local unicast address.

View File

@ -710,7 +710,7 @@ class Inet6Address extends InetAddress {
}
/**
* Utility routine to check if the InetAddress is an link local address.
* Utility routine to check if the InetAddress is a link local address.
*
* @return a {@code boolean} indicating if the InetAddress is a link local
* address; or false if address is not a link local unicast address.

View File

@ -400,7 +400,7 @@ public class InetAddress implements java.io.Serializable {
}
/**
* Utility routine to check if the InetAddress is an link local address.
* Utility routine to check if the InetAddress is a link local address.
*
* @return a {@code boolean} indicating if the InetAddress is
* a link local address; or false if address is not a link local unicast address.
@ -486,7 +486,7 @@ public class InetAddress implements java.io.Serializable {
/**
* Test whether that address is reachable. Best effort is made by the
* implementation to try to reach the host, but firewalls and server
* configuration may block requests resulting in a unreachable status
* configuration may block requests resulting in an unreachable status
* while some specific ports may be accessible.
* A typical implementation will use ICMP ECHO REQUESTs if the
* privilege can be obtained, otherwise it will try to establish

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -108,7 +108,7 @@ public class Proxy {
/**
* Returns the socket address of the proxy, or
* {@code null} if its a direct connection.
* {@code null} if it's a direct connection.
*
* @return a {@code SocketAddress} representing the socket end
* point of the proxy

View File

@ -132,7 +132,7 @@ public abstract class ProxySelector {
* Selects all the applicable proxies based on the protocol to
* access the resource with and a destination address to access
* the resource at.
* The format of the URI is defined as follow:
* The format of the URI is defined as follows:
* <UL>
* <LI>http URI for http connections</LI>
* <LI>https URI for https connections

View File

@ -873,7 +873,7 @@ public final class SocketPermission extends Permission
/**
* Checks if the incoming Permission's action are a proper subset of
* the this object's actions.
* this object's actions.
* <P>
* Check, in the following order:
* <ul>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, 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
@ -263,7 +263,7 @@ public class CoderResult {
*
* @throws UnmappableCharacterException
* If this object represents an unmappable-character error; the
* exceptions length value will be that of this object
* exception's length value will be that of this object
*/
public void throwException()
throws CharacterCodingException

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, 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
@ -66,7 +66,7 @@ import java.io.IOException;
* directory. The {@link #getRootDirectories getRootDirectories} method may be
* used to iterate over the root directories in the file system. A file system
* is typically composed of one or more underlying {@link FileStore file-stores}
* that provide the storage for the files. Theses file stores can also vary in
* that provide the storage for the files. These file stores can also vary in
* the features they support, and the file attributes or <em>meta-data</em> that
* they associate with files.
*

View File

@ -1841,7 +1841,7 @@ public final class Files {
* installed, its {@link SecurityManager#checkRead(String) checkRead}
* method is invoked to check read access to the file. If this
* method is invoked to read security sensitive attributes then the
* security manager may be invoke to check for additional permissions.
* security manager may be invoked to check for additional permissions.
*/
public static <A extends BasicFileAttributes> A readAttributes(Path path,
Class<A> type,
@ -2075,7 +2075,7 @@ public final class Files {
* installed, its {@link SecurityManager#checkRead(String) checkRead}
* method denies read access to the file. If this method is invoked
* to read security sensitive attributes then the security manager
* may be invoke to check for additional permissions.
* may be invoked to check for additional permissions.
*/
public static Map<String,Object> readAttributes(Path path, String attributes,
LinkOption... options)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, 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
@ -301,7 +301,7 @@ public interface SecureDirectoryStream<T>
* @param options
* options indicating how symbolic links are handled
*
* @return a new file attribute view of the specified type bound to a
* @return a new file attribute view of the specified type bound to
* this directory stream, or {@code null} if the attribute view
* type is not available
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, 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
@ -177,8 +177,8 @@ public interface UserDefinedFileAttributeView
* will not have changed.
*
* <p> If an attribute of the given name already exists then its value is
* replaced. If the attribute does not exist then it is created. If it
* implementation specific if a test to check for the existence of the
* replaced. If the attribute does not exist then it is created. It
* is implementation specific if a test to check for the existence of the
* attribute and the creation of attribute are atomic with respect to other
* file system activities.
*

View File

@ -1129,7 +1129,7 @@ public abstract class FileSystemProvider {
* installed, its {@link SecurityManager#checkRead(String) checkRead}
* method denies read access to the file. If this method is invoked
* to read security sensitive attributes then the security manager
* may be invoke to check for additional permissions.
* may be invoked to check for additional permissions.
*/
public abstract Map<String,Object> readAttributes(Path path, String attributes,
LinkOption... options)

View File

@ -75,7 +75,7 @@ public abstract class FileTypeDetector {
* <p> The means by which this method determines the file type is highly
* implementation specific. It may simply examine the file name, it may use
* a file <a href="../attribute/package-summary.html">attribute</a>,
* or it may examines bytes in the file.
* or it may examine bytes in the file.
*
* <p> The probe result is the string form of the value of a
* Multipurpose Internet Mail Extension (MIME) content type as

View File

@ -280,7 +280,7 @@ public final class Currency implements Serializable {
/**
* Constructs a {@code Currency} instance. The constructor is private
* so that we can insure that there's never more than one instance for a
* so that we can ensure that there's never more than one instance for a
* given currency.
*/
private Currency(String currencyCode, int defaultFractionDigits, int numericCode) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, 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
@ -265,7 +265,7 @@ public class Properties extends Hashtable<Object,Object> {
* If a logical line is spread across several natural lines, the
* backslash escaping the line terminator sequence, the line
* terminator sequence, and any white space at the start of the
* following line have no affect on the key or element values.
* following line have no effect on the key or element values.
* The remainder of the discussion of key and element parsing
* (when loading) will assume all the characters constituting
* the key and element appear on a single natural line after