8213490: Networking area typos and inconsistencies cleanup

Reviewed-by: alanb, chegar, dfuchs
This commit is contained in:
Pavel Rappo 2018-11-13 12:24:34 +00:00
parent 56db122656
commit 8c361a3e74
42 changed files with 87 additions and 87 deletions

View file

@ -62,7 +62,7 @@ import sun.util.logging.PlatformLogger;
* <ul>
* <li>
* CookieHandler is at the core of cookie management. User can call
* CookieHandler.setDefault to set a concrete CookieHanlder implementation
* CookieHandler.setDefault to set a concrete CookieHandler implementation
* to be used.
* </li>
* <li>
@ -354,7 +354,7 @@ public class CookieManager extends CookieHandler
private boolean shouldAcceptInternal(URI uri, HttpCookie cookie) {
try {
return policyCallback.shouldAccept(uri, cookie);
} catch (Exception ignored) { // pretect against malicious callback
} catch (Exception ignored) { // protect against malicious callback
return false;
}
}

View file

@ -304,7 +304,7 @@ class DatagramSocket implements java.io.Closeable {
private void checkOldImpl() {
if (impl == null)
return;
// DatagramSocketImpl.peekdata() is a protected method, therefore we need to use
// DatagramSocketImpl.peekData() is a protected method, therefore we need to use
// getDeclaredMethod, therefore we need permission to access the member
try {
AccessController.doPrivileged(
@ -660,7 +660,7 @@ class DatagramSocket implements java.io.Closeable {
throw new SocketException("Socket is closed");
checkAddress (p.getAddress(), "send");
if (connectState == ST_NOT_CONNECTED) {
// check the address is ok wiht the security manager on every send.
// check the address is ok with the security manager on every send.
SecurityManager security = System.getSecurityManager();
// The reason you want to synchronize on datagram packet
@ -1070,7 +1070,7 @@ class DatagramSocket implements java.io.Closeable {
*
* @param on whether to enable or disable the
* @exception SocketException if an error occurs enabling or
* disabling the {@code SO_RESUEADDR} socket option,
* disabling the {@code SO_REUSEADDR} socket option,
* or the socket is closed.
* @since 1.4
* @see #getReuseAddress()

View file

@ -666,7 +666,7 @@ public final class HttpCookie implements Cloneable {
int domainLength = domain.length();
int lengthDiff = host.length() - domainLength;
if (lengthDiff == 0) {
// if the host name and the domain name are just string-compare euqal
// if the host name and the domain name are just string-compare equal
return host.equalsIgnoreCase(domain);
}
else if (lengthDiff > 0) {
@ -1131,7 +1131,7 @@ public final class HttpCookie implements Cloneable {
* Split cookie header string according to rfc 2965:
* 1) split where it is a comma;
* 2) but not the comma surrounding by double-quotes, which is the comma
* inside port list or embeded URIs.
* inside port list or embedded URIs.
*
* @param header
* the cookie header string to split

View file

@ -407,7 +407,7 @@ public final class IDN {
// 26-letter Latin alphabet <A-Z a-z>, the digits <0-9>, and the hyphen
// <->.
// Non LDH refers to characters in the ASCII range, but which are not
// letters, digits or the hypen.
// letters, digits or the hyphen.
//
// non-LDH = 0..0x2C, 0x2E..0x2F, 0x3A..0x40, 0x5B..0x60, 0x7B..0x7F
//

View file

@ -54,7 +54,7 @@ class InMemoryCookieStore implements CookieStore {
private Map<String, List<HttpCookie>> domainIndex = null;
private Map<URI, List<HttpCookie>> uriIndex = null;
// use ReentrantLock instead of syncronized for scalability
// use ReentrantLock instead of synchronized for scalability
private ReentrantLock lock = null;
@ -260,7 +260,7 @@ class InMemoryCookieStore implements CookieStore {
int domainLength = domain.length();
int lengthDiff = host.length() - domainLength;
if (lengthDiff == 0) {
// if the host name and the domain name are just string-compare euqal
// if the host name and the domain name are just string-compare equal
return host.equalsIgnoreCase(domain);
} else if (lengthDiff > 0) {
// need to check H & D component
@ -301,7 +301,7 @@ class InMemoryCookieStore implements CookieStore {
toRemove.add(c);
}
} else {
// the cookie has beed removed from main store,
// the cookie has been removed from main store,
// so also remove it from domain indexed store
toRemove.add(c);
}
@ -345,7 +345,7 @@ class InMemoryCookieStore implements CookieStore {
cookieJar.remove(ck);
}
} else {
// the cookie has beed removed from main store,
// the cookie has been removed from main store,
// so also remove it from domain indexed store
it.remove();
}

View file

@ -164,7 +164,7 @@ class Inet4Address extends InetAddress {
/**
* Utility routine to check if the InetAddress is a wildcard address.
* @return a {@code boolean} indicating if the Inetaddress is
* @return a {@code boolean} indicating if the InetAddress is
* a wildcard address.
*/
public boolean isAnyLocalAddress() {

View file

@ -415,7 +415,7 @@ class Inet6Address extends InetAddress {
* set to the value corresponding to the given interface for the address
* type specified in {@code addr}. The call will fail with an
* UnknownHostException if the given interface does not have a numeric
* scope_id assigned for the given address type (eg. link-local or site-local).
* scope_id assigned for the given address type (e.g. link-local or site-local).
* See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
*
@ -507,7 +507,7 @@ class Inet6Address extends InetAddress {
/* check the two Ipv6 addresses and return false if they are both
* non global address types, but not the same.
* (ie. one is sitelocal and the other linklocal)
* (i.e. one is site-local and the other link-local)
* return true otherwise.
*/
@ -683,7 +683,7 @@ class Inet6Address extends InetAddress {
/**
* Utility routine to check if the InetAddress is a wildcard address.
*
* @return a {@code boolean} indicating if the Inetaddress is
* @return a {@code boolean} indicating if the InetAddress is
* a wildcard address.
*/
@Override
@ -821,7 +821,7 @@ class Inet6Address extends InetAddress {
/**
* Returns the scoped interface, if this instance was created with
* with a scoped interface.
* a scoped interface.
*
* @return the scoped interface, or null if not set.
* @since 1.5

View file

@ -377,7 +377,7 @@ class InetAddress implements java.io.Serializable {
/**
* Utility routine to check if the InetAddress is a wildcard address.
* @return a {@code boolean} indicating if the Inetaddress is
* @return a {@code boolean} indicating if the InetAddress is
* a wildcard address.
* @since 1.4
*/
@ -1022,7 +1022,7 @@ class InetAddress implements java.io.Serializable {
* <p>Lookup a host mapping by name. Retrieve the IP addresses
* associated with a host.
*
* <p>Search the configured hosts file for the addresses assocaited with
* <p>Search the configured hosts file for the addresses associated
* with the specified host name.
*
* @param host the specified hostname
@ -1038,7 +1038,7 @@ class InetAddress implements java.io.Serializable {
byte addr[] = new byte[4];
ArrayList<InetAddress> inetAddresses = null;
// lookup the file and create a list InetAddress for the specfied host
// lookup the file and create a list InetAddress for the specified host
try (Scanner hostsFileScanner = new Scanner(new File(hostsFile), "UTF-8")) {
while (hostsFileScanner.hasNextLine()) {
hostEntry = hostsFileScanner.nextLine();
@ -1341,7 +1341,7 @@ class InetAddress implements java.io.Serializable {
throw new UnknownHostException(host + ": invalid IPv6 address");
}
} else if (ipv6Expected) {
// Means an IPv4 litteral between brackets!
// Means an IPv4 literal between brackets!
throw new UnknownHostException("["+host+"]");
}
InetAddress[] ret = new InetAddress[1];
@ -1358,7 +1358,7 @@ class InetAddress implements java.io.Serializable {
return ret;
}
} else if (ipv6Expected) {
// We were expecting an IPv6 Litteral, but got something else
// We were expecting an IPv6 Literal, but got something else
throw new UnknownHostException("["+host+"]");
}
return getAllByName0(host, reqAddr, true, true);

View file

@ -170,7 +170,7 @@ public final class NetworkInterface {
* a SecurityException will be returned in the List.
*
* @return a {@code List} object with all or a subset of the
* InterfaceAddresss of this network interface
* InterfaceAddress of this network interface
* @since 1.6
*/
public java.util.List<InterfaceAddress> getInterfaceAddresses() {

View file

@ -136,7 +136,7 @@ public abstract class ProxySelector {
* @param uri
* The URI that a connection is required to
*
* @return a List of Proxies. Each element in the
* @return a List of Proxies. Each element in
* the List is of type
* {@link java.net.Proxy Proxy};
* when no proxy is available, the list will

View file

@ -91,7 +91,7 @@ public abstract class ResponseCache {
/**
* Sets (or unsets) the system-wide cache.
*
* Note: non-standard procotol handlers may ignore this setting.
* Note: non-standard protocol handlers may ignore this setting.
*
* @param responseCache The response cache, or
* {@code null} to unset the cache.

View file

@ -82,7 +82,7 @@ public abstract class SecureCacheResponse extends CacheResponse {
* retrieved the network resource.
*
* @return the server's principal. Returns an X500Principal of the
* end-entity certiticate for X509-based cipher suites, and
* end-entity certificate for X509-based cipher suites, and
* KerberosPrincipal for Kerberos cipher suites.
*
* @throws SSLPeerUnverifiedException if the peer was not verified.

View file

@ -166,7 +166,7 @@ class ServerSocket implements java.io.Closeable {
* The {@code backlog} argument is the requested maximum number of
* pending connections on the socket. Its exact semantics are implementation
* specific. In particular, an implementation may impose a maximum length
* or may choose to ignore the parameter altogther. The value provided
* or may choose to ignore the parameter altogether. The value provided
* should be greater than {@code 0}. If it is less than or equal to
* {@code 0}, then an implementation specific default will be used.
*
@ -214,7 +214,7 @@ class ServerSocket implements java.io.Closeable {
* The {@code backlog} argument is the requested maximum number of
* pending connections on the socket. Its exact semantics are implementation
* specific. In particular, an implementation may impose a maximum length
* or may choose to ignore the parameter altogther. The value provided
* or may choose to ignore the parameter altogether. The value provided
* should be greater than {@code 0}. If it is less than or equal to
* {@code 0}, then an implementation specific default will be used.
*
@ -351,7 +351,7 @@ class ServerSocket implements java.io.Closeable {
* The {@code backlog} argument is the requested maximum number of
* pending connections on the socket. Its exact semantics are implementation
* specific. In particular, an implementation may impose a maximum length
* or may choose to ignore the parameter altogther. The value provided
* or may choose to ignore the parameter altogether. The value provided
* should be greater than {@code 0}. If it is less than or equal to
* {@code 0}, then an implementation specific default will be used.
* @param endpoint The IP address and port number to bind to.
@ -826,7 +826,7 @@ class ServerSocket implements java.io.Closeable {
* <p>
* The value of {@link SocketOptions#SO_RCVBUF SO_RCVBUF} is used both to
* set the size of the internal socket receive buffer, and to set the size
* of the TCP receive window that is advertized to the remote peer.
* of the TCP receive window that is advertised to the remote peer.
* <p>
* It is possible to change the value subsequently, by calling
* {@link Socket#setReceiveBufferSize(int)}. However, if the application

View file

@ -1237,7 +1237,7 @@ class Socket implements java.io.Closeable {
* should call {@link #getReceiveBufferSize()}.
*
* <p>The value of {@link SocketOptions#SO_RCVBUF SO_RCVBUF} is also used
* to set the TCP receive window that is advertized to the remote peer.
* to set the TCP receive window that is advertised to the remote peer.
* Generally, the window size can be modified at any time when a socket is
* connected. However, if a receive window larger than 64K is required then
* this must be requested <B>before</B> the socket is connected to the
@ -1578,10 +1578,10 @@ class Socket implements java.io.Closeable {
* <p>
* Note: Closing a socket doesn't clear its connection state, which means
* this method will return {@code true} for a closed socket
* (see {@link #isClosed()}) if it was successfuly connected prior
* (see {@link #isClosed()}) if it was successfully connected prior
* to being closed.
*
* @return true if the socket was successfuly connected to a server
* @return true if the socket was successfully connected to a server
* @since 1.4
*/
public boolean isConnected() {
@ -1594,10 +1594,10 @@ class Socket implements java.io.Closeable {
* <p>
* Note: Closing a socket doesn't clear its binding state, which means
* this method will return {@code true} for a closed socket
* (see {@link #isClosed()}) if it was successfuly bound prior
* (see {@link #isClosed()}) if it was successfully bound prior
* to being closed.
*
* @return true if the socket was successfuly bound to an address
* @return true if the socket was successfully bound to an address
* @since 1.4
* @see #bind
*/

View file

@ -51,7 +51,7 @@ class SocketOutputStream extends FileOutputStream {
* Creates a new SocketOutputStream. Can only be called
* by a Socket. This method needs to hang on to the owner Socket so
* that the fd will not be closed.
* @param impl the socket output stream inplemented
* @param impl the socket output stream implemented
*/
SocketOutputStream(AbstractPlainSocketImpl impl) throws IOException {
super(impl.getFileDescriptor());

View file

@ -283,7 +283,7 @@ public final class SocketPermission extends Permission
* nr = new SocketPermission("204.160.241.0:1024-65535", "connect");
* </pre>
*
* @param host the hostname or IPaddress of the computer, optionally
* @param host the hostname or IP address of the computer, optionally
* including a colon followed by a port or port range.
* @param action the action string.
*/
@ -317,7 +317,7 @@ public final class SocketPermission extends Permission
if ((ind = host.indexOf(':')) != host.lastIndexOf(':')) {
/* More than one ":", meaning IPv6 address is not
* in RFC 2732 format;
* We will rectify user errors for all unambiguious cases
* We will rectify user errors for all unambiguous cases
*/
StringTokenizer st = new StringTokenizer(host, ":");
int tokens = st.countTokens();
@ -961,7 +961,7 @@ public final class SocketPermission extends Permission
return (that.cname.endsWith(this.cname));
}
// comapare IP addresses
// compare IP addresses
if (this.addresses == null) {
this.getIP();
}

View file

@ -51,7 +51,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
private Socket cmdsock = null;
private InputStream cmdIn = null;
private OutputStream cmdOut = null;
/* true if the Proxy has been set programatically */
/* true if the Proxy has been set programmatically */
private boolean applicationSetProxy; /* false */
@ -145,7 +145,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
}
/**
* Provides the authentication machanism required by the proxy.
* Provides the authentication mechanism required by the proxy.
*/
private boolean authenticate(byte method, InputStream in,
BufferedOutputStream out) throws IOException {
@ -158,7 +158,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
// No Authentication required. We're done then!
if (method == NO_AUTH)
return true;
/**
/*
* User/Password authentication. Try, in that order :
* - The application provided Authenticator, if any
* - the user.name & no password (backward compatibility behavior).
@ -377,7 +377,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
URI uri;
// Use getHostString() to avoid reverse lookups
String host = epoint.getHostString();
// IPv6 litteral?
// IPv6 literal?
if (epoint.getAddress() instanceof Inet6Address &&
(!host.startsWith("[")) && (host.indexOf(':') >= 0)) {
host = "[" + host + "]";
@ -692,7 +692,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
URI uri;
// Use getHostString() to avoid reverse lookups
String host = saddr.getHostString();
// IPv6 litteral?
// IPv6 literal?
if (saddr.getAddress() instanceof Inet6Address &&
(!host.startsWith("[")) && (host.indexOf(':') >= 0)) {
host = "[" + host + "]";

View file

@ -861,9 +861,9 @@ public final class URI
*
* <p> This method is provided for use in situations where it is known that
* the given string is a legal URI, for example for URI constants declared
* within in a program, and so it would be considered a programming error
* within a program, and so it would be considered a programming error
* for the string not to parse as such. The constructors, which throw
* {@link URISyntaxException} directly, should be used situations where a
* {@link URISyntaxException} directly, should be used in situations where a
* URI is being constructed from user input or from some other source that
* may be prone to errors. </p>
*

View file

@ -1009,7 +1009,7 @@ public final class URL implements java.io.Serializable {
* can not be converted to a URI.
*
* @exception URISyntaxException if this URL is not formatted strictly according to
* to RFC2396 and cannot be converted to a URI.
* RFC2396 and cannot be converted to a URI.
*
* @return a URI instance equivalent to this URL.
* @since 1.5
@ -1054,7 +1054,7 @@ public final class URL implements java.io.Serializable {
/**
* Same as {@link #openConnection()}, except that the connection will be
* made through the specified proxy; Protocol handlers that do not
* support proxing will ignore the proxy parameter and make a
* support proxying will ignore the proxy parameter and make a
* normal connection.
*
* Invoking this method preempts the system's default

View file

@ -109,7 +109,7 @@ public class URLEncoder {
* list. It is also noteworthy that this is consistent with
* O'Reilly's "HTML: The Definitive Guide" (page 164).
*
* As a last note, Intenet Explorer does not encode the "@"
* As a last note, Internet Explorer does not encode the "@"
* character which is clearly not unreserved according to the
* RFC. We are being consistent with the RFC in this matter,
* as is Netscape.

View file

@ -51,7 +51,7 @@ import java.security.Permission;
* portrange = portnumber | -portnumber | portnumber-[portnumber] | *
* hostrange = ([*.] dnsname) | IPv4address | IPv6address
* </pre>
* <i>dnsname</i> is a standard DNS host or domain name, ie. one or more labels
* <i>dnsname</i> is a standard DNS host or domain name, i.e. one or more labels
* separated by ".". <i>IPv4address</i> is a standard literal IPv4 address and
* <i>IPv6address</i> is as defined in <a href="http://www.ietf.org/rfc/rfc2732.txt">
* RFC 2732</a>. Literal IPv6 addresses must however, be enclosed in '[]' characters.
@ -89,7 +89,7 @@ import java.security.Permission;
* </tr>
* <tr><th scope="row">http://www.oracle.com/a/b/-</th>
* <td>The '-' character refers to all resources recursively below the
* preceding path (eg. http://www.oracle.com/a/b/c/d/e.html matches this
* preceding path (e.g. http://www.oracle.com/a/b/c/d/e.html matches this
* example).
* </td>
* </tr>

View file

@ -250,15 +250,15 @@ public abstract class URLStreamHandler {
} else if (path != null && path.length() > 0) {
isRelPath = true;
int ind = path.lastIndexOf('/');
String seperator = "";
String separator = "";
if (ind == -1 && authority != null)
seperator = "/";
path = path.substring(0, ind + 1) + seperator +
separator = "/";
path = path.substring(0, ind + 1) + separator +
spec.substring(start, limit);
} else {
String seperator = (authority != null) ? "/" : "";
path = seperator + spec.substring(start, limit);
String separator = (authority != null) ? "/" : "";
path = separator + spec.substring(start, limit);
}
} else if (queryOnly && path != null) {
int ind = path.lastIndexOf('/');
@ -314,7 +314,7 @@ public abstract class URLStreamHandler {
/**
* Returns the default port for a URL parsed by this handler. This method
* is meant to be overidden by handlers with default port numbers.
* is meant to be overridden by handlers with default port numbers.
* @return the default port for a {@code URL} parsed by this handler.
* @since 1.3
*/
@ -323,14 +323,14 @@ public abstract class URLStreamHandler {
}
/**
* Provides the default equals calculation. May be overidden by handlers
* Provides the default equals calculation. May be overridden by handlers
* for other protocols that have different requirements for equals().
* This method requires that none of its arguments is null. This is
* guaranteed by the fact that it is only called by java.net.URL class.
* @param u1 a URL object
* @param u2 a URL object
* @return {@code true} if the two urls are
* considered equal, ie. they refer to the same
* considered equal, i.e. they refer to the same
* fragment in the same file.
* @since 1.3
*/
@ -342,7 +342,7 @@ public abstract class URLStreamHandler {
}
/**
* Provides the default hash calculation. May be overidden by handlers for
* Provides the default hash calculation. May be overridden by handlers for
* other protocols that have different requirements for hashCode
* calculation.
* @param u a URL object

View file

@ -30,7 +30,7 @@ import java.net.URLStreamHandlerFactory;
/**
* URL stream handler service-provider class.
*
*<p> A URL stream handler provider is a concrete subclass of this class that
* <p> A URL stream handler provider is a concrete subclass of this class that
* has a zero-argument constructor. URL stream handler providers may be
* installed in an instance of the Java platform by adding them to the
* application class path.

View file

@ -177,7 +177,7 @@ public interface MulticastChannel
* @throws SecurityException
* If a security manager is set, and its
* {@link SecurityManager#checkMulticast(InetAddress) checkMulticast}
* method denies access to the multiast group
* method denies access to the multicast group
*/
MembershipKey join(InetAddress group, NetworkInterface interf)
throws IOException;
@ -226,7 +226,7 @@ public interface MulticastChannel
* @throws SecurityException
* If a security manager is set, and its
* {@link SecurityManager#checkMulticast(InetAddress) checkMulticast}
* method denies access to the multiast group
* method denies access to the multicast group
*/
MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source)
throws IOException;