Merge OpenJDK 8 java.net (part 1)
Partial import of upstream jdk8u60 that does not introduce behavioural
differences:
* Various documentation fixes
* Change HTML <code> and <tt> to {@code} annotation.
* Generics
* Serialization UID
* Code layout
No functional change.
Bug: 29067535
Change-Id: I7fc29692b949a27b528d1b25dfb3f0993005dfd2
diff --git a/ojluni/src/main/java/java/lang/annotation/Native.java b/ojluni/src/main/java/java/lang/annotation/Native.java
new file mode 100644
index 0000000..2f2a5a8
--- /dev/null
+++ b/ojluni/src/main/java/java/lang/annotation/Native.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.annotation;
+
+
+/**
+ * Indicates that a field defining a constant value may be referenced
+ * from native code.
+ *
+ * The annotation may be used as a hint by tools that generate native
+ * header files to determine whether a header file is required, and
+ * if so, what declarations it should contain.
+ *
+ * @since 1.8
+ * @hide TODO unhide
+ */
+@Documented
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface Native {
+}
diff --git a/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java b/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java
index 8133554..3294453 100755
--- a/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java
+++ b/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java
@@ -102,7 +102,7 @@
/**
* Sends a datagram packet. The packet contains the data and the
* destination address to send the packet to.
- * @param packet to be sent.
+ * @param p the packet to be sent.
*/
protected abstract void send(DatagramPacket p) throws IOException;
@@ -134,13 +134,13 @@
/**
* Peek at the packet to see who it is from.
- * @return the address which the packet came from.
+ * @param i the address to populate with the sender address
*/
protected abstract int peek(InetAddress i) throws IOException;
protected abstract int peekData(DatagramPacket p) throws IOException;
/**
* Receive the datagram packet.
- * @param p Packet Received.
+ * @param p the packet to receive into
*/
protected synchronized void receive(DatagramPacket p)
throws IOException {
@@ -152,7 +152,7 @@
/**
* Set the TTL (time-to-live) option.
- * @param ttl the TTL to be set.
+ * @param ttl TTL to be set.
*/
protected abstract void setTimeToLive(int ttl) throws IOException;
@@ -163,7 +163,7 @@
/**
* Set the TTL (time-to-live) option.
- * @param ttl the TTL to be set.
+ * @param ttl TTL to be set.
*/
protected abstract void setTTL(byte ttl) throws IOException;
diff --git a/ojluni/src/main/java/java/net/Authenticator.java b/ojluni/src/main/java/java/net/Authenticator.java
index bc9945c..c88a600 100755
--- a/ojluni/src/main/java/java/net/Authenticator.java
+++ b/ojluni/src/main/java/java/net/Authenticator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -103,17 +103,17 @@
* Sets the authenticator that will be used by the networking code
* when a proxy or an HTTP server asks for authentication.
* <p>
- * First, if there is a security manager, its <code>checkPermission</code>
+ * First, if there is a security manager, its {@code checkPermission}
* method is called with a
- * <code>NetPermission("setDefaultAuthenticator")</code> permission.
+ * {@code NetPermission("setDefaultAuthenticator")} permission.
* This may result in a java.lang.SecurityException.
*
- * @param a The authenticator to be set. If a is <code>null</code> then
+ * @param a The authenticator to be set. If a is {@code null} then
* any previously set authenticator is removed.
*
* @throws SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* setting the default authenticator.
*
* @see SecurityManager#checkPermission
@@ -134,9 +134,9 @@
* Ask the authenticator that has been registered with the system
* for a password.
* <p>
- * First, if there is a security manager, its <code>checkPermission</code>
+ * First, if there is a security manager, its {@code checkPermission}
* method is called with a
- * <code>NetPermission("requestPasswordAuthentication")</code> permission.
+ * {@code NetPermission("requestPasswordAuthentication")} permission.
* This may result in a java.lang.SecurityException.
*
* @param addr The InetAddress of the site requesting authorization,
@@ -151,7 +151,7 @@
*
* @throws SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* the password authentication request.
*
* @see SecurityManager#checkPermission
@@ -193,9 +193,9 @@
* because the hostname can be provided in cases where the InetAddress
* is not available.
* <p>
- * First, if there is a security manager, its <code>checkPermission</code>
+ * First, if there is a security manager, its {@code checkPermission}
* method is called with a
- * <code>NetPermission("requestPasswordAuthentication")</code> permission.
+ * {@code NetPermission("requestPasswordAuthentication")} permission.
* This may result in a java.lang.SecurityException.
*
* @param host The hostname of the site requesting authentication.
@@ -211,7 +211,7 @@
*
* @throws SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* the password authentication request.
*
* @see SecurityManager#checkPermission
@@ -254,9 +254,9 @@
* Ask the authenticator that has been registered with the system
* for a password.
* <p>
- * First, if there is a security manager, its <code>checkPermission</code>
+ * First, if there is a security manager, its {@code checkPermission}
* method is called with a
- * <code>NetPermission("requestPasswordAuthentication")</code> permission.
+ * {@code NetPermission("requestPasswordAuthentication")} permission.
* This may result in a java.lang.SecurityException.
*
* @param host The hostname of the site requesting authentication.
@@ -275,7 +275,7 @@
*
* @throws SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* the password authentication request.
*
* @see SecurityManager#checkPermission
@@ -320,8 +320,8 @@
}
/**
- * Gets the <code>hostname</code> of the
- * site or proxy requesting authentication, or <code>null</code>
+ * Gets the {@code hostname} of the
+ * site or proxy requesting authentication, or {@code null}
* if not available.
*
* @return the hostname of the connection requiring authentication, or null
@@ -333,8 +333,8 @@
}
/**
- * Gets the <code>InetAddress</code> of the
- * site requesting authorization, or <code>null</code>
+ * Gets the {@code InetAddress} of the
+ * site requesting authorization, or {@code null}
* if not available.
*
* @return the InetAddress of the site requesting authorization, or null
@@ -346,7 +346,7 @@
/**
* Gets the port number for the requested connection.
- * @return an <code>int</code> indicating the
+ * @return an {@code int} indicating the
* port for the requested connection.
*/
protected final int getRequestingPort() {
@@ -358,7 +358,7 @@
* will be based on a URL, but in a future JDK it could be, for
* example, "SOCKS" for a password-protected SOCKS5 firewall.
*
- * @return the protcol, optionally followed by "/version", where
+ * @return the protocol, optionally followed by "/version", where
* version is a version number.
*
* @see java.net.URL#getProtocol()
diff --git a/ojluni/src/main/java/java/net/ContentHandler.java b/ojluni/src/main/java/java/net/ContentHandler.java
index 9460f25..c658585 100755
--- a/ojluni/src/main/java/java/net/ContentHandler.java
+++ b/ojluni/src/main/java/java/net/ContentHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -28,21 +28,21 @@
import java.io.IOException;
/**
- * The abstract class <code>ContentHandler</code> is the superclass
- * of all classes that read an <code>Object</code> from a
- * <code>URLConnection</code>.
+ * The abstract class {@code ContentHandler} is the superclass
+ * of all classes that read an {@code Object} from a
+ * {@code URLConnection}.
* <p>
* An application does not generally call the
- * <code>getContent</code> method in this class directly. Instead, an
- * application calls the <code>getContent</code> method in class
- * <code>URL</code> or in <code>URLConnection</code>.
+ * {@code getContent} method in this class directly. Instead, an
+ * application calls the {@code getContent} method in class
+ * {@code URL} or in {@code URLConnection}.
* The application's content handler factory (an instance of a class that
- * implements the interface <code>ContentHandlerFactory</code> set
- * up by a call to <code>setContentHandler</code>) is
- * called with a <code>String</code> giving the MIME type of the
+ * implements the interface {@code ContentHandlerFactory} set
+ * up by a call to {@code setContentHandler}) 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</code>, and its
- * <code>getContent</code> method is called to create the object.
+ * instance of a subclass of {@code ContentHandler}, and its
+ * {@code getContent} method is called to create the object.
* <p>
* If no content handler could be found, URLConnection will
* look for a content handler in a user-defineable set of places.
@@ -75,7 +75,7 @@
* creates an object from it.
*
* @param urlc a URL connection.
- * @return the object read by the <code>ContentHandler</code>.
+ * @return the object read by the {@code ContentHandler}.
* @exception IOException if an I/O error occurs while reading the object.
*/
abstract public Object getContent(URLConnection urlc) throws IOException;
@@ -90,12 +90,13 @@
*
* @param urlc a URL connection.
* @param classes an array of types requested
- * @return the object read by the <code>ContentHandler</code> that is
+ * @return the object read by the {@code ContentHandler} that is
* the first match of the suggested types.
* null if none of the requested are supported.
* @exception IOException if an I/O error occurs while reading the object.
* @since 1.3
*/
+ @SuppressWarnings("rawtypes")
public Object getContent(URLConnection urlc, Class[] classes) throws IOException {
Object obj = getContent(urlc);
diff --git a/ojluni/src/main/java/java/net/ContentHandlerFactory.java b/ojluni/src/main/java/java/net/ContentHandlerFactory.java
index 69a909c..64112e3 100755
--- a/ojluni/src/main/java/java/net/ContentHandlerFactory.java
+++ b/ojluni/src/main/java/java/net/ContentHandlerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -28,10 +28,10 @@
/**
* This interface defines a factory for content handlers. An
* implementation of this interface should map a MIME type into an
- * instance of <code>ContentHandler</code>.
+ * instance of {@code ContentHandler}.
* <p>
- * This interface is used by the <code>URLStreamHandler</code> class
- * to create a <code>ContentHandler</code> for a MIME type.
+ * This interface is used by the {@code URLStreamHandler} class
+ * to create a {@code ContentHandler} for a MIME type.
*
* @author James Gosling
* @see java.net.ContentHandler
@@ -40,13 +40,13 @@
*/
public interface ContentHandlerFactory {
/**
- * Creates a new <code>ContentHandler</code> to read an object from
- * a <code>URLStreamHandler</code>.
+ * Creates a new {@code ContentHandler} to read an object from
+ * a {@code URLStreamHandler}.
*
* @param mimetype the MIME type for which a content handler is desired.
- * @return a new <code>ContentHandler</code> to read an object from a
- * <code>URLStreamHandler</code>.
+ * @return a new {@code ContentHandler} to read an object from a
+ * {@code URLStreamHandler}.
* @see java.net.ContentHandler
* @see java.net.URLStreamHandler
*/
diff --git a/ojluni/src/main/java/java/net/CookieHandler.java b/ojluni/src/main/java/java/net/CookieHandler.java
index 3fbc5bc..ef91d00 100755
--- a/ojluni/src/main/java/java/net/CookieHandler.java
+++ b/ojluni/src/main/java/java/net/CookieHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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 @@
* there is no system-wide cookie handler currently set.
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("getCookieHandler")</tt>
+ * {@link NetPermission}{@code ("getCookieHandler")}
* @see #setDefault(CookieHandler)
*/
public synchronized static CookieHandler getDefault() {
@@ -83,10 +83,10 @@
* Note: non-standard http protocol handlers may ignore this setting.
*
* @param cHandler The HTTP cookie handler, or
- * <code>null</code> to unset.
+ * {@code null} to unset.
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("setCookieHandler")</tt>
+ * {@link NetPermission}{@code ("setCookieHandler")}
* @see #getDefault()
*/
public synchronized static void setDefault(CookieHandler cHandler) {
@@ -114,7 +114,7 @@
* called after all request headers related to choosing cookies
* are added, and before the request is sent.</P>
*
- * @param uri a <code>URI</code> representing the intended use for the
+ * @param uri a {@code URI} representing the intended use for the
* cookies
* @param requestHeaders - a Map from request header
* field names to lists of field values representing
@@ -136,7 +136,7 @@
* fields that are named Set-Cookie2, present in the response
* headers into a cookie cache.
*
- * @param uri a <code>URI</code> where the cookies come from
+ * @param uri a {@code URI} where the cookies come from
* @param responseHeaders an immutable map from field names to
* lists of field values representing the response
* header fields returned
diff --git a/ojluni/src/main/java/java/net/CookieManager.java b/ojluni/src/main/java/java/net/CookieManager.java
index d3f0cad..e2d8008 100755
--- a/ojluni/src/main/java/java/net/CookieManager.java
+++ b/ojluni/src/main/java/java/net/CookieManager.java
@@ -42,7 +42,7 @@
*
* <p> The HTTP cookie management in java.net package looks like:
* <blockquote>
- * <pre>
+ * <pre>{@code
* use
* CookieHandler <------- HttpURLConnection
* ^
@@ -59,7 +59,7 @@
* | impl
* |
* Internal in-memory implementation
- * </pre>
+ * }</pre>
* <ul>
* <li>
* CookieHandler is at the core of cookie management. User can call
@@ -132,7 +132,7 @@
*
* <p>This constructor will create new cookie manager with default
* cookie store and accept policy. The effect is same as
- * <tt>CookieManager(null, null)</tt>.
+ * {@code CookieManager(null, null)}.
*/
public CookieManager() {
this(null, null);
@@ -142,12 +142,12 @@
/**
* Create a new cookie manager with specified cookie store and cookie policy.
*
- * @param store a <tt>CookieStore</tt> to be used by cookie manager.
- * if <tt>null</tt>, cookie manager will use a default one,
+ * @param store a {@code CookieStore} to be used by cookie manager.
+ * if {@code null}, cookie manager will use a default one,
* which is an in-memory CookieStore implmentation.
- * @param cookiePolicy a <tt>CookiePolicy</tt> instance
+ * @param cookiePolicy a {@code CookiePolicy} instance
* to be used by cookie manager as policy callback.
- * if <tt>null</tt>, ACCEPT_ORIGINAL_SERVER will
+ * if {@code null}, ACCEPT_ORIGINAL_SERVER will
* be used.
*/
public CookieManager(CookieStore store,
@@ -171,11 +171,11 @@
/**
* To set the cookie policy of this cookie manager.
*
- * <p> A instance of <tt>CookieManager</tt> will have
+ * <p> A instance of {@code CookieManager} will have
* cookie policy ACCEPT_ORIGINAL_SERVER by default. Users always
* can call this method to set another cookie policy.
*
- * @param cookiePolicy the cookie policy. Can be <tt>null</tt>, which
+ * @param cookiePolicy the cookie policy. Can be {@code null}, which
* has no effects on current cookie policy.
*/
public void setCookiePolicy(CookiePolicy cookiePolicy) {
@@ -205,9 +205,8 @@
Map<String, List<String>> cookieMap =
new java.util.HashMap<String, List<String>>();
// if there's no default CookieStore, no way for us to get any cookie
- if (cookieJar == null) {
+ if (cookieJar == null)
return Collections.unmodifiableMap(cookieMap);
- }
boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
List<HttpCookie> cookies = new java.util.ArrayList<HttpCookie>();
@@ -244,7 +243,6 @@
return Collections.unmodifiableMap(cookieMap);
}
-
public void
put(URI uri, Map<String, List<String>> responseHeaders)
throws IOException
@@ -259,7 +257,7 @@
if (cookieJar == null)
return;
- PlatformLogger logger = PlatformLogger.getLogger("java.net.CookieManager");
+ PlatformLogger logger = PlatformLogger.getLogger("java.net.CookieManager");
for (String headerKey : responseHeaders.keySet()) {
// RFC 2965 3.2.2, key must be 'Set-Cookie2'
// we also accept 'Set-Cookie' here for backward compatibility
@@ -279,8 +277,8 @@
cookies = HttpCookie.parse(headerValue);
} catch (IllegalArgumentException e) {
// Bogus header, make an empty list and log the error
- cookies = java.util.Collections.EMPTY_LIST;
- if (logger.isLoggable(PlatformLogger.SEVERE)) {
+ cookies = java.util.Collections.emptyList();
+ if (logger.isLoggable(PlatformLogger.Level.SEVERE)) {
logger.severe("Invalid cookie for " + uri + ": " + headerValue);
}
}
@@ -409,7 +407,7 @@
/*
* sort cookies with respect to their path: those with more specific Path attributes
- * precede those with less specific, as defined in RFC 2965 sec. 3.3.4.
+ * precede those with less specific, as defined in RFC 2965 sec. 3.3.4
*/
private List<String> sortByPath(List<HttpCookie> cookies) {
Collections.sort(cookies, new CookiePathComparator());
diff --git a/ojluni/src/main/java/java/net/CookiePolicy.java b/ojluni/src/main/java/java/net/CookiePolicy.java
index 63f0715..660f1c8 100755
--- a/ojluni/src/main/java/java/net/CookiePolicy.java
+++ b/ojluni/src/main/java/java/net/CookiePolicy.java
@@ -30,7 +30,7 @@
* and which should be rejected. Three pre-defined policy implementations
* are provided, namely ACCEPT_ALL, ACCEPT_NONE and ACCEPT_ORIGINAL_SERVER.
*
- * <p>See RFC 2965 sec. 3.3 & 7 for more detail.
+ * <p>See RFC 2965 sec. 3.3 and 7 for more detail.
*
* @author Edward Wang
* @since 1.6
@@ -69,8 +69,8 @@
*
* @param uri the URI to consult accept policy with
* @param cookie the HttpCookie object in question
- * @return <tt>true</tt> if this cookie should be accepted;
- * otherwise, <tt>false</tt>
+ * @return {@code true} if this cookie should be accepted;
+ * otherwise, {@code false}
*/
public boolean shouldAccept(URI uri, HttpCookie cookie);
}
diff --git a/ojluni/src/main/java/java/net/CookieStore.java b/ojluni/src/main/java/java/net/CookieStore.java
index a8232d2..105cc66 100755
--- a/ojluni/src/main/java/java/net/CookieStore.java
+++ b/ojluni/src/main/java/java/net/CookieStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, 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
@@ -32,8 +32,8 @@
* A CookieStore object represents a storage for cookie. Can store and retrieve
* cookies.
*
- * <p>{@link CookieManager} will call <tt>CookieStore.add</tt> to save cookies
- * for every incoming HTTP response, and call <tt>CookieStore.get</tt> to
+ * <p>{@link CookieManager} will call {@code CookieStore.add} to save cookies
+ * for every incoming HTTP response, and call {@code CookieStore.get} to
* retrieve cookie for every outgoing HTTP request. A CookieStore
* is responsible for removing HttpCookie instances which have expired.
*
@@ -48,18 +48,18 @@
* <p>A cookie to store may or may not be associated with an URI. If it
* is not associated with an URI, the cookie's domain and path attribute
* will indicate where it comes from. If it is associated with an URI and
- * its domain and path attribute are not speicifed, given URI will indicate
+ * its domain and path attribute are not specified, given URI will indicate
* where this cookie comes from.
*
* <p>If a cookie corresponding to the given URI already exists,
* then it is replaced with the new one.
*
* @param uri the uri this cookie associated with.
- * if <tt>null</tt>, this cookie will not be associated
+ * if {@code null}, this cookie will not be associated
* with an URI
* @param cookie the cookie to store
*
- * @throws NullPointerException if <tt>cookie</tt> is <tt>null</tt>
+ * @throws NullPointerException if {@code cookie} is {@code null}
*
* @see #get
*
@@ -75,7 +75,9 @@
* @return an immutable list of HttpCookie,
* return empty list if no cookies match the given URI
*
- * @throws NullPointerException if <tt>uri</tt> is <tt>null</tt>
+ * @param uri the uri associated with the cookies to be returned
+ *
+ * @throws NullPointerException if {@code uri} is {@code null}
*
* @see #add
*
@@ -106,14 +108,14 @@
* Remove a cookie from store.
*
* @param uri the uri this cookie associated with.
- * if <tt>null</tt>, the cookie to be removed is not associated
- * with an URI when added; if not <tt>null</tt>, the cookie
+ * if {@code null}, the cookie to be removed is not associated
+ * with an URI when added; if not {@code null}, the cookie
* to be removed is associated with the given URI when added.
* @param cookie the cookie to remove
*
- * @return <tt>true</tt> if this store contained the specified cookie
+ * @return {@code true} if this store contained the specified cookie
*
- * @throws NullPointerException if <tt>cookie</tt> is <tt>null</tt>
+ * @throws NullPointerException if {@code cookie} is {@code null}
*/
public boolean remove(URI uri, HttpCookie cookie);
@@ -121,7 +123,7 @@
/**
* Remove all cookies in this cookie store.
*
- * @return <tt>true</tt> if this store changed as a result of the call
+ * @return {@code true} if this store changed as a result of the call
*/
public boolean removeAll();
}
diff --git a/ojluni/src/main/java/java/net/DatagramPacket.java b/ojluni/src/main/java/java/net/DatagramPacket.java
index 43d6384..62001d7 100755
--- a/ojluni/src/main/java/java/net/DatagramPacket.java
+++ b/ojluni/src/main/java/java/net/DatagramPacket.java
@@ -62,11 +62,11 @@
int port;
/**
- * Constructs a <code>DatagramPacket</code> for receiving packets of
- * length <code>length</code>, specifying an offset into the buffer.
+ * Constructs a {@code DatagramPacket} for receiving packets of
+ * length {@code length}, specifying an offset into the buffer.
* <p>
- * The <code>length</code> argument must be less than or equal to
- * <code>buf.length</code>.
+ * The {@code length} argument must be less than or equal to
+ * {@code buf.length}.
*
* @param buf buffer for holding the incoming datagram.
* @param offset the offset for the buffer
@@ -81,11 +81,11 @@
}
/**
- * Constructs a <code>DatagramPacket</code> for receiving packets of
- * length <code>length</code>.
+ * Constructs a {@code DatagramPacket} for receiving packets of
+ * length {@code length}.
* <p>
- * The <code>length</code> argument must be less than or equal to
- * <code>buf.length</code>.
+ * The {@code length} argument must be less than or equal to
+ * {@code buf.length}.
*
* @param buf buffer for holding the incoming datagram.
* @param length the number of bytes to read.
@@ -96,10 +96,10 @@
/**
* Constructs a datagram packet for sending packets of length
- * <code>length</code> with offset <code>ioffset</code>to the
+ * {@code length} with offset {@code ioffset}to the
* specified port number on the specified host. The
- * <code>length</code> argument must be less than or equal to
- * <code>buf.length</code>.
+ * {@code length} argument must be less than or equal to
+ * {@code buf.length}.
*
* @param buf the packet data.
* @param offset the packet data offset.
@@ -119,10 +119,10 @@
/**
* Constructs a datagram packet for sending packets of length
- * <code>length</code> with offset <code>ioffset</code>to the
+ * {@code length} with offset {@code ioffset}to the
* specified port number on the specified host. The
- * <code>length</code> argument must be less than or equal to
- * <code>buf.length</code>.
+ * {@code length} argument must be less than or equal to
+ * {@code buf.length}.
*
* @param buf the packet data.
* @param offset the packet data offset.
@@ -141,9 +141,9 @@
/**
* Constructs a datagram packet for sending packets of length
- * <code>length</code> to the specified port number on the specified
- * host. The <code>length</code> argument must be less than or equal
- * to <code>buf.length</code>.
+ * {@code length} to the specified port number on the specified
+ * host. The {@code length} argument must be less than or equal
+ * to {@code buf.length}.
*
* @param buf the packet data.
* @param length the packet length.
@@ -158,9 +158,9 @@
/**
* Constructs a datagram packet for sending packets of length
- * <code>length</code> to the specified port number on the specified
- * host. The <code>length</code> argument must be less than or equal
- * to <code>buf.length</code>.
+ * {@code length} to the specified port number on the specified
+ * host. The {@code length} argument must be less than or equal
+ * to {@code buf.length}.
*
* @param buf the packet data.
* @param length the packet length.
@@ -201,8 +201,8 @@
/**
* Returns the data buffer. The data received or the data to be sent
- * starts from the <code>offset</code> in the buffer,
- * and runs for <code>length</code> long.
+ * starts from the {@code offset} in the buffer,
+ * and runs for {@code length} long.
*
* @return the buffer used to receive or send data
* @see #setData(byte[], int, int)
@@ -271,7 +271,7 @@
/**
* Sets the IP address of the machine to which this datagram
* is being sent.
- * @param iaddr the <code>InetAddress</code>
+ * @param iaddr the {@code InetAddress}
* @since JDK1.1
* @see #getAddress()
*/
@@ -307,7 +307,7 @@
* Sets the SocketAddress (usually IP address + port number) of the remote
* host to which this datagram is being sent.
*
- * @param address the <code>SocketAddress</code>
+ * @param address the {@code SocketAddress}
* @throws IllegalArgumentException if address is null or is a
* SocketAddress subclass not supported by this socket
*
@@ -328,7 +328,7 @@
* Gets the SocketAddress (usually IP address + port number) of the remote
* host that this packet is being sent to or is coming from.
*
- * @return the <code>SocketAddress</code>
+ * @return the {@code SocketAddress}
* @since 1.4
* @see #setSocketAddress
*/
@@ -339,7 +339,7 @@
/**
* Set the data buffer for this packet. With the offset of
* this DatagramPacket set to 0, and the length set to
- * the length of <code>buf</code>.
+ * the length of {@code buf}.
*
* @param buf the buffer to set for this packet.
*
diff --git a/ojluni/src/main/java/java/net/DatagramSocket.java b/ojluni/src/main/java/java/net/DatagramSocket.java
index 966f30f..03ecf94 100755
--- a/ojluni/src/main/java/java/net/DatagramSocket.java
+++ b/ojluni/src/main/java/java/net/DatagramSocket.java
@@ -53,14 +53,14 @@
* a DatagramSocket is bound to a more specific address.
* <p>
* Example:
- * <code>
+ * {@code
* DatagramSocket s = new DatagramSocket(null);
* s.bind(new InetSocketAddress(8888));
- * </code>
+ * }
* Which is equivalent to:
- * <code>
+ * {@code
* DatagramSocket s = new DatagramSocket(8888);
- * </code>
+ * }
* Both cases will create a DatagramSocket able to receive broadcasts on
* UDP port 8888.
*
@@ -115,7 +115,7 @@
* Connects this socket to a remote socket address (IP address + port number).
* Binds socket if not already bound.
* <p>
- * @param addr The remote address.
+ * @param address The remote address.
* @param port The remote port
* @throws SocketException if binding the socket fails.
*/
@@ -183,14 +183,14 @@
* an IP address chosen by the kernel.
*
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
+ * its {@code checkListen} method is first called
* with 0 as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
@@ -219,21 +219,21 @@
* Creates a datagram socket, bound to the specified local
* socket address.
* <p>
- * If, if the address is <code>null</code>, creates an unbound socket.
- * <p>
+ * If, if the address is {@code null}, creates an unbound socket.
+ *
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
+ * its {@code checkListen} method is first called
* with the port from the socket address
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
- * @param bindaddr local socket address to bind, or <code>null</code>
+ * @param bindaddr local socket address to bind, or {@code null}
* for an unbound socket.
*
* @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since 1.4
@@ -253,8 +253,8 @@
* an IP address chosen by the kernel.
*
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
- * with the <code>port</code> argument
+ * its {@code checkListen} method is first called
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
@@ -262,7 +262,7 @@
* @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
*/
@@ -278,8 +278,8 @@
* an IP address chosen by the kernel.
*
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
- * with the <code>port</code> argument
+ * its {@code checkListen} method is first called
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
@@ -289,7 +289,7 @@
* @exception SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
* @since JDK1.1
@@ -307,7 +307,7 @@
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
public Void run() throws NoSuchMethodException {
- Class[] cl = new Class[1];
+ Class<?>[] cl = new Class<?>[1];
cl[0] = DatagramPacket.class;
impl.getClass().getDeclaredMethod("peekData", cl);
return null;
@@ -318,7 +318,7 @@
}
}
- static Class implClass = null;
+ static Class<?> implClass = null;
void createImpl() throws SocketException {
if (impl == null) {
@@ -338,10 +338,10 @@
}
/**
- * Get the <code>DatagramSocketImpl</code> attached to this socket,
+ * Get the {@code DatagramSocketImpl} attached to this socket,
* creating it if necessary.
*
- * @return the <code>DatagramSocketImpl</code> attached to that
+ * @return the {@code DatagramSocketImpl} attached to that
* DatagramSocket
* @throws SocketException if creation fails.
* @since 1.4
@@ -353,16 +353,16 @@
}
/**
- * Binds this DatagramSocket to a specific address & port.
+ * Binds this DatagramSocket to a specific address and port.
* <p>
- * If the address is <code>null</code>, then the system will pick up
+ * If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
*<p>
- * @param addr The address & port to bind to.
+ * @param addr The address and port to bind to.
* @throws SocketException if any error happens during the bind, or if the
* socket is already bound.
* @throws SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
* @throws IllegalArgumentException if addr is a SocketAddress subclass
* not supported by this socket.
* @since 1.4
@@ -519,7 +519,7 @@
* Returns the binding state of the socket.
* <p>
* If the socket was bound prior to being {@link #close closed},
- * then this method will continue to return <code>true</code>
+ * then this method will continue to return {@code true}
* after the socket is closed.
*
* @return true if the socket successfully bound to an address
@@ -533,7 +533,7 @@
* Returns the connection state of the socket.
* <p>
* If the socket was connected prior to being {@link #close closed},
- * then this method will continue to return <code>true</code>
+ * then this method will continue to return {@code true}
* after the socket is closed.
*
* @return true if the socket successfully connected to a server
@@ -545,7 +545,7 @@
/**
* Returns the address to which this socket is connected. Returns
- * <code>null</code> if the socket is not connected.
+ * {@code null} if the socket is not connected.
* <p>
* If the socket was connected prior to being {@link #close closed},
* then this method will continue to return the connected address
@@ -559,7 +559,7 @@
/**
* Returns the port number to which this socket is connected.
- * Returns <code>-1</code> if the socket is not connected.
+ * Returns {@code -1} if the socket is not connected.
* <p>
* If the socket was connected prior to being {@link #close closed},
* then this method will continue to return the connected port number
@@ -573,14 +573,14 @@
/**
* Returns the address of the endpoint this socket is connected to, or
- * <code>null</code> if it is unconnected.
+ * {@code null} if it is unconnected.
* <p>
* If the socket was connected prior to being {@link #close closed},
* then this method will continue to return the connected address
* after the socket is closed.
*
- * @return a <code>SocketAddress</code> representing the remote
- * endpoint of this socket, or <code>null</code> if it is
+ * @return a {@code SocketAddress} representing the remote
+ * endpoint of this socket, or {@code null} if it is
* not connected yet.
* @see #getInetAddress()
* @see #getPort()
@@ -596,8 +596,8 @@
/**
* Returns the address of the endpoint this socket is bound to.
*
- * @return a <code>SocketAddress</code> representing the local endpoint of this
- * socket, or <code>null</code> if it is closed or not bound yet.
+ * @return a {@code SocketAddress} representing the local endpoint of this
+ * socket, or {@code null} if it is closed or not bound yet.
* @see #getLocalAddress()
* @see #getLocalPort()
* @see #bind(SocketAddress)
@@ -614,28 +614,28 @@
/**
* Sends a datagram packet from this socket. The
- * <code>DatagramPacket</code> includes information indicating the
+ * {@code DatagramPacket} includes information indicating the
* data to be sent, its length, the IP address of the remote host,
* and the port number on the remote host.
*
* <p>If there is a security manager, and the socket is not currently
* connected to a remote address, this method first performs some
- * security checks. First, if <code>p.getAddress().isMulticastAddress()</code>
+ * security checks. First, if {@code p.getAddress().isMulticastAddress()}
* is true, this method calls the
- * security manager's <code>checkMulticast</code> method
- * with <code>p.getAddress()</code> as its argument.
+ * security manager's {@code checkMulticast} method
+ * with {@code p.getAddress()} as its argument.
* If the evaluation of that expression is false,
* this method instead calls the security manager's
- * <code>checkConnect</code> method with arguments
- * <code>p.getAddress().getHostAddress()</code> and
- * <code>p.getPort()</code>. Each call to a security manager method
+ * {@code checkConnect} method with arguments
+ * {@code p.getAddress().getHostAddress()} and
+ * {@code p.getPort()}. Each call to a security manager method
* could result in a SecurityException if the operation is not allowed.
*
- * @param p the <code>DatagramPacket</code> to be sent.
+ * @param p the {@code DatagramPacket} to be sent.
*
* @exception IOException if an I/O error occurs.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> or <code>checkConnect</code>
+ * {@code checkMulticast} or {@code checkConnect}
* method doesn't allow the send.
* @exception PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no
@@ -663,7 +663,7 @@
SecurityManager security = System.getSecurityManager();
// The reason you want to synchronize on datagram packet
- // is because you dont want an applet to change the address
+ // is because you don't want an applet to change the address
// while you are trying to send the packet for example
// after the security check but before the send.
if (security != null) {
@@ -697,20 +697,20 @@
/**
* Receives a datagram packet from this socket. When this method
- * returns, the <code>DatagramPacket</code>'s buffer is filled with
+ * returns, the {@code DatagramPacket}'s buffer is filled with
* the data received. The datagram packet also contains the sender's
* IP address, and the port number on the sender's machine.
* <p>
* This method blocks until a datagram is received. The
- * <code>length</code> field of the datagram packet object contains
+ * {@code length} field of the datagram packet object contains
* the length of the received message. If the message is longer than
* the packet's length, the message is truncated.
* <p>
* If there is a security manager, a packet cannot be received if the
- * security manager's <code>checkAccept</code> method
+ * security manager's {@code checkAccept} method
* does not allow it.
*
- * @param p the <code>DatagramPacket</code> into which to place
+ * @param p the {@code DatagramPacket} into which to place
* the incoming data.
* @exception IOException if an I/O error occurs.
* @exception SocketTimeoutException if setSoTimeout was previously called
@@ -816,17 +816,17 @@
* Gets the local address to which the socket is bound.
*
* <p>If there is a security manager, its
- * <code>checkConnect</code> method is first called
- * with the host address and <code>-1</code>
+ * {@code checkConnect} method is first called
+ * with the host address and {@code -1}
* as its arguments to see if the operation is allowed.
*
* @see SecurityManager#checkConnect
* @return the local address to which the socket is bound,
- * <code>null</code> if the socket is closed, or
- * an <code>InetAddress</code> representing
+ * {@code null} if the socket is closed, or
+ * an {@code InetAddress} representing
* {@link InetAddress#isAnyLocalAddress wildcard}
* address if either the socket is not bound, or
- * the security manager <code>checkConnect</code>
+ * the security manager {@code checkConnect}
* method does not allow the operation
* @since 1.1
*/
@@ -854,8 +854,8 @@
* is bound.
*
* @return the port number on the local host to which this socket is bound,
- <code>-1</code> if the socket is closed, or
- <code>0</code> if it is not bound yet.
+ {@code -1} if the socket is closed, or
+ {@code 0} if it is not bound yet.
*/
public int getLocalPort() {
if (isClosed())
@@ -874,7 +874,7 @@
* a <B>java.net.SocketTimeoutException</B> is raised, though the
* DatagramSocket is still valid. The option <B>must</B> be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
*
* @param timeout the specified timeout in milliseconds.
@@ -913,7 +913,7 @@
/**
* Sets the SO_SNDBUF option to the specified value for this
- * <tt>DatagramSocket</tt>. The SO_SNDBUF option is used by the
+ * {@code DatagramSocket}. The SO_SNDBUF option is used by the
* network implementation as a hint to size the underlying
* network I/O buffers. The SO_SNDBUF setting may also be used
* by the network implementation to determine the maximum size
@@ -927,7 +927,7 @@
* is high.
* <p>
* Note: If {@link #send(DatagramPacket)} is used to send a
- * <code>DatagramPacket</code> that is larger than the setting
+ * {@code DatagramPacket} that is larger than the setting
* of SO_SNDBUF then it is implementation specific if the
* packet is sent or discarded.
*
@@ -951,10 +951,10 @@
}
/**
- * Get value of the SO_SNDBUF option for this <tt>DatagramSocket</tt>, that is the
- * buffer size used by the platform for output on this <tt>DatagramSocket</tt>.
+ * Get value of the SO_SNDBUF option for this {@code DatagramSocket}, that is the
+ * buffer size used by the platform for output on this {@code DatagramSocket}.
*
- * @return the value of the SO_SNDBUF option for this <tt>DatagramSocket</tt>
+ * @return the value of the SO_SNDBUF option for this {@code DatagramSocket}
* @exception SocketException if there is an error in
* the underlying protocol, such as an UDP error.
* @see #setSendBufferSize
@@ -972,7 +972,7 @@
/**
* Sets the SO_RCVBUF option to the specified value for this
- * <tt>DatagramSocket</tt>. The SO_RCVBUF option is used by the
+ * {@code DatagramSocket}. The SO_RCVBUF option is used by the
* the network implementation as a hint to size the underlying
* network I/O buffers. The SO_RCVBUF setting may also be used
* by the network implementation to determine the maximum size
@@ -1009,10 +1009,10 @@
}
/**
- * Get value of the SO_RCVBUF option for this <tt>DatagramSocket</tt>, that is the
- * buffer size used by the platform for input on this <tt>DatagramSocket</tt>.
+ * Get value of the SO_RCVBUF option for this {@code DatagramSocket}, that is the
+ * buffer size used by the platform for input on this {@code DatagramSocket}.
*
- * @return the value of the SO_RCVBUF option for this <tt>DatagramSocket</tt>
+ * @return the value of the SO_RCVBUF option for this {@code DatagramSocket}
* @exception SocketException if there is an error in the underlying protocol, such as an UDP error.
* @see #setReceiveBufferSize(int)
*/
@@ -1035,26 +1035,26 @@
* socket to the same socket address. This is typically for the
* purpose of receiving multicast packets
* (See {@link java.net.MulticastSocket}). The
- * <tt>SO_REUSEADDR</tt> socket option allows multiple
+ * {@code SO_REUSEADDR} socket option allows multiple
* sockets to be bound to the same socket address if the
- * <tt>SO_REUSEADDR</tt> socket option is enabled prior
+ * {@code SO_REUSEADDR} socket option is enabled prior
* to binding the socket using {@link #bind(SocketAddress)}.
* <p>
* Note: This functionality is not supported by all existing platforms,
* so it is implementation specific whether this option will be ignored
* or not. However, if it is not supported then
- * {@link #getReuseAddress()} will always return <code>false</code>.
+ * {@link #getReuseAddress()} will always return {@code false}.
* <p>
- * When a <tt>DatagramSocket</tt> is created the initial setting
- * of <tt>SO_REUSEADDR</tt> is disabled.
+ * When a {@code DatagramSocket} is created the initial setting
+ * of {@code SO_REUSEADDR} is disabled.
* <p>
- * The behaviour when <tt>SO_REUSEADDR</tt> is enabled or
+ * The behaviour when {@code SO_REUSEADDR} is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the
* @exception SocketException if an error occurs enabling or
- * disabling the <tt>SO_RESUEADDR</tt> socket option,
+ * disabling the {@code SO_RESUEADDR} socket option,
* or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
@@ -1075,7 +1075,7 @@
/**
* Tests if SO_REUSEADDR is enabled.
*
- * @return a <code>boolean</code> indicating whether or not SO_REUSEADDR is enabled.
+ * @return a {@code boolean} indicating whether or not SO_REUSEADDR is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
@@ -1113,7 +1113,7 @@
/**
* Tests if SO_BROADCAST is enabled.
- * @return a <code>boolean</code> indicating whether or not SO_BROADCAST is enabled.
+ * @return a {@code boolean} indicating whether or not SO_BROADCAST is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
@@ -1131,15 +1131,15 @@
* As the underlying network implementation may ignore this
* value applications should consider it a hint.
*
- * <P> The tc <B>must</B> be in the range <code> 0 <= tc <=
- * 255</code> or an IllegalArgumentException will be thrown.
+ * <P> The tc <B>must</B> be in the range {@code 0 <= tc <=
+ * 255} or an IllegalArgumentException will be thrown.
* <p>Notes:
* <p>For Internet Protocol v4 the value consists of an
- * <code>integer</code>, the least significant 8 bits of which
+ * {@code integer}, the least significant 8 bits of which
* represent the value of the TOS octet in IP packets sent by
* the socket.
* RFC 1349 defines the TOS values as follows:
- * <p>
+ *
* <UL>
* <LI><CODE>IPTOS_LOWCOST (0x02)</CODE></LI>
* <LI><CODE>IPTOS_RELIABILITY (0x04)</CODE></LI>
@@ -1153,10 +1153,10 @@
* SocketException indicating that the operation is not
* permitted.
* <p>
- * for Internet Protocol v6 <code>tc</code> is the value that
+ * for Internet Protocol v6 {@code tc} is the value that
* would be placed into the sin6_flowinfo field of the IP header.
*
- * @param tc an <code>int</code> value for the bitset.
+ * @param tc an {@code int} value for the bitset.
* @throws SocketException if there is an error setting the
* traffic class or type-of-service
* @since 1.4
@@ -1235,7 +1235,7 @@
* DatagramChannel.open} method.
*
* @return the datagram channel associated with this datagram socket,
- * or <tt>null</tt> if this socket was not created for a channel
+ * or {@code null} if this socket was not created for a channel
*
* @since 1.4
* @spec JSR-51
@@ -1254,14 +1254,14 @@
* application. The factory can be specified only once.
* <p>
* When an application creates a new datagram socket, the socket
- * implementation factory's <code>createDatagramSocketImpl</code> method is
+ * implementation factory's {@code createDatagramSocketImpl} method is
* called to create the actual datagram socket implementation.
* <p>
- * Passing <code>null</code> to the method is a no-op unless the factory
+ * Passing {@code null} to the method is a no-op unless the factory
* was already set.
*
* <p>If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
@@ -1270,7 +1270,7 @@
* datagram socket factory.
* @exception SocketException if the factory is already defined.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow the
+ * {@code checkSetFactory} method doesn't allow the
operation.
* @see
java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
diff --git a/ojluni/src/main/java/java/net/DatagramSocketImpl.java b/ojluni/src/main/java/java/net/DatagramSocketImpl.java
index 3ed11e4..0f0bf81 100755
--- a/ojluni/src/main/java/java/net/DatagramSocketImpl.java
+++ b/ojluni/src/main/java/java/net/DatagramSocketImpl.java
@@ -101,7 +101,7 @@
protected void disconnect() {}
/**
- * Peek at the packet to see who it is from. Updates the specified <code>InetAddress</code>
+ * Peek at the packet to see who it is from. Updates the specified {@code InetAddress}
* to the address which the packet came from.
* @param i an InetAddress object
* @return the port number which the packet came from.
@@ -114,7 +114,7 @@
/**
* Peek at the packet to see who it is from. The data is copied into the specified
- * <code>DatagramPacket</code>. The data is returned,
+ * {@code DatagramPacket}. The data is returned,
* but not consumed, so that a subsequent peekData/receive operation
* will see the same data.
* @param p the Packet Received.
@@ -163,7 +163,7 @@
/**
* Set the TTL (time-to-live) option.
- * @param ttl an <tt>int</tt> specifying the time-to-live value
+ * @param ttl an {@code int} specifying the time-to-live value
* @exception IOException if an I/O exception occurs
* while setting the time-to-live option.
* @see #getTimeToLive()
@@ -174,7 +174,7 @@
* Retrieve the TTL (time-to-live) option.
* @exception IOException if an I/O exception occurs
* while retrieving the time-to-live option
- * @return an <tt>int</tt> representing the time-to-live value
+ * @return an {@code int} representing the time-to-live value
* @see #setTimeToLive(int)
*/
protected abstract int getTimeToLive() throws IOException;
@@ -227,7 +227,7 @@
/**
* Gets the local port.
- * @return an <tt>int</tt> representing the local port value
+ * @return an {@code int} representing the local port value
*/
protected int getLocalPort() {
return localPort;
@@ -235,7 +235,7 @@
/**
* Gets the datagram socket file descriptor.
- * @return a <tt>FileDescriptor</tt> object representing the datagram socket
+ * @return a {@code FileDescriptor} object representing the datagram socket
* file descriptor
*/
protected FileDescriptor getFileDescriptor() {
diff --git a/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java b/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java
index e89aeb3..4d89196 100755
--- a/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java
+++ b/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -27,7 +27,7 @@
/**
* This interface defines a factory for datagram socket implementations. It
- * is used by the classes <code>DatagramSocket</code> to create actual socket
+ * is used by the classes {@code DatagramSocket} to create actual socket
* implementations.
*
* @author Yingxian Wang
@@ -37,9 +37,9 @@
public
interface DatagramSocketImplFactory {
/**
- * Creates a new <code>DatagramSocketImpl</code> instance.
+ * Creates a new {@code DatagramSocketImpl} instance.
*
- * @return a new instance of <code>DatagramSocketImpl</code>.
+ * @return a new instance of {@code DatagramSocketImpl}.
* @see java.net.DatagramSocketImpl
*/
DatagramSocketImpl createDatagramSocketImpl();
diff --git a/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java b/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java
index 6c6bdbf..18465ba 100755
--- a/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java
+++ b/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java
@@ -53,10 +53,10 @@
}
/**
- * Creates a new <code>DatagramSocketImpl</code> instance.
+ * Creates a new {@code DatagramSocketImpl} instance.
*
* @param isMulticast true if this impl if for a MutlicastSocket
- * @return a new instance of a <code>DatagramSocketImpl</code>.
+ * @return a new instance of a {@code DatagramSocketImpl}.
*/
static DatagramSocketImpl createDatagramSocketImpl(boolean isMulticast /*unused on unix*/)
throws SocketException {
diff --git a/ojluni/src/main/java/java/net/FileNameMap.java b/ojluni/src/main/java/java/net/FileNameMap.java
index b9bdb6e..393b5aa 100755
--- a/ojluni/src/main/java/java/net/FileNameMap.java
+++ b/ojluni/src/main/java/java/net/FileNameMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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 @@
/**
* Gets the MIME type for the specified file name.
* @param fileName the specified file name
- * @return a <code>String</code> indicating the MIME
+ * @return a {@code String} indicating the MIME
* type for the specified file name.
*/
public String getContentTypeFor(String fileName);
diff --git a/ojluni/src/main/java/java/net/HttpCookie.java b/ojluni/src/main/java/java/net/HttpCookie.java
index 8d7a0b3..3c80f29 100755
--- a/ojluni/src/main/java/java/net/HttpCookie.java
+++ b/ojluni/src/main/java/java/net/HttpCookie.java
@@ -45,11 +45,11 @@
// ----- END android -----
/**
- * An HttpCookie object represents an http cookie, which carries state
+ * An HttpCookie object represents an HTTP cookie, which carries state
* information between server and user agent. Cookie is widely adopted
* to create stateful sessions.
*
- * <p>There are 3 http cookie specifications:
+ * <p> There are 3 HTTP cookie specifications:
* <blockquote>
* Netscape draft<br>
* RFC 2109 - <a href="http://www.ietf.org/rfc/rfc2109.txt">
@@ -58,7 +58,7 @@
* <i>http://www.ietf.org/rfc/rfc2965.txt</i></a>
* </blockquote>
*
- * <p>HttpCookie class can accept all these 3 forms of syntax.
+ * <p> HttpCookie class can accept all these 3 forms of syntax.
*
* @author Edward Wang
* @since 1.6
@@ -141,46 +141,44 @@
"EEE MMM dd yy HH:mm:ss 'GMT'Z"
};
- //
// constant strings represent set-cookie header token
- //
private final static String SET_COOKIE = "set-cookie:";
private final static String SET_COOKIE2 = "set-cookie2:";
-
- /* ---------------- Ctors -------------- */
+ // ---------------- Ctors --------------
/**
* Constructs a cookie with a specified name and value.
*
- * <p>The name must conform to RFC 2965. That means it can contain
+ * <p> The name must conform to RFC 2965. That means it can contain
* only ASCII alphanumeric characters and cannot contain commas,
* semicolons, or white space or begin with a $ character. The cookie's
* name cannot be changed after creation.
*
- * <p>The value can be anything the server chooses to send. Its
+ * <p> The value can be anything the server chooses to send. Its
* value is probably of interest only to the server. The cookie's
* value can be changed after creation with the
- * <code>setValue</code> method.
+ * {@code setValue} method.
*
- * <p>By default, cookies are created according to the RFC 2965
+ * <p> By default, cookies are created according to the RFC 2965
* cookie specification. The version can be changed with the
- * <code>setVersion</code> method.
+ * {@code setVersion} method.
*
*
- * @param name a <code>String</code> specifying the name of the cookie
+ * @param name
+ * a {@code String} specifying the name of the cookie
*
- * @param value a <code>String</code> specifying the value of the cookie
+ * @param value
+ * a {@code String} specifying the value of the cookie
*
- * @throws IllegalArgumentException if the cookie name contains illegal characters
- * or it is one of the tokens reserved for use
- * by the cookie protocol
- * @throws NullPointerException if <tt>name</tt> is <tt>null</tt>
+ * @throws IllegalArgumentException
+ * if the cookie name contains illegal characters
+ * @throws NullPointerException
+ * if {@code name} is {@code null}
+ *
* @see #setValue
* @see #setVersion
- *
*/
-
public HttpCookie(String name, String value) {
this(name, value, null /*header*/);
}
@@ -201,23 +199,24 @@
this.header = header;
}
-
/**
* Constructs cookies from set-cookie or set-cookie2 header string.
* RFC 2965 section 3.2.2 set-cookie2 syntax indicates that one header line
* may contain more than one cookie definitions, so this is a static
* utility method instead of another constructor.
*
- * @param header a <tt>String</tt> specifying the set-cookie header.
- * The header should start with "set-cookie", or "set-cookie2"
- * token; or it should have no leading token at all.
- * @return a List of cookie parsed from header line string
- * @throws IllegalArgumentException if header string violates the cookie
- * specification's syntax, or the cookie
- * name contains llegal characters, or
- * the cookie name is one of the tokens
- * reserved for use by the cookie protocol
- * @throws NullPointerException if the header string is <tt>null</tt>
+ * @param header
+ * a {@code String} specifying the set-cookie header. The header
+ * should start with "set-cookie", or "set-cookie2" token; or it
+ * should have no leading token at all.
+ *
+ * @return a List of cookie parsed from header line string
+ *
+ * @throws IllegalArgumentException
+ * if header string violates the cookie specification's syntax or
+ * the cookie name contains illegal characters.
+ * @throws NullPointerException
+ * if the header string is {@code null}
*/
public static List<HttpCookie> parse(String header) {
return parse(header, false);
@@ -265,17 +264,13 @@
return cookies;
}
-
-
-
- /* ---------------- Public operations -------------- */
-
+ // ---------------- Public operations --------------
/**
- * Reports whether this http cookie has expired or not.
+ * Reports whether this HTTP cookie has expired or not.
*
- * @return <tt>true</tt> to indicate this http cookie has expired;
- * otherwise, <tt>false</tt>
+ * @return {@code true} to indicate this HTTP cookie has expired;
+ * otherwise, {@code false}
*/
public boolean hasExpired() {
if (maxAge == 0) return true;
@@ -293,155 +288,124 @@
}
/**
- *
* Specifies a comment that describes a cookie's purpose.
* The comment is useful if the browser presents the cookie
- * to the user. Comments
- * are not supported by Netscape Version 0 cookies.
+ * to the user. Comments are not supported by Netscape Version 0 cookies.
*
- * @param purpose a <code>String</code> specifying the comment
- * to display to the user
+ * @param purpose
+ * a {@code String} specifying the comment to display to the user
*
- * @see #getComment
- *
+ * @see #getComment
*/
-
public void setComment(String purpose) {
comment = purpose;
}
-
-
-
/**
* Returns the comment describing the purpose of this cookie, or
- * <code>null</code> if the cookie has no comment.
+ * {@code null} if the cookie has no comment.
*
- * @return a <code>String</code> containing the comment,
- * or <code>null</code> if none
+ * @return a {@code String} containing the comment, or {@code null} if none
*
- * @see #setComment
- *
+ * @see #setComment
*/
-
public String getComment() {
return comment;
}
-
/**
+ * Specifies a comment URL that describes a cookie's purpose.
+ * The comment URL is useful if the browser presents the cookie
+ * to the user. Comment URL is RFC 2965 only.
*
- * Specifies a comment url that describes a cookie's purpose.
- * The comment url is useful if the browser presents the cookie
- * to the user. Comment url is RFC 2965 only.
+ * @param purpose
+ * a {@code String} specifying the comment URL to display to the user
*
- * @param purpose a <code>String</code> specifying the comment url
- * to display to the user
*
- * @see #getCommentURL
- *
+ * @see #getCommentURL
*/
-
public void setCommentURL(String purpose) {
commentURL = purpose;
}
-
-
-
/**
- * Returns the comment url describing the purpose of this cookie, or
- * <code>null</code> if the cookie has no comment url.
+ * Returns the comment URL describing the purpose of this cookie, or
+ * {@code null} if the cookie has no comment url.
*
- * @return a <code>String</code> containing the comment url,
- * or <code>null</code> if none
+ * @return a {@code String} containing the comment URL, or {@code null}
+ * if none
*
- * @see #setCommentURL
- *
+ * @see #setCommentURL
*/
-
public String getCommentURL() {
return commentURL;
}
-
/**
* Specify whether user agent should discard the cookie unconditionally.
* This is RFC 2965 only attribute.
*
- * @param discard <tt>true</tt> indicates to discard cookie unconditionally
+ * @param discard
+ * {@code true} indicates to discard cookie unconditionally
*
- * @see #getDiscard
+ * @see #getDiscard
*/
-
public void setDiscard(boolean discard) {
toDiscard = discard;
}
-
-
-
/**
- * Return the discard attribute of the cookie
+ * Returns the discard attribute of the cookie
*
- * @return a <tt>boolean</tt> to represent this cookie's discard attribute
+ * @return a {@code boolean} to represent this cookie's discard attribute
*
- * @see #setDiscard
+ * @see #setDiscard
*/
-
public boolean getDiscard() {
return toDiscard;
}
-
/**
* Specify the portlist of the cookie, which restricts the port(s)
* to which a cookie may be sent back in a Cookie header.
*
- * @param ports a <tt>String</tt> specify the port list, which is
- * comma seperated series of digits
- * @see #getPortlist
+ * @param ports
+ * a {@code String} specify the port list, which is comma separated
+ * series of digits
+ *
+ * @see #getPortlist
*/
-
public void setPortlist(String ports) {
portlist = ports;
}
-
-
-
/**
- * Return the port list attribute of the cookie
+ * Returns the port list attribute of the cookie
*
- * @return a <tt>String</tt> contains the port list
- * or <tt>null</tt> if none
- * @see #setPortlist
+ * @return a {@code String} contains the port list or {@code null} if none
+ *
+ * @see #setPortlist
*/
-
public String getPortlist() {
return portlist;
}
/**
- *
* Specifies the domain within which this cookie should be presented.
*
- * <p>The form of the domain name is specified by RFC 2965. A domain
- * name begins with a dot (<code>.foo.com</code>) and means that
+ * <p> The form of the domain name is specified by RFC 2965. A domain
+ * name begins with a dot ({@code .foo.com}) and means that
* the cookie is visible to servers in a specified Domain Name System
- * (DNS) zone (for example, <code>www.foo.com</code>, but not
- * <code>a.b.foo.com</code>). By default, cookies are only returned
+ * (DNS) zone (for example, {@code www.foo.com}, but not
+ * {@code a.b.foo.com}). By default, cookies are only returned
* to the server that sent them.
*
+ * @param pattern
+ * a {@code String} containing the domain name within which this
+ * cookie is visible; form is according to RFC 2965
*
- * @param pattern a <code>String</code> containing the domain name
- * within which this cookie is visible;
- * form is according to RFC 2965
- *
- * @see #getDomain
- *
+ * @see #getDomain
*/
-
public void setDomain(String pattern) {
if (pattern != null)
domain = pattern.toLowerCase();
@@ -449,261 +413,187 @@
domain = pattern;
}
-
-
-
-
/**
- * Returns the domain name set for this cookie. The form of
- * the domain name is set by RFC 2965.
+ * Returns the domain name set for this cookie. The form of the domain name
+ * is set by RFC 2965.
*
- * @return a <code>String</code> containing the domain name
+ * @return a {@code String} containing the domain name
*
- * @see #setDomain
- *
+ * @see #setDomain
*/
-
public String getDomain() {
return domain;
}
-
/**
* Sets the maximum age of the cookie in seconds.
*
- * <p>A positive value indicates that the cookie will expire
+ * <p> A positive value indicates that the cookie will expire
* after that many seconds have passed. Note that the value is
* the <i>maximum</i> age when the cookie will expire, not the cookie's
* current age.
*
- * <p>A negative value means
- * that the cookie is not stored persistently and will be deleted
- * when the Web browser exits. A zero value causes the cookie
- * to be deleted.
+ * <p> A negative value means that the cookie is not stored persistently
+ * and will be deleted when the Web browser exits. A zero value causes the
+ * cookie to be deleted.
*
- * @param expiry an integer specifying the maximum age of the
- * cookie in seconds; if zero, the cookie
- * should be discarded immediately;
- * otherwise, the cookie's max age is unspecified.
+ * @param expiry
+ * an integer specifying the maximum age of the cookie in seconds;
+ * if zero, the cookie should be discarded immediately; otherwise,
+ * the cookie's max age is unspecified.
*
- * @see #getMaxAge
- *
+ * @see #getMaxAge
*/
public void setMaxAge(long expiry) {
maxAge = expiry;
}
-
-
-
/**
- * Returns the maximum age of the cookie, specified in seconds.
- * By default, <code>-1</code> indicating the cookie will persist
- * until browser shutdown.
+ * Returns the maximum age of the cookie, specified in seconds. By default,
+ * {@code -1} indicating the cookie will persist until browser shutdown.
*
+ * @return an integer specifying the maximum age of the cookie in seconds
*
- * @return an integer specifying the maximum age of the
- * cookie in seconds
- *
- *
- * @see #setMaxAge
- *
+ * @see #setMaxAge
*/
-
public long getMaxAge() {
return maxAge;
}
-
-
-
/**
- * Specifies a path for the cookie
- * to which the client should return the cookie.
+ * Specifies a path for the cookie to which the client should return
+ * the cookie.
*
- * <p>The cookie is visible to all the pages in the directory
+ * <p> The cookie is visible to all the pages in the directory
* you specify, and all the pages in that directory's subdirectories.
* A cookie's path must include the servlet that set the cookie,
* for example, <i>/catalog</i>, which makes the cookie
* visible to all directories on the server under <i>/catalog</i>.
*
- * <p>Consult RFC 2965 (available on the Internet) for more
+ * <p> Consult RFC 2965 (available on the Internet) for more
* information on setting path names for cookies.
*
+ * @param uri
+ * a {@code String} specifying a path
*
- * @param uri a <code>String</code> specifying a path
- *
- *
- * @see #getPath
- *
+ * @see #getPath
*/
-
public void setPath(String uri) {
path = uri;
}
-
-
-
/**
- * Returns the path on the server
- * to which the browser returns this cookie. The
- * cookie is visible to all subpaths on the server.
+ * Returns the path on the server to which the browser returns this cookie.
+ * The cookie is visible to all subpaths on the server.
*
+ * @return a {@code String} specifying a path that contains a servlet name,
+ * for example, <i>/catalog</i>
*
- * @return a <code>String</code> specifying a path that contains
- * a servlet name, for example, <i>/catalog</i>
- *
- * @see #setPath
- *
+ * @see #setPath
*/
-
public String getPath() {
return path;
}
-
-
-
-
/**
* Indicates whether the cookie should only be sent using a secure protocol,
* such as HTTPS or SSL.
*
- * <p>The default value is <code>false</code>.
+ * <p> The default value is {@code false}.
*
- * @param flag If <code>true</code>, the cookie can only be sent over
- * a secure protocol like https.
- * If <code>false</code>, it can be sent over any protocol.
+ * @param flag
+ * If {@code true}, the cookie can only be sent over a secure
+ * protocol like HTTPS. If {@code false}, it can be sent over
+ * any protocol.
*
- * @see #getSecure
- *
+ * @see #getSecure
*/
-
public void setSecure(boolean flag) {
secure = flag;
}
-
-
-
/**
- * Returns <code>true</code> if sending this cookie should be
- * restricted to a secure protocol, or <code>false</code> if the
- * it can be sent using any protocol.
+ * 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
+ * protocol.
*
- * @return <code>false</code> if the cookie can be sent over
- * any standard protocol; otherwise, <code>true</code>
+ * @return {@code false} if the cookie can be sent over any standard
+ * protocol; otherwise, {@code true}
*
- * @see #setSecure
- *
+ * @see #setSecure
*/
-
public boolean getSecure() {
return secure;
}
-
-
-
-
/**
* Returns the name of the cookie. The name cannot be changed after
* creation.
*
- * @return a <code>String</code> specifying the cookie's name
- *
+ * @return a {@code String} specifying the cookie's name
*/
-
public String getName() {
return name;
}
-
-
-
-
/**
- *
* Assigns a new value to a cookie after the cookie is created.
* If you use a binary value, you may want to use BASE64 encoding.
*
- * <p>With Version 0 cookies, values should not contain white
- * space, brackets, parentheses, equals signs, commas,
- * double quotes, slashes, question marks, at signs, colons,
- * and semicolons. Empty values may not behave the same way
- * on all browsers.
+ * <p> With Version 0 cookies, values should not contain white space,
+ * brackets, parentheses, equals signs, commas, double quotes, slashes,
+ * question marks, at signs, colons, and semicolons. Empty values may not
+ * behave the same way on all browsers.
*
- * @param newValue a <code>String</code> specifying the new value
+ * @param newValue
+ * a {@code String} specifying the new value
*
- *
- * @see #getValue
- *
+ * @see #getValue
*/
-
public void setValue(String newValue) {
value = newValue;
}
-
-
-
/**
* Returns the value of the cookie.
*
- * @return a <code>String</code> containing the cookie's
- * present value
+ * @return a {@code String} containing the cookie's present value
*
- * @see #setValue
- *
+ * @see #setValue
*/
-
public String getValue() {
return value;
}
-
-
-
/**
- * Returns the version of the protocol this cookie complies
- * with. Version 1 complies with RFC 2965/2109,
- * and version 0 complies with the original
- * cookie specification drafted by Netscape. Cookies provided
- * by a browser use and identify the browser's cookie version.
+ * Returns the version of the protocol this cookie complies with. Version 1
+ * complies with RFC 2965/2109, and version 0 complies with the original
+ * cookie specification drafted by Netscape. Cookies provided by a browser
+ * use and identify the browser's cookie version.
*
+ * @return 0 if the cookie complies with the original Netscape
+ * specification; 1 if the cookie complies with RFC 2965/2109
*
- * @return 0 if the cookie complies with the
- * original Netscape specification; 1
- * if the cookie complies with RFC 2965/2109
- *
- * @see #setVersion
- *
+ * @see #setVersion
*/
-
public int getVersion() {
return version;
}
-
-
-
/**
* Sets the version of the cookie protocol this cookie complies
* with. Version 0 complies with the original Netscape cookie
* specification. Version 1 complies with RFC 2965/2109.
*
+ * @param v
+ * 0 if the cookie should comply with the original Netscape
+ * specification; 1 if the cookie should comply with RFC 2965/2109
*
- * @param v 0 if the cookie should comply with
- * the original Netscape specification;
- * 1 if the cookie should comply with RFC 2965/2109
+ * @throws IllegalArgumentException
+ * if {@code v} is neither 0 nor 1
*
- * @throws IllegalArgumentException if <tt>v</tt> is neither 0 nor 1
- *
- * @see #getVersion
- *
+ * @see #getVersion
*/
-
public void setVersion(int v) {
if (v != 0 && v != 1) {
throw new IllegalArgumentException("cookie version should be 0 or 1");
@@ -717,11 +607,11 @@
* attribute. This means that the cookie should not be accessible to
* scripting engines, like javascript.
*
- * @return {@code true} if this cookie should be considered http only.
- * @see #setHttpOnly(boolean)
+ * @return {@code true} if this cookie should be considered HTTPOnly
+ *
+ * @see #setHttpOnly(boolean)
*/
- public boolean isHttpOnly()
- {
+ public boolean isHttpOnly() {
return httpOnly;
}
@@ -730,24 +620,25 @@
* {@code true} it means the cookie should not be accessible to scripting
* engines like javascript.
*
- * @param httpOnly if {@code true} make the cookie HTTP only, i.e.
- * only visible as part of an HTTP request.
- * @see #isHttpOnly()
+ * @param httpOnly
+ * if {@code true} make the cookie HTTP only, i.e. only visible as
+ * part of an HTTP request.
+ *
+ * @see #isHttpOnly()
*/
- public void setHttpOnly(boolean httpOnly)
- {
+ public void setHttpOnly(boolean httpOnly) {
this.httpOnly = httpOnly;
}
/**
- * The utility method to check whether a host name is in a domain
- * or not.
+ * The utility method to check whether a host name is in a domain or not.
*
- * <p>This concept is described in the cookie specification.
+ * <p> This concept is described in the cookie specification.
* To understand the concept, some terminologies need to be defined first:
* <blockquote>
* effective host name = hostname if host name contains dot<br>
- * or = hostname.local if not
+ *
+ * or = hostname.local if not
* </blockquote>
* <p>Host A's name domain-matches host B's if:
* <blockquote><ul>
@@ -776,17 +667,18 @@
* would be accepted.</li>
* <li>A Set-Cookie2 with Domain=.com or Domain=.com., will always be
* rejected, because there is no embedded dot.</li>
- * <li>A Set-Cookie2 with Domain=ajax.com will be accepted, and the
- * value for Domain will be taken to be .ajax.com, because a dot
- * gets prepended to the value.</li>
* <li>A Set-Cookie2 from request-host example for Domain=.local will
* be accepted, because the effective host name for the request-
* host is example.local, and example.local domain-matches .local.</li>
* </ul></blockquote>
*
- * @param domain the domain name to check host name with
- * @param host the host name in question
- * @return <tt>true</tt> if they domain-matches; <tt>false</tt> if not
+ * @param domain
+ * the domain name to check host name with
+ *
+ * @param host
+ * the host name in question
+ *
+ * @return {@code true} if they domain-matches; {@code false} if not
*/
public static boolean domainMatches(String domain, String host) {
if (domain == null || host == null)
@@ -855,17 +747,15 @@
}
}
-
/**
- * Test the equality of two http cookies.
+ * Test the equality of two HTTP cookies.
*
- * <p> The result is <tt>true</tt> only if two cookies
- * come from same domain (case-insensitive),
- * have same name (case-insensitive),
- * and have same path (case-sensitive).
+ * <p> The result is {@code true} only if two cookies come from same domain
+ * (case-insensitive), have same name (case-insensitive), and have same path
+ * (case-sensitive).
*
- * @return <tt>true</tt> if 2 http cookies equal to each other;
- * otherwise, <tt>false</tt>
+ * @return {@code true} if two HTTP cookies equal to each other;
+ * otherwise, {@code false}
*/
@Override
public boolean equals(Object obj) {
@@ -884,19 +774,17 @@
Objects.equals(getPath(), other.getPath());
}
-
/**
- * Return hash code of this http cookie. The result is the sum of
- * hash code value of three significant components of this cookie:
- * name, domain, and path.
- * That is, the hash code is the value of the expression:
+ * Returns the hash code of this HTTP cookie. The result is the sum of
+ * hash code value of three significant components of this cookie: name,
+ * domain, and path. That is, the hash code is the value of the expression:
* <blockquote>
* getName().toLowerCase().hashCode()<br>
* + getDomain().toLowerCase().hashCode()<br>
* + getPath().hashCode()
* </blockquote>
*
- * @return this http cookie's hash code
+ * @return this HTTP cookie's hash code
*/
@Override
public int hashCode() {
@@ -910,7 +798,7 @@
/**
* Create and return a copy of this object.
*
- * @return a clone of this http cookie
+ * @return a clone of this HTTP cookie
*/
@Override
public Object clone() {
@@ -921,8 +809,7 @@
}
}
-
- /* ---------------- Private operations -------------- */
+ // ---------------- Private operations --------------
// Note -- disabled for now to allow full Netscape compatibility
// from RFC 2068, token special case characters
@@ -934,15 +821,14 @@
// ----- END android -----
/*
- * Tests a string and returns true if the string counts as a
- * token.
+ * Tests a string and returns true if the string counts as a token.
*
- * @param value the <code>String</code> to be tested
+ * @param value
+ * the {@code String} to be tested
*
- * @return <code>true</code> if the <code>String</code> is
- * a token; <code>false</code> if it is not
+ * @return {@code true} if the {@code String} is a token;
+ * {@code false} if it is not
*/
-
private static boolean isToken(String value) {
// ----- BEGIN android -----
if (RESERVED_NAMES.contains(value.toLowerCase(Locale.US))) {
@@ -961,16 +847,16 @@
return true;
}
-
/*
* Parse header string to cookie object.
*
- * @param header header string; should contain only one NAME=VALUE pair
+ * @param header
+ * header string; should contain only one NAME=VALUE pair
*
- * @return an HttpCookie being extracted
+ * @return an HttpCookie being extracted
*
- * @throws IllegalArgumentException if header string violates the cookie
- * specification
+ * @throws IllegalArgumentException
+ * if header string violates the cookie specification
*/
private static HttpCookie parseInternal(String header,
boolean retainHeader)
@@ -1023,7 +909,6 @@
return cookie;
}
-
/*
* assign cookie attribute value to attribute name;
* use a map to simulate method dispatch
@@ -1158,11 +1043,11 @@
static final TimeZone GMT = TimeZone.getTimeZone("GMT");
/*
- * @param dateString a date string in one of the formats
- * defined in Netscape cookie spec
+ * @param dateString
+ * a date string in one of the formats defined in Netscape cookie spec
*
- * @return delta seconds between this cookie's creation
- * time and the time specified by dateString
+ * @return delta seconds between this cookie's creation time and the time
+ * specified by dateString
*/
private long expiryDate2DeltaSeconds(String dateString) {
Calendar cal = new GregorianCalendar(GMT);
@@ -1195,7 +1080,6 @@
return 0;
}
-
/*
* try to guess the cookie version through set-cookie header string
*/
@@ -1257,10 +1141,10 @@
* 2) but not the comma surrounding by double-quotes, which is the comma
* inside port list or embeded URIs.
*
- * @param header the cookie header string to split
+ * @param header
+ * the cookie header string to split
*
- * @return list of strings; never null
- *
+ * @return list of strings; never null
*/
private static List<String> splitMultiCookies(String header) {
List<String> cookies = new java.util.ArrayList<String>();
@@ -1270,7 +1154,8 @@
for (p = 0, q = 0; p < header.length(); p++) {
char c = header.charAt(p);
if (c == '"') quoteCount++;
- if (c == ',' && (quoteCount % 2 == 0)) { // it is comma and not surrounding by double-quotes
+ if (c == ',' && (quoteCount % 2 == 0)) {
+ // it is comma and not surrounding by double-quotes
cookies.add(header.substring(q, p));
q = p + 1;
}
diff --git a/ojluni/src/main/java/java/net/HttpRetryException.java b/ojluni/src/main/java/java/net/HttpRetryException.java
index 8829c1e..d498a65 100755
--- a/ojluni/src/main/java/java/net/HttpRetryException.java
+++ b/ojluni/src/main/java/java/net/HttpRetryException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, 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
@@ -43,7 +43,7 @@
private String location;
/**
- * Constructs a new <code>HttpRetryException</code> from the
+ * Constructs a new {@code HttpRetryException} from the
* specified response code and exception detail message
*
* @param detail the detail message.
@@ -55,7 +55,7 @@
}
/**
- * Constructs a new <code>HttpRetryException</code> with detail message
+ * Constructs a new {@code HttpRetryException} with detail message
* responseCode and the contents of the Location response header field.
*
* @param detail the detail message.
diff --git a/ojluni/src/main/java/java/net/HttpURLConnection.java b/ojluni/src/main/java/java/net/HttpURLConnection.java
index 9217aff..7ceab85 100755
--- a/ojluni/src/main/java/java/net/HttpURLConnection.java
+++ b/ojluni/src/main/java/java/net/HttpURLConnection.java
@@ -283,14 +283,14 @@
/**
* The chunk-length when using chunked encoding streaming mode for output.
- * A value of <code>-1</code> means chunked encoding is disabled for output.
+ * A value of {@code -1} means chunked encoding is disabled for output.
* @since 1.5
*/
protected int chunkLength = -1;
/**
* The fixed content-length when using fixed-length streaming mode.
- * A value of <code>-1</code> means fixed-length streaming mode is disabled
+ * A value of {@code -1} means fixed-length streaming mode is disabled
* for output.
*
* <P> <B>NOTE:</B> {@link #fixedContentLengthLong} is recommended instead
@@ -310,15 +310,15 @@
protected long fixedContentLengthLong = -1;
/**
- * Returns the key for the <code>n</code><sup>th</sup> header field.
- * Some implementations may treat the <code>0</code><sup>th</sup>
+ * Returns the key for the {@code n}<sup>th</sup> header field.
+ * Some implementations may treat the {@code 0}<sup>th</sup>
* header field as special, i.e. as the status line returned by the HTTP
* server. In this case, {@link #getHeaderField(int) getHeaderField(0)} returns the status
- * line, but <code>getHeaderFieldKey(0)</code> returns null.
+ * line, but {@code getHeaderFieldKey(0)} returns null.
*
* @param n an index, where n >=0.
- * @return the key for the <code>n</code><sup>th</sup> header field,
- * or <code>null</code> if the key does not exist.
+ * @return the key for the {@code n}<sup>th</sup> header field,
+ * or {@code null} if the key does not exist.
*/
public String getHeaderFieldKey (int n) {
return null;
@@ -458,8 +458,8 @@
}
/**
- * Returns the value for the <code>n</code><sup>th</sup> header field.
- * Some implementations may treat the <code>0</code><sup>th</sup>
+ * Returns the value for the {@code n}<sup>th</sup> header field.
+ * Some implementations may treat the {@code 0}<sup>th</sup>
* header field as special, i.e. as the status line returned by the HTTP
* server.
* <p>
@@ -468,8 +468,8 @@
* the headers in the message.
*
* @param n an index, where n>=0.
- * @return the value of the <code>n</code><sup>th</sup> header field,
- * or <code>null</code> if the value does not exist.
+ * @return the value of the {@code n}<sup>th</sup> header field,
+ * or {@code null} if the value does not exist.
* @see java.net.HttpURLConnection#getHeaderFieldKey(int)
*/
public String getHeaderField(int n) {
@@ -477,7 +477,7 @@
}
/**
- * An <code>int</code> representing the three digit HTTP Status-Code.
+ * An {@code int} representing the three digit HTTP Status-Code.
* <ul>
* <li> 1xx: Informational
* <li> 2xx: Success
@@ -499,12 +499,12 @@
private static boolean followRedirects = true;
/**
- * If <code>true</code>, the protocol will automatically follow redirects.
- * If <code>false</code>, the protocol will not automatically follow
+ * If {@code true}, the protocol will automatically follow redirects.
+ * If {@code false}, the protocol will not automatically follow
* redirects.
* <p>
- * This field is set by the <code>setInstanceFollowRedirects</code>
- * method. Its value is returned by the <code>getInstanceFollowRedirects</code>
+ * This field is set by the {@code setInstanceFollowRedirects}
+ * method. Its value is returned by the {@code getInstanceFollowRedirects}
* method.
* <p>
* Its default value is based on the value of the static followRedirects
@@ -535,14 +535,14 @@
* cannot change this variable.
* <p>
* If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
- * @param set a <code>boolean</code> indicating whether or not
+ * @param set a {@code boolean} indicating whether or not
* to follow HTTP redirects.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't
+ * {@code checkSetFactory} method doesn't
* allow the operation.
* @see SecurityManager#checkSetFactory
* @see #getFollowRedirects()
@@ -557,12 +557,12 @@
}
/**
- * Returns a <code>boolean</code> indicating
+ * Returns a {@code boolean} indicating
* whether or not HTTP redirects (3xx) should
* be automatically followed.
*
- * @return <code>true</code> if HTTP redirects should
- * be automatically followed, <tt>false</tt> if not.
+ * @return {@code true} if HTTP redirects should
+ * be automatically followed, {@code false} if not.
* @see #setFollowRedirects(boolean)
*/
public static boolean getFollowRedirects() {
@@ -571,13 +571,13 @@
/**
* Sets whether HTTP redirects (requests with response code 3xx) should
- * be automatically followed by this <code>HttpURLConnection</code>
+ * be automatically followed by this {@code HttpURLConnection}
* instance.
* <p>
* The default value comes from followRedirects, which defaults to
* true.
*
- * @param followRedirects a <code>boolean</code> indicating
+ * @param followRedirects a {@code boolean} indicating
* whether or not to follow HTTP redirects.
*
* @see java.net.HttpURLConnection#instanceFollowRedirects
@@ -589,11 +589,11 @@
}
/**
- * Returns the value of this <code>HttpURLConnection</code>'s
- * <code>instanceFollowRedirects</code> field.
+ * Returns the value of this {@code HttpURLConnection}'s
+ * {@code instanceFollowRedirects} field.
*
- * @return the value of this <code>HttpURLConnection</code>'s
- * <code>instanceFollowRedirects</code> field.
+ * @return the value of this {@code HttpURLConnection}'s
+ * {@code instanceFollowRedirects} field.
* @see java.net.HttpURLConnection#instanceFollowRedirects
* @see #setInstanceFollowRedirects(boolean)
* @since 1.3
@@ -747,13 +747,14 @@
* Returns null if none could be discerned from the responses
* (the result was not valid HTTP).
* @throws IOException if an error occurred connecting to the server.
- * @return the HTTP response message, or <code>null</code>
+ * @return the HTTP response message, or {@code null}
*/
public String getResponseMessage() throws IOException {
getResponseCode();
return responseMessage;
}
+ @SuppressWarnings("deprecation")
public long getHeaderFieldDate(String name, long Default) {
String dateString = getHeaderField(name);
try {
@@ -789,7 +790,7 @@
* @exception IOException if an error occurs while computing
* the permission.
*
- * @return a <code>SocketPermission</code> object representing the
+ * @return a {@code SocketPermission} object representing the
* permission necessary to connect to the destination
* host and port.
*/
diff --git a/ojluni/src/main/java/java/net/IDN.java b/ojluni/src/main/java/java/net/IDN.java
index b24a34d..b2c21d2 100755
--- a/ojluni/src/main/java/java/net/IDN.java
+++ b/ojluni/src/main/java/java/net/IDN.java
@@ -101,7 +101,7 @@
* @param input the string to be processed
* @param flag process flag; can be 0 or any logical OR of possible flags
*
- * @return the translated <tt>String</tt>
+ * @return the translated {@code String}
*
* @throws IllegalArgumentException if the input string doesn't conform to RFC 3490 specification
*/
@@ -120,13 +120,13 @@
*
* <p> This convenience method works as if by invoking the
* two-argument counterpart as follows:
- * <blockquote><tt>
+ * <blockquote>
* {@link #toASCII(String, int) toASCII}(input, 0);
- * </tt></blockquote>
+ * </blockquote>
*
* @param input the string to be processed
*
- * @return the translated <tt>String</tt>
+ * @return the translated {@code String}
*
* @throws IllegalArgumentException if the input string doesn't conform to RFC 3490 specification
*/
@@ -151,7 +151,7 @@
* @param input the string to be processed
* @param flag process flag; can be 0 or any logical OR of possible flags
*
- * @return the translated <tt>String</tt>
+ * @return the translated {@code String}
*/
public static String toUnicode(String input, int flag) {
try {
@@ -185,13 +185,13 @@
*
* <p> This convenience method works as if by invoking the
* two-argument counterpart as follows:
- * <blockquote><tt>
+ * <blockquote>
* {@link #toUnicode(String, int) toUnicode}(input, 0);
- * </tt></blockquote>
+ * </blockquote>
*
* @param input the string to be processed
*
- * @return the translated <tt>String</tt>
+ * @return the translated {@code String}
*/
public static String toUnicode(String input) {
return toUnicode(input, 0);
diff --git a/ojluni/src/main/java/java/net/Inet4Address.java b/ojluni/src/main/java/java/net/Inet4Address.java
index 1570fad..177f387 100755
--- a/ojluni/src/main/java/java/net/Inet4Address.java
+++ b/ojluni/src/main/java/java/net/Inet4Address.java
@@ -40,16 +40,16 @@
* and <a href="http://www.ietf.org/rfc/rfc2365.txt"><i>RFC 2365:
* Administratively Scoped IP Multicast</i></a>
*
- * <h4> <A NAME="format">Textual representation of IP addresses</a> </h4>
+ * <h3> <A NAME="format">Textual representation of IP addresses</a> </h3>
*
* Textual representation of IPv4 address used as input to methods
* takes one of the following forms:
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>d.d.d.d</tt></td></tr>
- * <tr><td><tt>d.d.d</tt></td></tr>
- * <tr><td><tt>d.d</tt></td></tr>
- * <tr><td><tt>d</tt></td></tr>
+ * <tr><td>{@code d.d.d.d}</td></tr>
+ * <tr><td>{@code d.d.d}</td></tr>
+ * <tr><td>{@code d.d}</td></tr>
+ * <tr><td>{@code d}</td></tr>
* </table></blockquote>
*
* <p> When four parts are specified, each is interpreted as a byte of
@@ -161,7 +161,7 @@
* Utility routine to check if the InetAddress is an
* IP multicast address. IP multicast address is a Class D
* address i.e first four bits of the address are 1110.
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* an IP multicast address
* @since JDK1.1
*/
@@ -171,7 +171,7 @@
/**
* Utility routine to check if the InetAddress in a wildcard address.
- * @return a <code>boolean</code> indicating if the Inetaddress is
+ * @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
* @since 1.4
*/
@@ -182,7 +182,7 @@
/**
* Utility routine to check if the InetAddress is a loopback address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a loopback address; or false otherwise.
* @since 1.4
*/
@@ -196,7 +196,7 @@
/**
* Utility routine to check if the InetAddress is an link local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a link local address; or false if address is not a link local unicast address.
* @since 1.4
*/
@@ -213,7 +213,7 @@
/**
* Utility routine to check if the InetAddress is a site local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a site local address; or false if address is not a site local unicast address.
* @since 1.4
*/
@@ -233,7 +233,7 @@
/**
* Utility routine to check if the multicast address has global scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of global scope, false if it is not
* of global scope or it is not a multicast address
* @since 1.4
@@ -249,7 +249,7 @@
/**
* Utility routine to check if the multicast address has node scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of node-local scope, false if it is not
* of node-local scope or it is not a multicast address
* @since 1.4
@@ -262,7 +262,7 @@
/**
* Utility routine to check if the multicast address has link scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of link-local scope, false if it is not
* of link-local scope or it is not a multicast address
* @since 1.4
@@ -278,7 +278,7 @@
/**
* Utility routine to check if the multicast address has site scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of site-local scope, false if it is not
* of site-local scope or it is not a multicast address
* @since 1.4
@@ -293,7 +293,7 @@
/**
* Utility routine to check if the multicast address has organization scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of organization-local scope,
* false if it is not of organization-local scope
* or it is not a multicast address
@@ -308,9 +308,9 @@
}
/**
- * Returns the raw IP address of this <code>InetAddress</code>
+ * Returns the raw IP address of this {@code InetAddress}
* object. The result is in network byte order: the highest order
- * byte of the address is in <code>getAddress()[0]</code>.
+ * byte of the address is in {@code getAddress()[0]}.
*
* @return the raw IP address of this object.
*/
@@ -346,18 +346,18 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same IP address as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same IP address as
* this object.
* <p>
- * Two instances of <code>InetAddress</code> represent the same IP
+ * Two instances of {@code InetAddress} represent the same IP
* address if the length of the byte arrays returned by
- * <code>getAddress</code> is the same for both, and each of the
+ * {@code getAddress} is the same for both, and each of the
* array components is the same for the byte arrays.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetAddress#getAddress()
*/
public boolean equals(Object obj) {
diff --git a/ojluni/src/main/java/java/net/Inet6Address.java b/ojluni/src/main/java/java/net/Inet6Address.java
index d55fab9..1fa8e04 100755
--- a/ojluni/src/main/java/java/net/Inet6Address.java
+++ b/ojluni/src/main/java/java/net/Inet6Address.java
@@ -38,7 +38,7 @@
* Defined by <a href="http://www.ietf.org/rfc/rfc2373.txt">
* <i>RFC 2373: IP Version 6 Addressing Architecture</i></a>.
*
- * <h4> <A NAME="format">Textual representation of IP addresses</a> </h4>
+ * <h3> <A NAME="format">Textual representation of IP addresses</a> </h3>
*
* Textual representation of IPv6 address used as input to methods
* takes one of the following forms:
@@ -50,7 +50,7 @@
* address. This is the full form. For example,
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>1080:0:0:0:8:800:200C:417A</tt><td></tr>
+ * <tr><td>{@code 1080:0:0:0:8:800:200C:417A}<td></tr>
* </table></blockquote>
*
* <p> Note that it is not necessary to write the leading zeros in
@@ -67,7 +67,7 @@
* zeros in an address. For example,
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>1080::8:800:200C:417A</tt><td></tr>
+ * <tr><td>{@code 1080::8:800:200C:417A}<td></tr>
* </table></blockquote>
*
* <li><p> An alternative form that is sometimes more convenient
@@ -78,8 +78,8 @@
* standard IPv4 representation address, for example,
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>::FFFF:129.144.52.38</tt><td></tr>
- * <tr><td><tt>::129.144.52.38</tt><td></tr>
+ * <tr><td>{@code ::FFFF:129.144.52.38}<td></tr>
+ * <tr><td>{@code ::129.144.52.38}<td></tr>
* </table></blockquote>
*
* <p> where "::FFFF:d.d.d.d" and "::d.d.d.d" are, respectively, the
@@ -88,23 +88,23 @@
* in the "d.d.d.d" form. The following forms are invalid:
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>::FFFF:d.d.d</tt><td></tr>
- * <tr><td><tt>::FFFF:d.d</tt><td></tr>
- * <tr><td><tt>::d.d.d</tt><td></tr>
- * <tr><td><tt>::d.d</tt><td></tr>
+ * <tr><td>{@code ::FFFF:d.d.d}<td></tr>
+ * <tr><td>{@code ::FFFF:d.d}<td></tr>
+ * <tr><td>{@code ::d.d.d}<td></tr>
+ * <tr><td>{@code ::d.d}<td></tr>
* </table></blockquote>
*
* <p> The following form:
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>::FFFF:d</tt><td></tr>
+ * <tr><td>{@code ::FFFF:d}<td></tr>
* </table></blockquote>
*
* <p> is valid, however it is an unconventional representation of
* the IPv4-compatible IPv6 address,
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>::255.255.0.d</tt><td></tr>
+ * <tr><td>{@code ::255.255.0.d}<td></tr>
* </table></blockquote>
*
* <p> while "::d" corresponds to the general IPv6 address
@@ -119,7 +119,8 @@
* <h4> Special IPv6 address </h4>
*
* <blockquote>
- * <table cellspacing=2 summary="Description of IPv4-mapped address"> <tr><th valign=top><i>IPv4-mapped address</i></th>
+ * <table cellspacing=2 summary="Description of IPv4-mapped address">
+ * <tr><th valign=top><i>IPv4-mapped address</i></th>
* <td>Of the form::ffff:w.x.y.z, this IPv6 address is used to
* represent an IPv4 address. It allows the native program to
* use the same address data structure and also the same
@@ -132,36 +133,41 @@
* representation. However, it will be converted into an IPv4
* address.</td></tr>
* </table></blockquote>
- * <p>
- * <h4> <A NAME="scoped">Textual representation of IPv6 scoped addresses</a> </h4>
- * <p>
- * The textual representation of IPv6 addresses as described above can be extended
- * to specify IPv6 scoped addresses. This extension to the basic addressing architecture
- * is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
- * <p>
- * Because link-local and site-local addresses are non-global, it is possible that different hosts
- * may have the same destination address and may be reachable through different interfaces on the
- * same originating system. In this case, the originating system is said to be connected
- * to multiple zones of the same scope. In order to disambiguate which is the intended destination
- * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an IPv6 address.
- * <p>
- * The general format for specifying the <i>scope_id</i> is the following:
- * <p><blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
+ *
+ * <h4><A NAME="scoped">Textual representation of IPv6 scoped addresses</a></h4>
+ *
+ * <p> The textual representation of IPv6 addresses as described above can be
+ * extended to specify IPv6 scoped addresses. This extension to the basic
+ * addressing architecture is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
+ *
+ * <p> Because link-local and site-local addresses are non-global, it is possible
+ * that different hosts may have the same destination address and may be
+ * reachable through different interfaces on the same originating system. In
+ * this case, the originating system is said to be connected to multiple zones
+ * of the same scope. In order to disambiguate which is the intended destination
+ * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an
+ * IPv6 address.
+ *
+ * <p> The general format for specifying the <i>scope_id</i> is the following:
+ *
+ * <blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
* <p> The IPv6-address is a literal IPv6 address as described above.
- * The <i>scope_id</i> refers to an interface on the local system, and it can be specified
- * in two ways.
- * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer that identifies the
- * particular interface and scope as understood by the system. Usually, the numeric
- * values can be determined through administration tools on the system. Each interface may
- * have multiple values, one for each scope. If the scope is unspecified, then the default value
- * used is zero.</li><p>
+ * The <i>scope_id</i> refers to an interface on the local system, and it can be
+ * specified in two ways.
+ * <ol><li><i>As a numeric identifier.</i> This must be a positive integer
+ * that identifies the particular interface and scope as understood by the
+ * system. Usually, the numeric values can be determined through administration
+ * tools on the system. Each interface may have multiple values, one for each
+ * scope. If the scope is unspecified, then the default value used is zero.</li>
* <li><i>As a string.</i> This must be the exact string that is returned by
- * {@link java.net.NetworkInterface#getName()} for the particular interface in question.
- * When an Inet6Address is created in this way, the numeric scope-id is determined at the time
- * the object is created by querying the relevant NetworkInterface.</li>
- * </ol><p>
- * Note also, that the numeric <i>scope_id</i> can be retrieved from Inet6Address instances returned from the
- * NetworkInterface class. This can be used to find out the current scope ids configured on the system.
+ * {@link java.net.NetworkInterface#getName()} for the particular interface in
+ * question. When an Inet6Address is created in this way, the numeric scope-id
+ * is determined at the time the object is created by querying the relevant
+ * NetworkInterface.</li></ol>
+ *
+ * <p> Note also, that the numeric <i>scope_id</i> can be retrieved from
+ * Inet6Address instances returned from the NetworkInterface class. This can be
+ * used to find out the current scope ids configured on the system.
* @since 1.4
*/
@@ -248,10 +254,11 @@
}
/**
- * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
- * except that the IPv6 scope_id is set to the value corresponding to the given interface
- * for the address type specified in <code>addr</code>.
- * The call will fail with an UnknownHostException if the given interface does not have a numeric
+ * Create an Inet6Address in the exact manner of {@link
+ * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+ * 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).
* See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
@@ -260,14 +267,16 @@
* @param addr the raw IP address in network byte order
* @param nif an interface this address must be associated with.
* @return an Inet6Address object created from the raw IP address.
- * @exception UnknownHostException if IP address is of illegal length, or if the interface
- * does not have a numeric scope_id assigned for the given address type.
+ * @throws UnknownHostException
+ * if IP address is of illegal length, or if the interface does not
+ * have a numeric scope_id assigned for the given address type.
*
* @since 1.5
*/
-
- public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
- throws UnknownHostException {
+ public static Inet6Address getByAddress(String host, byte[] addr,
+ NetworkInterface nif)
+ throws UnknownHostException
+ {
if (host != null && host.length() > 0 && host.charAt(0) == '[') {
if (host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
@@ -282,9 +291,10 @@
}
/**
- * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
- * except that the IPv6 scope_id is set to the given numeric value.
- * The scope_id is not checked to determine if it corresponds to any interface on the system.
+ * Create an Inet6Address in the exact manner of {@link
+ * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+ * set to the given numeric value. The scope_id is not checked to determine
+ * if it corresponds to any interface on the system.
* See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
*
@@ -292,13 +302,14 @@
* @param addr the raw IP address in network byte order
* @param scope_id the numeric scope_id for the address.
* @return an Inet6Address object created from the raw IP address.
- * @exception UnknownHostException if IP address is of illegal length.
+ * @throws UnknownHostException if IP address is of illegal length.
*
* @since 1.5
*/
-
- public static Inet6Address getByAddress(String host, byte[] addr, int scope_id)
- throws UnknownHostException {
+ public static Inet6Address getByAddress(String host, byte[] addr,
+ int scope_id)
+ throws UnknownHostException
+ {
if (host != null && host.length() > 0 && host.charAt(0) == '[') {
if (host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
@@ -312,7 +323,9 @@
throw new UnknownHostException("addr is of illegal length");
}
- private void initstr (String hostName, byte addr[], String ifname) throws UnknownHostException {
+ private void initstr(String hostName, byte addr[], String ifname)
+ throws UnknownHostException
+ {
try {
NetworkInterface nif = NetworkInterface.getByName (ifname);
if (nif == null) {
@@ -460,8 +473,9 @@
* address. 11111111 at the start of the address identifies the
* address as being a multicast address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * an IP multicast address
+ * @return a {@code boolean} indicating if the InetAddress is an IP
+ * multicast address
+ *
* @since JDK1.1
*/
@Override
@@ -471,8 +485,10 @@
/**
* Utility routine to check if the InetAddress in a wildcard address.
- * @return a <code>boolean</code> indicating if the Inetaddress is
+ *
+ * @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
+ *
* @since 1.4
*/
@Override
@@ -487,8 +503,9 @@
/**
* Utility routine to check if the InetAddress is a loopback address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a loopback address; or false otherwise.
+ * @return a {@code boolean} indicating if the InetAddress is a loopback
+ * address; or false otherwise.
+ *
* @since 1.4
*/
@Override
@@ -503,8 +520,8 @@
/**
* Utility routine to check if the InetAddress is an link local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a link local address; or false if address is not a link local unicast 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.
* @since 1.4
*/
@Override
@@ -516,8 +533,9 @@
/**
* Utility routine to check if the InetAddress is a site local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a site local address; or false if address is not a site local unicast address.
+ * @return a {@code boolean} indicating if the InetAddress is a site local
+ * address; or false if address is not a site local unicast address.
+ *
* @since 1.4
*/
@Override
@@ -529,9 +547,10 @@
/**
* Utility routine to check if the multicast address has global scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of global scope, false if it is not
- * of global scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of global scope, false if it is not of global scope or
+ * it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -543,9 +562,10 @@
/**
* Utility routine to check if the multicast address has node scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of node-local scope, false if it is not
- * of node-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of node-local scope, false if it is not of node-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -557,9 +577,10 @@
/**
* Utility routine to check if the multicast address has link scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of link-local scope, false if it is not
- * of link-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of link-local scope, false if it is not of link-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -571,9 +592,10 @@
/**
* Utility routine to check if the multicast address has site scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of site-local scope, false if it is not
- * of site-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of site-local scope, false if it is not of site-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -585,7 +607,7 @@
/**
* Utility routine to check if the multicast address has organization scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of organization-local scope,
* false if it is not of organization-local scope
* or it is not a multicast address
@@ -598,9 +620,9 @@
}
/**
- * Returns the raw IP address of this <code>InetAddress</code>
+ * Returns the raw IP address of this {@code InetAddress}
* object. The result is in network byte order: the highest order
- * byte of the address is in <code>getAddress()[0]</code>.
+ * byte of the address is in {@code getAddress()[0]}.
*
* @return the raw IP address of this object.
*/
@@ -686,18 +708,18 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same IP address as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same IP address as
* this object.
* <p>
- * Two instances of <code>InetAddress</code> represent the same IP
+ * Two instances of {@code InetAddress} represent the same IP
* address if the length of the byte arrays returned by
- * <code>getAddress</code> is the same for both, and each of the
+ * {@code getAddress} is the same for both, and each of the
* array components is the same for the byte arrays.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetAddress#getAddress()
*/
@Override
@@ -720,7 +742,7 @@
* Utility routine to check if the InetAddress is an
* IPv4 compatible IPv6 address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* an IPv4 compatible IPv6 address; or false if address is IPv4 address.
* @since 1.4
*/
diff --git a/ojluni/src/main/java/java/net/Inet6AddressImpl.java b/ojluni/src/main/java/java/net/Inet6AddressImpl.java
index 185ffbb..a093fc5 100755
--- a/ojluni/src/main/java/java/net/Inet6AddressImpl.java
+++ b/ojluni/src/main/java/java/net/Inet6AddressImpl.java
@@ -150,10 +150,10 @@
* be either an IPv6 address or an IPv4 address (case of a dual
* stack system).
*/
- java.util.Enumeration it = netif.getInetAddresses();
+ java.util.Enumeration<InetAddress> it = netif.getInetAddresses();
InetAddress inetaddr = null;
while (it.hasMoreElements()) {
- inetaddr = (InetAddress) it.nextElement();
+ inetaddr = it.nextElement();
if (inetaddr.getClass().isInstance(addr)) {
ifaddr = inetaddr.getAddress();
if (inetaddr instanceof Inet6Address) {
diff --git a/ojluni/src/main/java/java/net/InetAddress.java b/ojluni/src/main/java/java/net/InetAddress.java
index 3ea1086..d837e98 100755
--- a/ojluni/src/main/java/java/net/InetAddress.java
+++ b/ojluni/src/main/java/java/net/InetAddress.java
@@ -59,7 +59,7 @@
* with a host name or whether it has already done reverse host name
* resolution).
*
- * <h4> Address types </h4>
+ * <h3> Address types </h3>
*
* <blockquote><table cellspacing=2 summary="Description of unicast and multicast address types">
* <tr><th valign=top><i>unicast</i></th>
@@ -159,7 +159,6 @@
* <p>
* A value of -1 indicates "cache forever".
* </dd>
- * <p>
* <dt><b>networkaddress.cache.negative.ttl</b> (default: 10)</dt>
* <dd>Indicates the caching policy for un-successful name lookups
* from the name service. The value is specified as as integer to
@@ -272,7 +271,7 @@
/**
* Utility routine to check if the InetAddress is an
* IP multicast address.
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* an IP multicast address
* @since JDK1.1
*/
@@ -282,7 +281,7 @@
/**
* Utility routine to check if the InetAddress in a wildcard address.
- * @return a <code>boolean</code> indicating if the Inetaddress is
+ * @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
* @since 1.4
*/
@@ -293,7 +292,7 @@
/**
* Utility routine to check if the InetAddress is a loopback address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a loopback address; or false otherwise.
* @since 1.4
*/
@@ -304,7 +303,7 @@
/**
* Utility routine to check if the InetAddress is an link local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a link local address; or false if address is not a link local unicast address.
* @since 1.4
*/
@@ -315,7 +314,7 @@
/**
* Utility routine to check if the InetAddress is a site local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
+ * @return a {@code boolean} indicating if the InetAddress is
* a site local address; or false if address is not a site local unicast address.
* @since 1.4
*/
@@ -326,7 +325,7 @@
/**
* Utility routine to check if the multicast address has global scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of global scope, false if it is not
* of global scope or it is not a multicast address
* @since 1.4
@@ -338,7 +337,7 @@
/**
* Utility routine to check if the multicast address has node scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of node-local scope, false if it is not
* of node-local scope or it is not a multicast address
* @since 1.4
@@ -350,7 +349,7 @@
/**
* Utility routine to check if the multicast address has link scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of link-local scope, false if it is not
* of link-local scope or it is not a multicast address
* @since 1.4
@@ -362,7 +361,7 @@
/**
* Utility routine to check if the multicast address has site scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of site-local scope, false if it is not
* of site-local scope or it is not a multicast address
* @since 1.4
@@ -374,7 +373,7 @@
/**
* Utility routine to check if the multicast address has organization scope.
*
- * @return a <code>boolean</code> indicating if the address has
+ * @return a {@code boolean} indicating if the address has
* is a multicast address of organization-local scope,
* false if it is not of organization-local scope
* or it is not a multicast address
@@ -400,9 +399,9 @@
* in an IllegalArgumentException being thrown.
*
* @param timeout the time, in milliseconds, before the call aborts
- * @return a <code>boolean</code> indicating if the address is reachable.
+ * @return a {@code boolean} indicating if the address is reachable.
* @throws IOException if a network error occurs
- * @throws IllegalArgumentException if <code>timeout</code> is negative.
+ * @throws IllegalArgumentException if {@code timeout} is negative.
* @since 1.5
*/
public boolean isReachable(int timeout) throws IOException {
@@ -418,10 +417,10 @@
* privilege can be obtained, otherwise it will try to establish
* a TCP connection on port 7 (Echo) of the destination host.
* <p>
- * The <code>network interface</code> and <code>ttl</code> parameters
+ * The {@code network interface} and {@code ttl} parameters
* let the caller specify which network interface the test will go through
* and the maximum number of hops the packets should go through.
- * A negative value for the <code>ttl</code> will result in an
+ * A negative value for the {@code ttl} will result in an
* IllegalArgumentException being thrown.
* <p>
* The timeout value, in milliseconds, indicates the maximum amount of time
@@ -434,9 +433,9 @@
* @param ttl the maximum numbers of hops to try or 0 for the
* default
* @param timeout the time, in milliseconds, before the call aborts
- * @throws IllegalArgumentException if either <code>timeout</code>
- * or <code>ttl</code> are negative.
- * @return a <code>boolean</code>indicating if the address is reachable.
+ * @throws IllegalArgumentException if either {@code timeout}
+ * or {@code ttl} are negative.
+ * @return a {@code boolean}indicating if the address is reachable.
* @throws IOException if a network error occurs
* @since 1.5
*/
@@ -462,8 +461,8 @@
* {@link #getCanonicalHostName() getCanonicalHostName}.
*
* <p>If there is a security manager, its
- * <code>checkConnect</code> method is first called
- * with the hostname and <code>-1</code>
+ * {@code checkConnect} method is first called
+ * with the hostname and {@code -1}
* as its arguments to see if the operation is allowed.
* If the operation is not allowed, it will return
* the textual representation of the IP address.
@@ -488,8 +487,8 @@
* the FQDN depending on the underlying system configuration.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkConnect</code> method
- * with the hostname and <code>-1</code>
+ * calls its {@code checkConnect} method
+ * with the hostname and {@code -1}
* as its arguments to see if the calling code is allowed to know
* the hostname for this IP address, i.e., to connect to the host.
* If the operation is not allowed, it will return
@@ -514,8 +513,8 @@
* Returns the hostname for this address.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkConnect</code> method
- * with the hostname and <code>-1</code>
+ * calls its {@code checkConnect} method
+ * with the hostname and {@code -1}
* as its arguments to see if the calling code is allowed to know
* the hostname for this IP address, i.e., to connect to the host.
* If the operation is not allowed, it will return
@@ -559,9 +558,9 @@
}
/**
- * Returns the raw IP address of this <code>InetAddress</code>
+ * Returns the raw IP address of this {@code InetAddress}
* object. The result is in network byte order: the highest order
- * byte of the address is in <code>getAddress()[0]</code>.
+ * byte of the address is in {@code getAddress()[0]}.
*
* @return the raw IP address of this object.
*/
@@ -590,18 +589,18 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same IP address as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same IP address as
* this object.
* <p>
- * Two instances of <code>InetAddress</code> represent the same IP
+ * Two instances of {@code InetAddress} represent the same IP
* address if the length of the byte arrays returned by
- * <code>getAddress</code> is the same for both, and each of the
+ * {@code getAddress} is the same for both, and each of the
* array components is the same for the byte arrays.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetAddress#getAddress()
*/
public boolean equals(Object obj) {
@@ -609,7 +608,7 @@
}
/**
- * Converts this IP address to a <code>String</code>. The
+ * Converts this IP address to a {@code String}. The
* string returned is of the form: hostname / literal IP
* address.
*
@@ -629,7 +628,7 @@
* No name service is checked for the validity of the address.
*
* <p> The host name can either be a machine name, such as
- * "<code>java.sun.com</code>", or a textual representation of its IP
+ * "{@code java.sun.com}", or a textual representation of its IP
* address.
* <p> No validity checking is done on the host name either.
*
@@ -679,26 +678,26 @@
* Determines the IP address of a host, given the host's name.
*
* <p> The host name can either be a machine name, such as
- * "<code>java.sun.com</code>", or a textual representation of its
+ * "{@code java.sun.com}", or a textual representation of its
* IP address. If a literal IP address is supplied, only the
* validity of the address format is checked.
*
- * <p> For <code>host</code> specified in literal IPv6 address,
+ * <p> For {@code host} specified in literal IPv6 address,
* either the form defined in RFC 2732 or the literal IPv6 address
* format defined in RFC 2373 is accepted. IPv6 scoped addresses are also
* supported. See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
*
- * <p> If the host is <tt>null</tt> then an <tt>InetAddress</tt>
+ * <p> If the host is {@code null} then an {@code InetAddress}
* representing an address of the loopback interface is returned.
* See <a href="http://www.ietf.org/rfc/rfc3330.txt">RFC 3330</a>
* section 2 and <a href="http://www.ietf.org/rfc/rfc2373.txt">RFC 2373</a>
* section 2.5.3. </p>
*
- * @param host the specified host, or <code>null</code>.
+ * @param host the specified host, or {@code null}.
* @return an IP address for the given host name.
* @exception UnknownHostException if no IP address for the
- * <code>host</code> could be found, or if a scope_id was specified
+ * {@code host} could be found, or if a scope_id was specified
* for a global IPv6 address.
* @exception SecurityException if a security manager exists
* and its checkConnect method doesn't allow the operation
@@ -713,37 +712,37 @@
* based on the configured name service on the system.
*
* <p> The host name can either be a machine name, such as
- * "<code>java.sun.com</code>", or a textual representation of its IP
+ * "{@code java.sun.com}", or a textual representation of its IP
* address. If a literal IP address is supplied, only the
* validity of the address format is checked.
*
- * <p> For <code>host</code> specified in <i>literal IPv6 address</i>,
+ * <p> For {@code host} specified in <i>literal IPv6 address</i>,
* either the form defined in RFC 2732 or the literal IPv6 address
* format defined in RFC 2373 is accepted. A literal IPv6 address may
* also be qualified by appending a scoped zone identifier or scope_id.
* The syntax and usage of scope_ids is described
* <a href="Inet6Address.html#scoped">here</a>.
- * <p> If the host is <tt>null</tt> then an <tt>InetAddress</tt>
+ * <p> If the host is {@code null} then an {@code InetAddress}
* representing an address of the loopback interface is returned.
* See <a href="http://www.ietf.org/rfc/rfc3330.txt">RFC 3330</a>
* section 2 and <a href="http://www.ietf.org/rfc/rfc2373.txt">RFC 2373</a>
* section 2.5.3. </p>
*
- * <p> If there is a security manager and <code>host</code> is not
- * null and <code>host.length() </code> is not equal to zero, the
+ * <p> If there is a security manager and {@code host} is not
+ * null and {@code host.length() } is not equal to zero, the
* security manager's
- * <code>checkConnect</code> method is called
- * with the hostname and <code>-1</code>
+ * {@code checkConnect} method is called
+ * with the hostname and {@code -1}
* as its arguments to see if the operation is allowed.
*
- * @param host the name of the host, or <code>null</code>.
+ * @param host the name of the host, or {@code null}.
* @return an array of all the IP addresses for a given host name.
*
* @exception UnknownHostException if no IP address for the
- * <code>host</code> could be found, or if a scope_id was specified
+ * {@code host} could be found, or if a scope_id was specified
* for a global IPv6 address.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the operation.
*
* @see SecurityManager#checkConnect
*/
@@ -768,9 +767,9 @@
}
/**
- * Returns an <code>InetAddress</code> object given the raw IP address .
+ * Returns an {@code InetAddress} object given the raw IP address .
* The argument is in network byte order: the highest order
- * byte of the address is in <code>getAddress()[0]</code>.
+ * byte of the address is in {@code getAddress()[0]}.
*
* <p> This method doesn't block, i.e. no reverse name service lookup
* is performed.
@@ -791,14 +790,14 @@
/**
* Returns the address of the local host. This is achieved by retrieving
* the name of the host from the system, then resolving that name into
- * an <code>InetAddress</code>.
+ * an {@code InetAddress}.
*
* <P>Note: The resolved address may be cached for a short period of time.
* </P>
*
* <p>If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the local host name and <code>-1</code>
+ * {@code checkConnect} method is called
+ * with the local host name and {@code -1}
* as its arguments to see if the operation is allowed.
* If the operation is not allowed, an InetAddress representing
* the loopback address is returned.
diff --git a/ojluni/src/main/java/java/net/InetSocketAddress.java b/ojluni/src/main/java/java/net/InetSocketAddress.java
index 31102bf4..7b32bdc 100755
--- a/ojluni/src/main/java/java/net/InetSocketAddress.java
+++ b/ojluni/src/main/java/java/net/InetSocketAddress.java
@@ -44,7 +44,7 @@
* as returned values.
* <p>
* The <i>wildcard</i> is a special local IP address. It usually means "any"
- * and can only be used for <code>bind</code> operations.
+ * and can only be used for {@code bind} operations.
*
* @see java.net.Socket
* @see java.net.ServerSocket
@@ -164,8 +164,8 @@
* and the port number a specified value.
* <p>
* A valid port value is between 0 and 65535.
- * A port number of <code>zero</code> will let the system pick up an
- * ephemeral port in a <code>bind</code> operation.
+ * A port number of {@code zero} will let the system pick up an
+ * ephemeral port in a {@code bind} operation.
* <p>
* @param port The port number
* @throws IllegalArgumentException if the port parameter is outside the specified
@@ -180,10 +180,10 @@
* Creates a socket address from an IP address and a port number.
* <p>
* A valid port value is between 0 and 65535.
- * A port number of <code>zero</code> will let the system pick up an
- * ephemeral port in a <code>bind</code> operation.
+ * A port number of {@code zero} will let the system pick up an
+ * ephemeral port in a {@code bind} operation.
* <P>
- * A <code>null</code> address will assign the <i>wildcard</i> address.
+ * A {@code null} address will assign the <i>wildcard</i> address.
* <p>
* @param addr The IP address
* @param port The port number
@@ -207,13 +207,13 @@
* An attempt will be made to resolve the hostname into an InetAddress.
* If that attempt fails, the address will be flagged as <I>unresolved</I>.
* <p>
- * If there is a security manager, its <code>checkConnect</code> method
+ * If there is a security manager, its {@code checkConnect} method
* is called with the host name as its argument to check the permissiom
* to resolve it. This could result in a SecurityException.
* <P>
* A valid port value is between 0 and 65535.
- * A port number of <code>zero</code> will let the system pick up an
- * ephemeral port in a <code>bind</code> operation.
+ * A port number of {@code zero} will let the system pick up an
+ * ephemeral port in a {@code bind} operation.
* <P>
* @param hostname the Host name
* @param port The port number
@@ -249,8 +249,8 @@
* The address will be flagged as <I>unresolved</I>.
* <p>
* A valid port value is between 0 and 65535.
- * A port number of <code>zero</code> will let the system pick up an
- * ephemeral port in a <code>bind</code> operation.
+ * A port number of {@code zero} will let the system pick up an
+ * ephemeral port in a {@code bind} operation.
* <P>
* @param host the Host name
* @param port The port number
@@ -258,7 +258,7 @@
* the range of valid port values, or if the hostname
* parameter is <TT>null</TT>.
* @see #isUnresolved()
- * @return a <code>InetSocketAddress</code> representing the unresolved
+ * @return a {@code InetSocketAddress} representing the unresolved
* socket address
* @since 1.5
*/
@@ -338,16 +338,16 @@
/**
*
- * Gets the <code>InetAddress</code>.
+ * Gets the {@code InetAddress}.
*
- * @return the InetAdress or <code>null</code> if it is unresolved.
+ * @return the InetAdress or {@code null} if it is unresolved.
*/
public final InetAddress getAddress() {
return holder.getAddress();
}
/**
- * Gets the <code>hostname</code>.
+ * Gets the {@code hostname}.
* Note: This method may trigger a name service reverse lookup if the
* address was created with a literal IP address.
*
@@ -372,8 +372,8 @@
/**
* Checks whether the address has been resolved or not.
*
- * @return <code>true</code> if the hostname couldn't be resolved into
- * an <code>InetAddress</code>.
+ * @return {@code true} if the hostname couldn't be resolved into
+ * an {@code InetAddress}.
*/
public final boolean isUnresolved() {
return holder.isUnresolved();
@@ -394,11 +394,11 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same address as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same address as
* this object.
* <p>
- * Two instances of <code>InetSocketAddress</code> represent the same
+ * Two instances of {@code InetSocketAddress} represent the same
* address if both the InetAddresses (or hostnames if it is unresolved) and port
* numbers are equal.
* If both addresses are unresolved, then the hostname & the port number
@@ -408,8 +408,8 @@
* considered equal.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetAddress#equals(java.lang.Object)
*/
@Override
diff --git a/ojluni/src/main/java/java/net/InterfaceAddress.java b/ojluni/src/main/java/java/net/InterfaceAddress.java
index 1fb18ae..39354a0 100755
--- a/ojluni/src/main/java/java/net/InterfaceAddress.java
+++ b/ojluni/src/main/java/java/net/InterfaceAddress.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, 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
@@ -47,23 +47,23 @@
}
/**
- * Returns an <code>InetAddress</code> for this address.
+ * Returns an {@code InetAddress} for this address.
*
- * @return the <code>InetAddress</code> for this address.
+ * @return the {@code InetAddress} for this address.
*/
public InetAddress getAddress() {
return address;
}
/**
- * Returns an <code>InetAddress</code> for the brodcast address
+ * Returns an {@code InetAddress} for the broadcast address
* for this InterfaceAddress.
* <p>
* Only IPv4 networks have broadcast address therefore, in the case
- * of an IPv6 network, <code>null</code> will be returned.
+ * of an IPv6 network, {@code null} will be returned.
*
- * @return the <code>InetAddress</code> representing the broadcast
- * address or <code>null</code> if there is no broadcast address.
+ * @return the {@code InetAddress} representing the broadcast
+ * address or {@code null} if there is no broadcast address.
*/
public InetAddress getBroadcast() {
return broadcast;
@@ -76,7 +76,7 @@
* or 24 (255.255.255.0). <p>
* Typical IPv6 values would be 128 (::1/128) or 10 (fe80::203:baff:fe27:1243/10)
*
- * @return a <code>short</code> representing the prefix length for the
+ * @return a {@code short} representing the prefix length for the
* subnet of that address.
*/
public short getNetworkPrefixLength() {
@@ -85,17 +85,17 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same interface address as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same interface address as
* this object.
* <p>
- * Two instances of <code>InterfaceAddress</code> represent the same
+ * Two instances of {@code InterfaceAddress} represent the same
* address if the InetAddress, the prefix length and the broadcast are
* the same for both.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InterfaceAddress#hashCode()
*/
public boolean equals(Object obj) {
@@ -122,7 +122,7 @@
}
/**
- * Converts this Interface address to a <code>String</code>. The
+ * Converts this Interface address to a {@code String}. The
* string returned is of the form: InetAddress / prefix length [ broadcast address ].
*
* @return a string representation of this Interface address.
diff --git a/ojluni/src/main/java/java/net/JarURLConnection.java b/ojluni/src/main/java/java/net/JarURLConnection.java
index 433be8c..70dedec 100755
--- a/ojluni/src/main/java/java/net/JarURLConnection.java
+++ b/ojluni/src/main/java/java/net/JarURLConnection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -45,18 +45,14 @@
*
* <p>for example:
*
- * <p><code>
- * jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class<br>
- * </code>
+ * <p>{@code jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class}
*
* <p>Jar URLs should be used to refer to a JAR file or entries in
* a JAR file. The example above is a JAR URL which refers to a JAR
* entry. If the entry name is omitted, the URL refers to the whole
* JAR file:
*
- * <code>
- * jar:http://www.foo.com/bar/baz.jar!/
- * </code>
+ * {@code jar:http://www.foo.com/bar/baz.jar!/}
*
* <p>Users should cast the generic URLConnection to a
* JarURLConnection when they know that the URL they created is a JAR
@@ -76,19 +72,19 @@
* <dl>
*
* <dt>A Jar entry
- * <dd><code>jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class</code>
+ * <dd>{@code jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class}
*
* <dt>A Jar file
- * <dd><code>jar:http://www.foo.com/bar/baz.jar!/</code>
+ * <dd>{@code jar:http://www.foo.com/bar/baz.jar!/}
*
* <dt>A Jar directory
- * <dd><code>jar:http://www.foo.com/bar/baz.jar!/COM/foo/</code>
+ * <dd>{@code jar:http://www.foo.com/bar/baz.jar!/COM/foo/}
*
* </dl>
*
- * <p><code>!/</code> is refered to as the <em>separator</em>.
+ * <p>{@code !/} is referred to as the <em>separator</em>.
*
- * <p>When constructing a JAR url via <code>new URL(context, spec)</code>,
+ * <p>When constructing a JAR url via {@code new URL(context, spec)},
* the following rules apply:
*
* <ul>
@@ -227,7 +223,7 @@
* for this connection.
*
* @exception IOException if getting the JAR file for this
- * connection causes an IOException to be trown.
+ * connection causes an IOException to be thrown.
*
* @see #getJarFile
*/
@@ -244,7 +240,7 @@
* the JAR URL for this connection points to a JAR file.
*
* @exception IOException if getting the JAR file for this
- * connection causes an IOException to be trown.
+ * connection causes an IOException to be thrown.
*
* @see #getJarFile
* @see #getJarEntry
@@ -294,7 +290,7 @@
* can only be called once
* the connection has been completely verified by reading
* from the input stream until the end of the stream has been
- * reached. Otherwise, this method will return <code>null</code>
+ * reached. Otherwise, this method will return {@code null}
*
* @return the Certificate object for this connection if the URL
* for it points to a JAR file entry, null otherwise.
diff --git a/ojluni/src/main/java/java/net/MalformedURLException.java b/ojluni/src/main/java/java/net/MalformedURLException.java
index f6ed892..7aef75c 100755
--- a/ojluni/src/main/java/java/net/MalformedURLException.java
+++ b/ojluni/src/main/java/java/net/MalformedURLException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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,13 +39,13 @@
private static final long serialVersionUID = -182787522200415866L;
/**
- * Constructs a <code>MalformedURLException</code> with no detail message.
+ * Constructs a {@code MalformedURLException} with no detail message.
*/
public MalformedURLException() {
}
/**
- * Constructs a <code>MalformedURLException</code> with the
+ * Constructs a {@code MalformedURLException} with the
* specified detail message.
*
* @param msg the detail message.
diff --git a/ojluni/src/main/java/java/net/MulticastSocket.java b/ojluni/src/main/java/java/net/MulticastSocket.java
index f39d3e9..c3389e1 100755
--- a/ojluni/src/main/java/java/net/MulticastSocket.java
+++ b/ojluni/src/main/java/java/net/MulticastSocket.java
@@ -93,7 +93,7 @@
* Create a multicast socket.
*
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
+ * its {@code checkListen} method is first called
* with 0 as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
* <p>
@@ -104,7 +104,7 @@
* @exception IOException if an I/O exception occurs
* while creating the MulticastSocket
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
* @see SecurityManager#checkListen
* @see java.net.DatagramSocket#setReuseAddress(boolean)
*/
@@ -116,8 +116,8 @@
* Create a multicast socket and bind it to a specific port.
*
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
- * with the <code>port</code> argument
+ * its {@code checkListen} method is first called
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
* <p>
@@ -129,7 +129,7 @@
* @exception IOException if an I/O exception occurs
* while creating the MulticastSocket
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
* @see SecurityManager#checkListen
* @see java.net.DatagramSocket#setReuseAddress(boolean)
*/
@@ -140,10 +140,10 @@
/**
* Create a MulticastSocket bound to the specified socket address.
* <p>
- * Or, if the address is <code>null</code>, create an unbound socket.
- * <p>
+ * Or, if the address is {@code null}, create an unbound socket.
+ *
* <p>If there is a security manager,
- * its <code>checkListen</code> method is first called
+ * its {@code checkListen} method is first called
* with the SocketAddress port as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
* <p>
@@ -151,12 +151,12 @@
* {@link DatagramSocket#setReuseAddress(boolean)} method is
* called to enable the SO_REUSEADDR socket option.
*
- * @param bindaddr Socket address to bind to, or <code>null</code> for
+ * @param bindaddr Socket address to bind to, or {@code null} for
* an unbound socket.
* @exception IOException if an I/O exception occurs
* while creating the MulticastSocket
* @exception SecurityException if a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
+ * {@code checkListen} method doesn't allow the operation.
* @see SecurityManager#checkListen
* @see java.net.DatagramSocket#setReuseAddress(boolean)
*
@@ -193,11 +193,11 @@
/**
* Set the default time-to-live for multicast packets sent out
- * on this <code>MulticastSocket</code> in order to control the
+ * on this {@code MulticastSocket} in order to control the
* scope of the multicasts.
*
* <p>The ttl is an <b>unsigned</b> 8-bit quantity, and so <B>must</B> be
- * in the range <code> 0 <= ttl <= 0xFF </code>.
+ * in the range {@code 0 <= ttl <= 0xFF }.
*
* @param ttl the time-to-live
* @exception IOException if an I/O exception occurs
@@ -275,11 +275,11 @@
/**
* Joins a multicast group. Its behavior may be affected by
- * <code>setInterface</code> or <code>setNetworkInterface</code>.
+ * {@code setInterface} or {@code setNetworkInterface}.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkMulticast</code> method
- * with the <code>mcastaddr</code> argument
+ * calls its {@code checkMulticast} method
+ * with the {@code mcastaddr} argument
* as its argument.
*
* @param mcastaddr is the multicast address to join
@@ -287,7 +287,7 @@
* @exception IOException if there is an error joining
* or when the address is not a multicast address.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> method doesn't allow the join.
+ * {@code checkMulticast} method doesn't allow the join.
*
* @see SecurityManager#checkMulticast(InetAddress)
*/
@@ -321,18 +321,18 @@
/**
* Leave a multicast group. Its behavior may be affected by
- * <code>setInterface</code> or <code>setNetworkInterface</code>.
+ * {@code setInterface} or {@code setNetworkInterface}.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkMulticast</code> method
- * with the <code>mcastaddr</code> argument
+ * calls its {@code checkMulticast} method
+ * with the {@code mcastaddr} argument
* as its argument.
*
* @param mcastaddr is the multicast address to leave
* @exception IOException if there is an error leaving
* or when the address is not a multicast address.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> method doesn't allow the operation.
+ * {@code checkMulticast} method doesn't allow the operation.
*
* @see SecurityManager#checkMulticast(InetAddress)
*/
@@ -358,8 +358,8 @@
* Joins the specified multicast group at the specified interface.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkMulticast</code> method
- * with the <code>mcastaddr</code> argument
+ * calls its {@code checkMulticast} method
+ * with the {@code mcastaddr} argument
* as its argument.
*
* @param mcastaddr is the multicast address to join
@@ -371,7 +371,7 @@
* @exception IOException if there is an error joining
* or when the address is not a multicast address.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> method doesn't allow the join.
+ * {@code checkMulticast} method doesn't allow the join.
* @throws IllegalArgumentException if mcastaddr is null or is a
* SocketAddress subclass not supported by this socket
*
@@ -406,8 +406,8 @@
* Leave a multicast group on a specified local interface.
*
* <p>If there is a security manager, this method first
- * calls its <code>checkMulticast</code> method
- * with the <code>mcastaddr</code> argument
+ * calls its {@code checkMulticast} method
+ * with the {@code mcastaddr} argument
* as its argument.
*
* @param mcastaddr is the multicast address to leave
@@ -418,7 +418,7 @@
* @exception IOException if there is an error leaving
* or when the address is not a multicast address.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> method doesn't allow the operation.
+ * {@code checkMulticast} method doesn't allow the operation.
* @throws IllegalArgumentException if mcastaddr is null or is a
* SocketAddress subclass not supported by this socket
*
@@ -474,7 +474,7 @@
* Retrieve the address of the network interface used for
* multicast packets.
*
- * @return An <code>InetAddress</code> representing
+ * @return An {@code InetAddress} representing
* the address of the network interface used for
* multicast packets.
*
@@ -513,9 +513,9 @@
*/
try {
NetworkInterface ni = NetworkInterface.getByInetAddress(ia);
- Enumeration addrs = ni.getInetAddresses();
+ Enumeration<InetAddress> addrs = ni.getInetAddresses();
while (addrs.hasMoreElements()) {
- InetAddress addr = (InetAddress)(addrs.nextElement());
+ InetAddress addr = addrs.nextElement();
if (addr.equals(infAddress)) {
return infAddress;
}
@@ -558,7 +558,7 @@
*
* @exception SocketException if there is an error in
* the underlying protocol, such as a TCP error.
- * @return the multicast <code>NetworkInterface</code> currently set
+ * @return the multicast {@code NetworkInterface} currently set
* @see #setNetworkInterface(NetworkInterface)
* @since 1.4
*/
@@ -583,7 +583,7 @@
* <p>Because this option is a hint, applications that want to
* verify what loopback mode is set to should call
* {@link #getLoopbackMode()}
- * @param disable <code>true</code> to disable the LoopbackMode
+ * @param disable {@code true} to disable the LoopbackMode
* @throws SocketException if an error occurs while setting the value
* @since 1.4
* @see #getLoopbackMode
@@ -611,18 +611,18 @@
* otherwise it is preferable to set a TTL once on the socket, and
* use that default TTL for all packets. This method does <B>not
* </B> alter the default TTL for the socket. Its behavior may be
- * affected by <code>setInterface</code>.
+ * affected by {@code setInterface}.
*
* <p>If there is a security manager, this method first performs some
- * security checks. First, if <code>p.getAddress().isMulticastAddress()</code>
+ * security checks. First, if {@code p.getAddress().isMulticastAddress()}
* is true, this method calls the
- * security manager's <code>checkMulticast</code> method
- * with <code>p.getAddress()</code> and <code>ttl</code> as its arguments.
+ * security manager's {@code checkMulticast} method
+ * with {@code p.getAddress()} and {@code ttl} as its arguments.
* If the evaluation of that expression is false,
* this method instead calls the security manager's
- * <code>checkConnect</code> method with arguments
- * <code>p.getAddress().getHostAddress()</code> and
- * <code>p.getPort()</code>. Each call to a security manager method
+ * {@code checkConnect} method with arguments
+ * {@code p.getAddress().getHostAddress()} and
+ * {@code p.getPort()}. Each call to a security manager method
* could result in a SecurityException if the operation is not allowed.
*
* @param p is the packet to be sent. The packet should contain
@@ -635,7 +635,7 @@
* @exception IOException is raised if an error occurs i.e
* error while setting ttl.
* @exception SecurityException if a security manager exists and its
- * <code>checkMulticast</code> or <code>checkConnect</code>
+ * {@code checkMulticast} or {@code checkConnect}
* method doesn't allow the send.
*
* @deprecated Use the following code or its equivalent instead:
diff --git a/ojluni/src/main/java/java/net/NetworkInterface.java b/ojluni/src/main/java/java/net/NetworkInterface.java
index ac39d2a..358eeaa 100755
--- a/ojluni/src/main/java/java/net/NetworkInterface.java
+++ b/ojluni/src/main/java/java/net/NetworkInterface.java
@@ -98,9 +98,9 @@
* Convenience method to return an Enumeration with all or a
* subset of the InetAddresses bound to this network interface.
* <p>
- * If there is a security manager, its <code>checkConnect</code>
+ * If there is a security manager, its {@code checkConnect}
* method is called for each InetAddress. Only InetAddresses where
- * the <code>checkConnect</code> doesn't throw a SecurityException
+ * the {@code checkConnect} doesn't throw a SecurityException
* will be returned in the Enumeration. However, if the caller has the
* {@link NetPermission}("getNetworkInformation") permission, then all
* InetAddresses are returned.
@@ -154,15 +154,15 @@
}
/**
- * Get a List of all or a subset of the <code>InterfaceAddresses</code>
+ * Get a List of all or a subset of the {@code InterfaceAddresses}
* of this network interface.
* <p>
- * If there is a security manager, its <code>checkConnect</code>
+ * If there is a security manager, its {@code checkConnect}
* method is called with the InetAddress for each InterfaceAddress.
- * Only InterfaceAddresses where the <code>checkConnect</code> doesn't throw
+ * Only InterfaceAddresses where the {@code checkConnect} doesn't throw
* a SecurityException will be returned in the List.
*
- * @return a <code>List</code> object with all or a subset of the
+ * @return a {@code List} object with all or a subset of the
* InterfaceAddresss of this network interface
* @since 1.6
*/
@@ -216,10 +216,10 @@
/**
* Returns the parent NetworkInterface of this interface if this is
- * a subinterface, or <code>null</code> if it is a physical
+ * a subinterface, or {@code null} if it is a physical
* (non virtual) interface or has no parent.
*
- * @return The <code>NetworkInterface</code> this interface is attached to.
+ * @return The {@code NetworkInterface} this interface is attached to.
* @since 1.6
*/
public NetworkInterface getParent() {
@@ -260,15 +260,15 @@
* @param name
* The name of the network interface.
*
- * @return A <tt>NetworkInterface</tt> with the specified name,
- * or <tt>null</tt> if there is no network interface
+ * @return A {@code NetworkInterface} with the specified name,
+ * or {@code null} if there is no network interface
* with the specified name.
*
* @throws SocketException
* If an I/O error occurs.
*
* @throws NullPointerException
- * If the specified name is <tt>null</tt>.
+ * If the specified name is {@code null}.
*/
public static NetworkInterface getByName(String name) throws SocketException {
if (name == null)
@@ -303,17 +303,17 @@
* returned.
*
* @param addr
- * The <tt>InetAddress</tt> to search with.
+ * The {@code InetAddress} to search with.
*
- * @return A <tt>NetworkInterface</tt>
- * or <tt>null</tt> if there is no network interface
+ * @return A {@code NetworkInterface}
+ * or {@code null} if there is no network interface
* with the specified IP address.
*
* @throws SocketException
* If an I/O error occurs.
*
* @throws NullPointerException
- * If the specified address is <tt>null</tt>.
+ * If the specified address is {@code null}.
*/
public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketException {
if (addr == null) {
@@ -326,8 +326,10 @@
}
/**
- * Returns all the interfaces on this machine. Returns null if no
- * network interfaces could be found on this machine.
+ * Returns all the interfaces on this machine. The {@code Enumeration}
+ * contains at least one element, possibly representing a loopback
+ * interface that only supports communication between entities on
+ * this machine.
*
* NOTE: can use getNetworkInterfaces()+getInetAddresses()
* to obtain all IP addresses for this node
@@ -376,7 +378,7 @@
/**
* Returns whether a network interface is up and running.
*
- * @return <code>true</code> if the interface is up and running.
+ * @return {@code true} if the interface is up and running.
* @exception SocketException if an I/O error occurs.
* @since 1.6
*/
@@ -388,7 +390,7 @@
/**
* Returns whether a network interface is a loopback interface.
*
- * @return <code>true</code> if the interface is a loopback interface.
+ * @return {@code true} if the interface is a loopback interface.
* @exception SocketException if an I/O error occurs.
* @since 1.6
*/
@@ -402,7 +404,7 @@
* A typical point to point interface would be a PPP connection through
* a modem.
*
- * @return <code>true</code> if the interface is a point to point
+ * @return {@code true} if the interface is a point to point
* interface.
* @exception SocketException if an I/O error occurs.
* @since 1.6
@@ -415,7 +417,7 @@
/**
* Returns whether a network interface supports multicasting or not.
*
- * @return <code>true</code> if the interface supports Multicasting.
+ * @return {@code true} if the interface supports Multicasting.
* @exception SocketException if an I/O error occurs.
* @since 1.6
*/
@@ -430,7 +432,7 @@
* If a security manager is set, then the caller must have
* the permission {@link NetPermission}("getNetworkInformation").
*
- * @return a byte array containing the address, or <code>null</code> if
+ * @return a byte array containing the address, or {@code null} if
* the address doesn't exist, is not accessible or a security
* manager is set and the caller does not have the permission
* NetPermission("getNetworkInformation")
@@ -479,7 +481,7 @@
* can be several virtual interfaces attached to a single physical
* interface.
*
- * @return <code>true</code> if this interface is a virtual interface.
+ * @return {@code true} if this interface is a virtual interface.
* @since 1.6
*/
public boolean isVirtual() {
@@ -502,16 +504,16 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same NetworkInterface
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same NetworkInterface
* as this object.
* <p>
- * Two instances of <code>NetworkInterface</code> represent the same
+ * Two instances of {@code NetworkInterface} represent the same
* NetworkInterface if both name and addrs are the same for both.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetAddress#getAddress()
*/
public boolean equals(Object obj) {
diff --git a/ojluni/src/main/java/java/net/PasswordAuthentication.java b/ojluni/src/main/java/java/net/PasswordAuthentication.java
index ee2280f..5529568 100755
--- a/ojluni/src/main/java/java/net/PasswordAuthentication.java
+++ b/ojluni/src/main/java/java/net/PasswordAuthentication.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -43,11 +43,11 @@
private char[] password;
/**
- * Creates a new <code>PasswordAuthentication</code> object from the given
+ * Creates a new {@code PasswordAuthentication} object from the given
* user name and password.
*
* <p> Note that the given user password is cloned before it is stored in
- * the new <code>PasswordAuthentication</code> object.
+ * the new {@code PasswordAuthentication} object.
*
* @param userName the user name
* @param password the user's password
diff --git a/ojluni/src/main/java/java/net/PortUnreachableException.java b/ojluni/src/main/java/java/net/PortUnreachableException.java
index 75da609..dcaf1bf 100755
--- a/ojluni/src/main/java/java/net/PortUnreachableException.java
+++ b/ojluni/src/main/java/java/net/PortUnreachableException.java
@@ -37,7 +37,7 @@
private static final long serialVersionUID = 8462541992376507323L;
/**
- * Constructs a new <code>PortUnreachableException</code> with a
+ * Constructs a new {@code PortUnreachableException} with a
* detail message.
* @param msg the detail message
*/
@@ -46,7 +46,7 @@
}
/**
- * Construct a new <code>PortUnreachableException</code> with no
+ * Construct a new {@code PortUnreachableException} with no
* detailed message.
*/
public PortUnreachableException() {}
diff --git a/ojluni/src/main/java/java/net/ProtocolException.java b/ojluni/src/main/java/java/net/ProtocolException.java
index d5991dd..0f38e3f 100755
--- a/ojluni/src/main/java/java/net/ProtocolException.java
+++ b/ojluni/src/main/java/java/net/ProtocolException.java
@@ -40,7 +40,7 @@
private static final long serialVersionUID = -6098449442062388080L;
/**
- * Constructs a new <code>ProtocolException</code> with the
+ * Constructs a new {@code ProtocolException} with the
* specified detail message.
*
* @param host the detail message.
@@ -50,7 +50,7 @@
}
/**
- * Constructs a new <code>ProtocolException</code> with no detail message.
+ * Constructs a new {@code ProtocolException} with no detail message.
*/
public ProtocolException() {
}
diff --git a/ojluni/src/main/java/java/net/ProtocolFamily.java b/ojluni/src/main/java/java/net/ProtocolFamily.java
index c6aa95b..5d02326 100755
--- a/ojluni/src/main/java/java/net/ProtocolFamily.java
+++ b/ojluni/src/main/java/java/net/ProtocolFamily.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, 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
@@ -34,6 +34,8 @@
public interface ProtocolFamily {
/**
* Returns the name of the protocol family.
+ *
+ * @return the name of the protocol family
*/
String name();
}
diff --git a/ojluni/src/main/java/java/net/Proxy.java b/ojluni/src/main/java/java/net/Proxy.java
index 333067d..8ba020e 100755
--- a/ojluni/src/main/java/java/net/Proxy.java
+++ b/ojluni/src/main/java/java/net/Proxy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -28,7 +28,7 @@
/**
* This class represents a proxy setting, typically a type (http, socks) and
* a socket address.
- * A <code>Proxy</code> is an immutable object.
+ * A {@code Proxy} is an immutable object.
*
* @see java.net.ProxySelector
* @author Yingxian Wang
@@ -61,19 +61,19 @@
private SocketAddress sa;
/**
- * A proxy setting that represents a <code>DIRECT</code> connection,
+ * A proxy setting that represents a {@code DIRECT} connection,
* basically telling the protocol handler not to use any proxying.
* Used, for instance, to create sockets bypassing any other global
* proxy settings (like SOCKS):
* <P>
- * <code>Socket s = new Socket(Proxy.NO_PROXY);</code><br>
- * <P>
+ * {@code Socket s = new Socket(Proxy.NO_PROXY);}
+ *
*/
public final static Proxy NO_PROXY = new Proxy();
- // Creates the proxy that represents a <code>DIRECT</code> connection.
+ // Creates the proxy that represents a {@code DIRECT} connection.
private Proxy() {
- type = type.DIRECT;
+ type = Type.DIRECT;
sa = null;
}
@@ -82,11 +82,11 @@
* Certain combinations are illegal. For instance, for types Http, and
* Socks, a SocketAddress <b>must</b> be provided.
* <P>
- * Use the <code>Proxy.NO_PROXY</code> constant
+ * Use the {@code Proxy.NO_PROXY} constant
* for representing a direct connection.
*
- * @param type the <code>Type</code> of the proxy
- * @param sa the <code>SocketAddress</code> for that proxy
+ * @param type the {@code Type} of the proxy
+ * @param sa the {@code SocketAddress} for that proxy
* @throws IllegalArgumentException when the type and the address are
* incompatible
*/
@@ -108,9 +108,9 @@
/**
* Returns the socket address of the proxy, or
- * <code>null</code> if its a direct connection.
+ * {@code null} if its a direct connection.
*
- * @return a <code>SocketAddress</code> representing the socket end
+ * @return a {@code SocketAddress} representing the socket end
* point of the proxy
*/
public SocketAddress address() {
@@ -121,7 +121,7 @@
* Constructs a string representation of this Proxy.
* This String is constructed by calling toString() on its type
* and concatenating " @ " and the toString() result from its address
- * if its type is not <code>DIRECT</code>.
+ * if its type is not {@code DIRECT}.
*
* @return a string representation of this object.
*/
@@ -133,16 +133,16 @@
/**
* Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same proxy as
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and it represents the same proxy as
* this object.
* <p>
- * Two instances of <code>Proxy</code> represent the same
+ * Two instances of {@code Proxy} represent the same
* address if both the SocketAddresses and type are equal.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
* @see java.net.InetSocketAddress#equals(java.lang.Object)
*/
public final boolean equals(Object obj) {
diff --git a/ojluni/src/main/java/java/net/ProxySelector.java b/ojluni/src/main/java/java/net/ProxySelector.java
index 9a62e13..d6bb536 100755
--- a/ojluni/src/main/java/java/net/ProxySelector.java
+++ b/ojluni/src/main/java/java/net/ProxySelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -69,7 +69,7 @@
static {
try {
- Class c = Class.forName("sun.net.spi.DefaultProxySelector");
+ Class<?> c = Class.forName("sun.net.spi.DefaultProxySelector");
if (c != null && ProxySelector.class.isAssignableFrom(c)) {
theProxySelector = (ProxySelector) c.newInstance();
}
@@ -83,9 +83,9 @@
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("getProxySelector")</tt>
+ * {@link NetPermission}{@code ("getProxySelector")}
* @see #setDefault(ProxySelector)
- * @return the system-wide <code>ProxySelector</code>
+ * @return the system-wide {@code ProxySelector}
* @since 1.5
*/
public static ProxySelector getDefault() {
@@ -102,11 +102,11 @@
* Note: non-standard protocol handlers may ignore this setting.
*
* @param ps The HTTP proxy selector, or
- * <code>null</code> to unset the proxy selector.
+ * {@code null} to unset the proxy selector.
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("setProxySelector")</tt>
+ * {@link NetPermission}{@code ("setProxySelector")}
*
* @see #getDefault()
* @since 1.5
@@ -127,8 +127,7 @@
* <UL>
* <LI>http URI for http connections</LI>
* <LI>https URI for https connections
- * <LI>ftp URI for ftp connections</LI>
- * <LI><code>socket://host:port</code><br>
+ * <LI>{@code socket://host:port}<br>
* for tcp client sockets connections</LI>
* </UL>
*
diff --git a/ojluni/src/main/java/java/net/ResponseCache.java b/ojluni/src/main/java/java/net/ResponseCache.java
index 6a67bf6..2dfaf4a 100755
--- a/ojluni/src/main/java/java/net/ResponseCache.java
+++ b/ojluni/src/main/java/java/net/ResponseCache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -74,10 +74,10 @@
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("getResponseCache")</tt>
+ * {@link NetPermission}{@code ("getResponseCache")}
*
* @see #setDefault(ResponseCache)
- * @return the system-wide <code>ResponseCache</code>
+ * @return the system-wide {@code ResponseCache}
* @since 1.5
*/
public synchronized static ResponseCache getDefault() {
@@ -94,11 +94,11 @@
* Note: non-standard procotol handlers may ignore this setting.
*
* @param responseCache The response cache, or
- * <code>null</code> to unset the cache.
+ * {@code null} to unset the cache.
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link NetPermission}<tt>("setResponseCache")</tt>
+ * {@link NetPermission}{@code ("setResponseCache")}
*
* @see #getDefault()
* @since 1.5
@@ -118,14 +118,14 @@
* to get the network resource. If a cached response is returned,
* that resource is used instead.
*
- * @param uri a <code>URI</code> used to reference the requested
+ * @param uri a {@code URI} used to reference the requested
* network resource
- * @param rqstMethod a <code>String</code> representing the request
+ * @param rqstMethod a {@code String} representing the request
* method
* @param rqstHeaders - a Map from request header
* field names to lists of field values representing
* the current request headers
- * @return a <code>CacheResponse</code> instance if available
+ * @return a {@code CacheResponse} instance if available
* from cache, or null otherwise
* @throws IOException if an I/O error occurs
* @throws IllegalArgumentException if any one of the arguments is null
@@ -148,11 +148,11 @@
* use to write the resource into the cache. If the resource is
* not to be cached, then put must return null.
*
- * @param uri a <code>URI</code> used to reference the requested
+ * @param uri a {@code URI} used to reference the requested
* network resource
* @param conn - a URLConnection instance that is used to fetch
* the response to be cached
- * @return a <code>CacheRequest</code> for recording the
+ * @return a {@code CacheRequest} for recording the
* response to be cached. Null return indicates that
* the caller does not intend to cache the response.
* @throws IOException if an I/O error occurs
diff --git a/ojluni/src/main/java/java/net/ServerSocket.java b/ojluni/src/main/java/java/net/ServerSocket.java
index 4bf2a69..dc1461c 100755
--- a/ojluni/src/main/java/java/net/ServerSocket.java
+++ b/ojluni/src/main/java/java/net/ServerSocket.java
@@ -37,7 +37,7 @@
* based on that request, and then possibly returns a result to the requester.
* <p>
* The actual work of the server socket is performed by an instance
- * of the <code>SocketImpl</code> class. An application can
+ * of the {@code SocketImpl} class. An application can
* change the socket factory that creates the socket
* implementation to configure itself to create sockets
* appropriate to the local firewall.
@@ -89,31 +89,31 @@
/**
* Creates a server socket, bound to the specified port. A port number
- * of <code>0</code> means that the port number is automatically
+ * of {@code 0} means that the port number is automatically
* allocated, typically from an ephemeral port range. This port
* number can then be retrieved by calling {@link #getLocalPort getLocalPort}.
* <p>
* The maximum queue length for incoming connection indications (a
- * request to connect) is set to <code>50</code>. If a connection
+ * request to connect) is set to {@code 50}. If a connection
* indication arrives when the queue is full, the connection is refused.
* <p>
* If the application has specified a server socket factory, that
- * factory's <code>createSocketImpl</code> method is called to create
+ * factory's {@code createSocketImpl} method is called to create
* the actual socket implementation. Otherwise a "plain" socket is created.
* <p>
* If there is a security manager,
- * its <code>checkListen</code> method is called
- * with the <code>port</code> argument
+ * its {@code checkListen} method is called
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
*
- * @param port the port number, or <code>0</code> to use a port
+ * @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
*
* @exception IOException if an I/O error occurs when opening the socket.
* @exception SecurityException
- * if a security manager exists and its <code>checkListen</code>
+ * if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
@@ -131,42 +131,42 @@
/**
* Creates a server socket and binds it to the specified local port
* number, with the specified backlog.
- * A port number of <code>0</code> means that the port number is
+ * A port number of {@code 0} means that the port number is
* automatically allocated, typically from an ephemeral port range.
* This port number can then be retrieved by calling
* {@link #getLocalPort getLocalPort}.
* <p>
* The maximum queue length for incoming connection indications (a
- * request to connect) is set to the <code>backlog</code> parameter. If
+ * request to connect) is set to the {@code backlog} parameter. If
* a connection indication arrives when the queue is full, the
* connection is refused.
* <p>
* If the application has specified a server socket factory, that
- * factory's <code>createSocketImpl</code> method is called to create
+ * factory's {@code createSocketImpl} method is called to create
* the actual socket implementation. Otherwise a "plain" socket is created.
* <p>
* If there is a security manager,
- * its <code>checkListen</code> method is called
- * with the <code>port</code> argument
+ * its {@code checkListen} method is called
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
- * The <code>backlog</code> argument is the requested maximum number of
+ * 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
- * should be greater than <code>0</code>. If it is less than or equal to
- * <code>0</code>, then an implementation specific default will be used.
+ * should be greater than {@code 0}. If it is less than or equal to
+ * {@code 0}, then an implementation specific default will be used.
* <P>
*
- * @param port the port number, or <code>0</code> to use a port
+ * @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
* @param backlog requested maximum length of the queue of incoming
* connections.
*
* @exception IOException if an I/O error occurs when opening the socket.
* @exception SecurityException
- * if a security manager exists and its <code>checkListen</code>
+ * if a security manager exists and its {@code checkListen}
* method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
@@ -189,32 +189,32 @@
* If <i>bindAddr</i> is null, it will default accepting
* connections on any/all local addresses.
* The port must be between 0 and 65535, inclusive.
- * A port number of <code>0</code> means that the port number is
+ * A port number of {@code 0} means that the port number is
* automatically allocated, typically from an ephemeral port range.
* This port number can then be retrieved by calling
* {@link #getLocalPort getLocalPort}.
*
* <P>If there is a security manager, this method
- * calls its <code>checkListen</code> method
- * with the <code>port</code> argument
+ * calls its {@code checkListen} method
+ * with the {@code port} argument
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
- * The <code>backlog</code> argument is the requested maximum number of
+ * 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
- * should be greater than <code>0</code>. If it is less than or equal to
- * <code>0</code>, then an implementation specific default will be used.
+ * should be greater than {@code 0}. If it is less than or equal to
+ * {@code 0}, then an implementation specific default will be used.
* <P>
- * @param port the port number, or <code>0</code> to use a port
+ * @param port the port number, or {@code 0} to use a port
* number that is automatically allocated.
* @param backlog requested maximum length of the queue of incoming
* connections.
* @param bindAddr the local InetAddress the server will bind to
*
* @throws SecurityException if a security manager exists and
- * its <code>checkListen</code> method doesn't allow the operation.
+ * its {@code checkListen} method doesn't allow the operation.
*
* @throws IOException if an I/O error occurs when opening the socket.
* @exception IllegalArgumentException if the port parameter is outside
@@ -245,10 +245,10 @@
}
/**
- * Get the <code>SocketImpl</code> attached to this socket, creating
+ * Get the {@code SocketImpl} attached to this socket, creating
* it if necessary.
*
- * @return the <code>SocketImpl</code> attached to that ServerSocket.
+ * @return the {@code SocketImpl} attached to that ServerSocket.
* @throws SocketException if creation fails.
* @since 1.4
* @hide
@@ -312,17 +312,17 @@
/**
*
- * Binds the <code>ServerSocket</code> to a specific address
+ * Binds the {@code ServerSocket} to a specific address
* (IP address and port number).
* <p>
- * If the address is <code>null</code>, then the system will pick up
+ * If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
* <p>
- * @param endpoint The IP address & port number to bind to.
+ * @param endpoint The IP address and port number to bind to.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
- * @throws SecurityException if a <code>SecurityManager</code> is present and
- * its <code>checkListen</code> method doesn't allow the operation.
+ * @throws SecurityException if a {@code SecurityManager} is present and
+ * its {@code checkListen} method doesn't allow the operation.
* @throws IllegalArgumentException if endpoint is a
* SocketAddress subclass not supported by this socket
* @since 1.4
@@ -333,25 +333,25 @@
/**
*
- * Binds the <code>ServerSocket</code> to a specific address
+ * Binds the {@code ServerSocket} to a specific address
* (IP address and port number).
* <p>
- * If the address is <code>null</code>, then the system will pick up
+ * If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
* <P>
- * The <code>backlog</code> argument is the requested maximum number of
+ * 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
- * should be greater than <code>0</code>. If it is less than or equal to
- * <code>0</code>, then an implementation specific default will be used.
- * @param endpoint The IP address & port number to bind to.
+ * 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.
* @param backlog requested maximum length of the queue of
* incoming connections.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
- * @throws SecurityException if a <code>SecurityManager</code> is present and
- * its <code>checkListen</code> method doesn't allow the operation.
+ * @throws SecurityException if a {@code SecurityManager} is present and
+ * its {@code checkListen} method doesn't allow the operation.
* @throws IllegalArgumentException if endpoint is a
* SocketAddress subclass not supported by this socket
* @since 1.4
@@ -392,9 +392,17 @@
* If the socket was bound prior to being {@link #close closed},
* then this method will continue to return the local address
* after the socket is closed.
+ * <p>
+ * If there is a security manager set, its {@code checkConnect} method is
+ * called with the local address and {@code -1} as its arguments to see
+ * if the operation is allowed. If the operation is not allowed,
+ * the {@link InetAddress#getLoopbackAddress loopback} address is returned.
*
* @return the address to which this socket is bound,
- * or <code>null</code> if the socket is unbound.
+ * or the loopback address if denied by the security manager,
+ * or {@code null} if the socket is unbound.
+ *
+ * @see SecurityManager#checkConnect
*/
public InetAddress getInetAddress() {
if (!isBound())
@@ -442,17 +450,28 @@
/**
* Returns the address of the endpoint this socket is bound to, or
- * <code>null</code> if it is not bound yet.
+ * {@code null} if it is not bound yet.
* <p>
* If the socket was bound prior to being {@link #close closed},
* then this method will continue to return the address of the endpoint
* after the socket is closed.
+ * <p>
+ * If there is a security manager set, its {@code checkConnect} method is
+ * called with the local address and {@code -1} as its arguments to see
+ * if the operation is allowed. If the operation is not allowed,
+ * a {@code SocketAddress} representing the
+ * {@link InetAddress#getLoopbackAddress loopback} address and the local
+ * port to which the socket is bound is returned.
*
- * @return a <code>SocketAddress</code> representing the local endpoint of this
- * socket, or <code>null</code> if it is not bound yet.
+ * @return a {@code SocketAddress} representing the local endpoint of
+ * this socket, or a {@code SocketAddress} representing the
+ * loopback address if denied by the security manager,
+ * or {@code null} if the socket is not bound yet.
+ *
* @see #getInetAddress()
* @see #getLocalPort()
* @see #bind(SocketAddress)
+ * @see SecurityManager#checkConnect
* @since 1.4
*/
@@ -466,18 +485,18 @@
* Listens for a connection to be made to this socket and accepts
* it. The method blocks until a connection is made.
*
- * <p>A new Socket <code>s</code> is created and, if there
+ * <p>A new Socket {@code s} is created and, if there
* is a security manager,
- * the security manager's <code>checkAccept</code> method is called
- * with <code>s.getInetAddress().getHostAddress()</code> and
- * <code>s.getPort()</code>
+ * the security manager's {@code checkAccept} method is called
+ * with {@code s.getInetAddress().getHostAddress()} and
+ * {@code s.getPort()}
* as its arguments to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @exception IOException if an I/O error occurs when waiting for a
* connection.
* @exception SecurityException if a security manager exists and its
- * <code>checkAccept</code> method doesn't allow the operation.
+ * {@code checkAccept} method doesn't allow the operation.
* @exception SocketTimeoutException if a timeout was previously set with setSoTimeout and
* the timeout has been reached.
* @exception java.nio.channels.IllegalBlockingModeException
@@ -583,7 +602,7 @@
* method.
*
* @return the server-socket channel associated with this socket,
- * or <tt>null</tt> if this socket was not created
+ * or {@code null} if this socket was not created
* for a channel
*
* @since 1.4
@@ -596,7 +615,7 @@
/**
* Returns the binding state of the ServerSocket.
*
- * @return true if the ServerSocket succesfuly bound to an address
+ * @return true if the ServerSocket successfully bound to an address
* @since 1.4
*/
public boolean isBound() {
@@ -617,14 +636,14 @@
}
/**
- * Enable/disable SO_TIMEOUT with the specified timeout, in
- * milliseconds. With this option set to a non-zero timeout,
- * a call to accept() for this ServerSocket
+ * Enable/disable {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} with the
+ * specified timeout, in milliseconds. With this option set to a non-zero
+ * timeout, a call to accept() for this ServerSocket
* will block for only this amount of time. If the timeout expires,
* a <B>java.net.SocketTimeoutException</B> is raised, though the
* ServerSocket is still valid. The option <B>must</B> be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
* @param timeout the specified timeout, in milliseconds
* @exception SocketException if there is an error in
@@ -639,9 +658,9 @@
}
/**
- * Retrieve setting for SO_TIMEOUT. 0 returns implies that the
- * option is disabled (i.e., timeout of infinity).
- * @return the SO_TIMEOUT value
+ * Retrieve setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
+ * 0 returns implies that the option is disabled (i.e., timeout of infinity).
+ * @return the {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} value
* @exception IOException if an I/O error occurs
* @since JDK1.1
* @see #setSoTimeout(int)
@@ -659,35 +678,35 @@
}
/**
- * Enable/disable the SO_REUSEADDR socket option.
+ * Enable/disable the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
+ * socket option.
* <p>
* When a TCP connection is closed the connection may remain
* in a timeout state for a period of time after the connection
- * is closed (typically known as the <tt>TIME_WAIT</tt> state
- * or <tt>2MSL</tt> wait state).
+ * is closed (typically known as the {@code TIME_WAIT} state
+ * or {@code 2MSL} wait state).
* For applications using a well known socket address or port
* it may not be possible to bind a socket to the required
- * <tt>SocketAddress</tt> if there is a connection in the
+ * {@code SocketAddress} if there is a connection in the
* timeout state involving the socket address or port.
* <p>
- * Enabling <tt>SO_REUSEADDR</tt> prior to binding the socket
- * using {@link #bind(SocketAddress)} allows the socket to be
- * bound even though a previous connection is in a timeout
- * state.
+ * Enabling {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} prior to
+ * binding the socket using {@link #bind(SocketAddress)} allows the socket
+ * to be bound even though a previous connection is in a timeout state.
* <p>
- * When a <tt>ServerSocket</tt> is created the initial setting
- * of <tt>SO_REUSEADDR</tt> is not defined. Applications can
- * use {@link #getReuseAddress()} to determine the initial
- * setting of <tt>SO_REUSEADDR</tt>.
+ * When a {@code ServerSocket} is created the initial setting
+ * of {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is not defined.
+ * Applications can use {@link #getReuseAddress()} to determine the initial
+ * setting of {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}.
* <p>
- * The behaviour when <tt>SO_REUSEADDR</tt> is enabled or
- * disabled after a socket is bound (See {@link #isBound()})
+ * The behaviour when {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
+ * enabled or disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
* @exception SocketException if an error occurs enabling or
- * disabling the <tt>SO_RESUEADDR</tt> socket option,
- * or the socket is closed.
+ * disabling the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
+ * socket option, or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
@@ -701,9 +720,10 @@
}
/**
- * Tests if SO_REUSEADDR is enabled.
+ * Tests if {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
*
- * @return a <code>boolean</code> indicating whether or not SO_REUSEADDR is enabled.
+ * @return a {@code boolean} indicating whether or not
+ * {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
@@ -717,11 +737,18 @@
/**
* Returns the implementation address and implementation port of
- * this socket as a <code>String</code>.
+ * this socket as a {@code String}.
+ * <p>
+ * If there is a security manager set, its {@code checkConnect} method is
+ * called with the local address and {@code -1} as its arguments to see
+ * if the operation is allowed. If the operation is not allowed,
+ * an {@code InetAddress} representing the
+ * {@link InetAddress#getLoopbackAddress loopback} address is returned as
+ * the implementation address.
*
* @return a string representation of this socket.
*/
- public String toString() {
+ public String toString() {
if (!isBound())
return "ServerSocket[unbound]";
InetAddress in;
@@ -734,7 +761,7 @@
}
return "ServerSocket[addr=" + in +
",localport=" + impl.getLocalPort() + "]";
- }
+ }
void setBound() {
bound = true;
@@ -754,14 +781,14 @@
* application. The factory can be specified only once.
* <p>
* When an application creates a new server socket, the socket
- * implementation factory's <code>createSocketImpl</code> method is
+ * implementation factory's {@code createSocketImpl} method is
* called to create the actual socket implementation.
* <p>
- * Passing <code>null</code> to the method is a no-op unless the factory
+ * Passing {@code null} to the method is a no-op unless the factory
* was already set.
* <p>
* If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
@@ -770,7 +797,7 @@
* socket factory.
* @exception SocketException if the factory has already been defined.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow the operation.
+ * {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
*/
@@ -786,15 +813,16 @@
}
/**
- * Sets a default proposed value for the SO_RCVBUF option for sockets
- * accepted from this <tt>ServerSocket</tt>. The value actually set
+ * Sets a default proposed value for the
+ * {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option for sockets
+ * accepted from this {@code ServerSocket}. The value actually set
* in the accepted socket must be determined by calling
* {@link Socket#getReceiveBufferSize()} after the socket
* is returned by {@link #accept()}.
* <p>
- * The value of 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.
+ * 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.
* <p>
* It is possible to change the value subsequently, by calling
* {@link Socket#setReceiveBufferSize(int)}. However, if the application
@@ -830,15 +858,16 @@
}
/**
- * Gets the value of the SO_RCVBUF option for this <tt>ServerSocket</tt>,
- * that is the proposed buffer size that will be used for Sockets accepted
- * from this <tt>ServerSocket</tt>.
+ * Gets the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option
+ * for this {@code ServerSocket}, that is the proposed buffer size that
+ * will be used for Sockets accepted from this {@code ServerSocket}.
*
* <p>Note, the value actually set in the accepted socket is determined by
* calling {@link Socket#getReceiveBufferSize()}.
- * @return the value of the SO_RCVBUF option for this <tt>Socket</tt>.
+ * option for this {@code Socket}.
* @exception SocketException if there is an error
- * in the underlying protocol, such as a TCP error.
+ * in the underlying protocol, such as a TCP error.
+ * in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
* @since 1.4
*/
@@ -870,24 +899,24 @@
* compared, with larger values indicating stronger preferences. If the
* application prefers short connection time over both low latency and high
* bandwidth, for example, then it could invoke this method with the values
- * <tt>(1, 0, 0)</tt>. If the application prefers high bandwidth above low
+ * {@code (1, 0, 0)}. If the application prefers high bandwidth above low
* latency, and low latency above short connection time, then it could
- * invoke this method with the values <tt>(0, 1, 2)</tt>.
+ * invoke this method with the values {@code (0, 1, 2)}.
*
* <p> Invoking this method after this socket has been bound
* will have no effect. This implies that in order to use this capability
* requires the socket to be created with the no-argument constructor.
*
* @param connectionTime
- * An <tt>int</tt> expressing the relative importance of a short
+ * An {@code int} expressing the relative importance of a short
* connection time
*
* @param latency
- * An <tt>int</tt> expressing the relative importance of low
+ * An {@code int} expressing the relative importance of low
* latency
*
* @param bandwidth
- * An <tt>int</tt> expressing the relative importance of high
+ * An {@code int} expressing the relative importance of high
* bandwidth
*
* @since 1.5
diff --git a/ojluni/src/main/java/java/net/Socket.java b/ojluni/src/main/java/java/net/Socket.java
index 2aa057f..c8bfe95 100755
--- a/ojluni/src/main/java/java/net/Socket.java
+++ b/ojluni/src/main/java/java/net/Socket.java
@@ -42,7 +42,7 @@
* between two machines.
* <p>
* The actual work of the socket is performed by an instance of the
- * <code>SocketImpl</code> class. An application, by changing
+ * {@code SocketImpl} class. An application, by changing
* the socket factory that creates the socket implementation,
* can configure itself to create sockets appropriate to the local
* firewall.
@@ -91,14 +91,14 @@
* Creates an unconnected socket, specifying the type of proxy, if any,
* that should be used regardless of any other settings.
* <P>
- * If there is a security manager, its <code>checkConnect</code> method
+ * If there is a security manager, its {@code checkConnect} method
* is called with the proxy host address and port number
* as its arguments. This could result in a SecurityException.
* <P>
* Examples:
- * <UL> <LI><code>Socket s = new Socket(Proxy.NO_PROXY);</code> will create
+ * <UL> <LI>{@code Socket s = new Socket(Proxy.NO_PROXY);} will create
* a plain socket ignoring any other proxy configuration.</LI>
- * <LI><code>Socket s = new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("socks.mydom.com", 1080)));</code>
+ * <LI>{@code Socket s = new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("socks.mydom.com", 1080)));}
* will create a socket connecting through the specified SOCKS proxy
* server.</LI>
* </UL>
@@ -106,7 +106,7 @@
* @param proxy a {@link java.net.Proxy Proxy} object specifying what kind
* of proxying should be used.
* @throws IllegalArgumentException if the proxy is of an invalid type
- * or <code>null</code>.
+ * or {@code null}.
* @throws SecurityException if a security manager is present and
* permission to connect to the proxy is
* denied.
@@ -173,21 +173,22 @@
* Creates a stream socket and connects it to the specified port
* number on the named host.
* <p>
- * If the specified host is <tt>null</tt> it is the equivalent of
- * specifying the address as <tt>{@link java.net.InetAddress#getByName InetAddress.getByName}(null)</tt>.
+ * If the specified host is {@code null} it is the equivalent of
+ * specifying the address as
+ * {@link java.net.InetAddress#getByName InetAddress.getByName}{@code (null)}.
* In other words, it is equivalent to specifying an address of the
* loopback interface. </p>
* <p>
* If the application has specified a server socket factory, that
- * factory's <code>createSocketImpl</code> method is called to create
+ * factory's {@code createSocketImpl} method is called to create
* the actual socket implementation. Otherwise a "plain" socket is created.
* <p>
* If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the host address and <code>port</code>
+ * {@code checkConnect} method is called
+ * with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
- * @param host the host name, or <code>null</code> for the loopback address.
+ * @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
*
* @exception UnknownHostException if the IP address of
@@ -195,7 +196,7 @@
*
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
@@ -217,23 +218,23 @@
* number at the specified IP address.
* <p>
* If the application has specified a socket factory, that factory's
- * <code>createSocketImpl</code> method is called to create the
+ * {@code createSocketImpl} method is called to create the
* actual socket implementation. Otherwise a "plain" socket is created.
* <p>
* If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the host address and <code>port</code>
+ * {@code checkConnect} method is called
+ * with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
* @param address the IP address.
* @param port the port number.
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
- * @exception NullPointerException if <code>address</code> is null.
+ * @exception NullPointerException if {@code address} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
@@ -249,28 +250,31 @@
* the specified remote port. The Socket will also bind() to the local
* address and port supplied.
* <p>
- * If the specified host is <tt>null</tt> it is the equivalent of
- * specifying the address as <tt>{@link java.net.InetAddress#getByName InetAddress.getByName}(null)</tt>.
+ * If the specified host is {@code null} it is the equivalent of
+ * specifying the address as
+ * {@link java.net.InetAddress#getByName InetAddress.getByName}{@code (null)}.
* In other words, it is equivalent to specifying an address of the
* loopback interface. </p>
* <p>
- * A local port number of <code>zero</code> will let the system pick up a
- * free port in the <code>bind</code> operation.</p>
+ * A local port number of {@code zero} will let the system pick up a
+ * free port in the {@code bind} operation.</p>
* <p>
* If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the host address and <code>port</code>
+ * {@code checkConnect} method is called
+ * with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
- * @param host the name of the remote host, or <code>null</code> for the loopback address.
+ * @param host the name of the remote host, or {@code null} for the loopback address.
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
- * <code>null</code> for the <code>anyLocal</code> address.
+ * {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to, or
- * <code>zero</code> for a system selected free port.
+ * {@code zero} for a system selected free port.
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the connection
+ * to the destination, or if its {@code checkListen} method
+ * doesn't allow the bind to the local port.
* @exception IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
@@ -289,30 +293,33 @@
* the specified remote port. The Socket will also bind() to the local
* address and port supplied.
* <p>
- * If the specified local address is <tt>null</tt> it is the equivalent of
- * specifying the address as the AnyLocal address (see <tt>{@link java.net.InetAddress#isAnyLocalAddress InetAddress.isAnyLocalAddress}()</tt>).
+ * If the specified local address is {@code null} it is the equivalent of
+ * specifying the address as the AnyLocal address
+ * (see {@link java.net.InetAddress#isAnyLocalAddress InetAddress.isAnyLocalAddress}{@code ()}).
* <p>
- * A local port number of <code>zero</code> will let the system pick up a
- * free port in the <code>bind</code> operation.</p>
+ * A local port number of {@code zero} will let the system pick up a
+ * free port in the {@code bind} operation.</p>
* <p>
* If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the host address and <code>port</code>
+ * {@code checkConnect} method is called
+ * with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
*
* @param address the remote address
* @param port the remote port
* @param localAddr the local address the socket is bound to, or
- * <code>null</code> for the <code>anyLocal</code> address.
+ * {@code null} for the {@code anyLocal} address.
* @param localPort the local port the socket is bound to or
- * <code>zero</code> for a system selected free port.
+ * {@code zero} for a system selected free port.
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the connection
+ * to the destination, or if its {@code checkListen} method
+ * doesn't allow the bind to the local port.
* @exception IllegalArgumentException if the port parameter or localPort
* parameter is outside the specified range of valid port values,
* which is between 0 and 65535, inclusive.
- * @exception NullPointerException if <code>address</code> is null.
+ * @exception NullPointerException if {@code address} is null.
* @see SecurityManager#checkConnect
* @since JDK1.1
*/
@@ -326,33 +333,34 @@
* Creates a stream socket and connects it to the specified port
* number on the named host.
* <p>
- * If the specified host is <tt>null</tt> it is the equivalent of
- * specifying the address as <tt>{@link java.net.InetAddress#getByName InetAddress.getByName}(null)</tt>.
+ * If the specified host is {@code null} it is the equivalent of
+ * specifying the address as
+ * {@link java.net.InetAddress#getByName InetAddress.getByName}{@code (null)}.
* In other words, it is equivalent to specifying an address of the
* loopback interface. </p>
* <p>
- * If the stream argument is <code>true</code>, this creates a
- * stream socket. If the stream argument is <code>false</code>, it
+ * If the stream argument is {@code true}, this creates a
+ * stream socket. If the stream argument is {@code false}, it
* creates a datagram socket.
* <p>
* If the application has specified a server socket factory, that
- * factory's <code>createSocketImpl</code> method is called to create
+ * factory's {@code createSocketImpl} method is called to create
* the actual socket implementation. Otherwise a "plain" socket is created.
* <p>
* If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with the host address and <code>port</code>
+ * {@code checkConnect} method is called
+ * with the host address and {@code port}
* as its arguments. This could result in a SecurityException.
* <p>
* If a UDP socket is used, TCP/IP related socket options will not apply.
*
- * @param host the host name, or <code>null</code> for the loopback address.
+ * @param host the host name, or {@code null} for the loopback address.
* @param port the port number.
- * @param stream a <code>boolean</code> indicating whether this is
+ * @param stream a {@code boolean} indicating whether this is
* a stream socket or a datagram socket.
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
@@ -373,32 +381,32 @@
* Creates a socket and connects it to the specified port number at
* the specified IP address.
* <p>
- * If the stream argument is <code>true</code>, this creates a
- * stream socket. If the stream argument is <code>false</code>, it
+ * If the stream argument is {@code true}, this creates a
+ * stream socket. If the stream argument is {@code false}, it
* creates a datagram socket.
* <p>
* If the application has specified a server socket factory, that
- * factory's <code>createSocketImpl</code> method is called to create
+ * factory's {@code createSocketImpl} method is called to create
* the actual socket implementation. Otherwise a "plain" socket is created.
*
* <p>If there is a security manager, its
- * <code>checkConnect</code> method is called
- * with <code>host.getHostAddress()</code> and <code>port</code>
+ * {@code checkConnect} method is called
+ * with {@code host.getHostAddress()} and {@code port}
* as its arguments. This could result in a SecurityException.
* <p>
* If UDP socket is used, TCP/IP related socket options will not apply.
*
* @param host the IP address.
* @param port the port number.
- * @param stream if <code>true</code>, create a stream socket;
+ * @param stream if {@code true}, create a stream socket;
* otherwise, create a datagram socket.
* @exception IOException if an I/O error occurs when creating the socket.
* @exception SecurityException if a security manager exists and its
- * <code>checkConnect</code> method doesn't allow the operation.
+ * {@code checkConnect} method doesn't allow the operation.
* @exception IllegalArgumentException if the port parameter is outside
* the specified range of valid port values, which is between
* 0 and 65535, inclusive.
- * @exception NullPointerException if <code>host</code> is null.
+ * @exception NullPointerException if {@code host} is null.
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.net.SocketImplFactory#createSocketImpl()
@@ -439,8 +447,8 @@
/**
* Creates the socket implementation.
*
- * @param stream a <code>boolean</code> value : <code>true</code> for a TCP socket,
- * <code>false</code> for UDP.
+ * @param stream a {@code boolean} value : {@code true} for a TCP socket,
+ * {@code false} for UDP.
* @throws IOException if creation fails
* @since 1.4
*/
@@ -505,10 +513,10 @@
/**
- * Get the <code>SocketImpl</code> attached to this socket, creating
+ * Get the {@code SocketImpl} attached to this socket, creating
* it if necessary.
*
- * @return the <code>SocketImpl</code> attached to that ServerSocket.
+ * @return the {@code SocketImpl} attached to that ServerSocket.
* @throws SocketException if creation fails
* @since 1.4
*/
@@ -521,7 +529,7 @@
/**
* Connects this socket to the server.
*
- * @param endpoint the <code>SocketAddress</code>
+ * @param endpoint the {@code SocketAddress}
* @throws IOException if an error occurs during the connection
* @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
@@ -540,7 +548,7 @@
* A timeout of zero is interpreted as an infinite timeout. The connection
* will then block until established or an error occurs.
*
- * @param endpoint the <code>SocketAddress</code>
+ * @param endpoint the {@code SocketAddress}
* @param timeout the timeout value to be used in milliseconds.
* @throws IOException if an error occurs during the connection
* @throws SocketTimeoutException if timeout expires before connecting
@@ -602,10 +610,10 @@
/**
* Binds the socket to a local address.
* <P>
- * If the address is <code>null</code>, then the system will pick up
+ * If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
*
- * @param bindpoint the <code>SocketAddress</code> to bind to
+ * @param bindpoint the {@code SocketAddress} to bind to
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
* @throws IllegalArgumentException if bindpoint is a
@@ -673,7 +681,7 @@
* after the socket is closed.
*
* @return the remote IP address to which this socket is connected,
- * or <code>null</code> if the socket is not connected.
+ * or {@code null} if the socket is not connected.
*/
public InetAddress getInetAddress() {
if (!isConnected())
@@ -687,11 +695,18 @@
/**
* Gets the local address to which the socket is bound.
+ * <p>
+ * If there is a security manager set, its {@code checkConnect} method is
+ * called with the local address and {@code -1} as its arguments to see
+ * if the operation is allowed. If the operation is not allowed,
+ * the {@link InetAddress#getLoopbackAddress loopback} address is returned.
*
- * @return the local address to which the socket is bound, or
- * the {@link InetAddress#isAnyLocalAddress wildcard} address
- * if the socket is closed or not bound yet.
+ * @return the local address to which the socket is bound,
+ * the loopback address if denied by the security manager, or
+ * the wildcard address if the socket is closed or not bound yet.
* @since JDK1.1
+ *
+ * @see SecurityManager#checkConnect
*/
public InetAddress getLocalAddress() {
// This is for backward compatibility
@@ -761,15 +776,15 @@
/**
* Returns the address of the endpoint this socket is connected to, or
- * <code>null</code> if it is unconnected.
+ * {@code null} if it is unconnected.
* <p>
* If the socket was connected prior to being {@link #close closed},
* then this method will continue to return the connected address
* after the socket is closed.
*
- * @return a <code>SocketAddress</code> representing the remote endpoint of this
- * socket, or <code>null</code> if it is not connected yet.
+ * @return a {@code SocketAddress} representing the remote endpoint of this
+ * socket, or {@code null} if it is not connected yet.
* @see #getInetAddress()
* @see #getPort()
* @see #connect(SocketAddress, int)
@@ -783,22 +798,32 @@
}
/**
- * Returns the address of the endpoint this socket is bound to, or
- * <code>null</code> if it is not bound yet.
+ * Returns the address of the endpoint this socket is bound to.
* <p>
* If a socket bound to an endpoint represented by an
- * <code>InetSocketAddress </code> is {@link #close closed},
- * then this method will continue to return an <code>InetSocketAddress</code>
+ * {@code InetSocketAddress } is {@link #close closed},
+ * then this method will continue to return an {@code InetSocketAddress}
* after the socket is closed. In that case the returned
- * <code>InetSocketAddress</code>'s address is the
+ * {@code InetSocketAddress}'s address is the
* {@link InetAddress#isAnyLocalAddress wildcard} address
* and its port is the local port that it was bound to.
+ * <p>
+ * If there is a security manager set, its {@code checkConnect} method is
+ * called with the local address and {@code -1} as its arguments to see
+ * if the operation is allowed. If the operation is not allowed,
+ * a {@code SocketAddress} representing the
+ * {@link InetAddress#getLoopbackAddress loopback} address and the local
+ * port to which this socket is bound is returned.
*
- * @return a <code>SocketAddress</code> representing the local endpoint of this
- * socket, or <code>null</code> if it is not bound yet.
+ * @return a {@code SocketAddress} representing the local endpoint of
+ * this socket, or a {@code SocketAddress} representing the
+ * loopback address if denied by the security manager, or
+ * {@code null} if the socket is not bound yet.
+ *
* @see #getLocalAddress()
* @see #getLocalPort()
* @see #bind(SocketAddress)
+ * @see SecurityManager#checkConnect
* @since 1.4
*/
@@ -819,7 +844,7 @@
* methods.
*
* @return the socket channel associated with this socket,
- * or <tt>null</tt> if this socket was not created
+ * or {@code null} if this socket was not created
* for a channel
*
* @since 1.4
@@ -834,7 +859,7 @@
*
* <p> If this socket has an associated channel then the resulting input
* stream delegates all of its operations to the channel. If the channel
- * is in non-blocking mode then the input stream's <tt>read</tt> operations
+ * is in non-blocking mode then the input stream's {@code read} operations
* will throw an {@link java.nio.channels.IllegalBlockingModeException}.
*
* <p>Under abnormal conditions the underlying connection may be
@@ -858,7 +883,7 @@
* <li><p>If there are no bytes buffered on the socket, and the
* socket has not been closed using {@link #close close}, then
* {@link java.io.InputStream#available available} will
- * return <code>0</code>.
+ * return {@code 0}.
*
* </ul>
*
@@ -901,7 +926,7 @@
*
* <p> If this socket has an associated channel then the resulting output
* stream delegates all of its operations to the channel. If the channel
- * is in non-blocking mode then the output stream's <tt>write</tt>
+ * is in non-blocking mode then the output stream's {@code write}
* operations will throw an {@link
* java.nio.channels.IllegalBlockingModeException}.
*
@@ -937,10 +962,11 @@
}
/**
- * Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
+ * Enable/disable {@link SocketOptions#TCP_NODELAY TCP_NODELAY}
+ * (disable/enable Nagle's algorithm).
*
- * @param on <code>true</code> to enable TCP_NODELAY,
- * <code>false</code> to disable.
+ * @param on {@code true} to enable TCP_NODELAY,
+ * {@code false} to disable.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
@@ -956,9 +982,10 @@
}
/**
- * Tests if TCP_NODELAY is enabled.
+ * Tests if {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
*
- * @return a <code>boolean</code> indicating whether or not TCP_NODELAY is enabled.
+ * @return a {@code boolean} indicating whether or not
+ * {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since JDK1.1
@@ -971,8 +998,9 @@
}
/**
- * Enable/disable SO_LINGER with the specified linger time in seconds.
- * The maximum timeout value is platform specific.
+ * Enable/disable {@link SocketOptions#SO_LINGER SO_LINGER} with the
+ * specified linger time in seconds. The maximum timeout value is platform
+ * specific.
*
* The setting only affects socket close.
*
@@ -1000,7 +1028,8 @@
}
/**
- * Returns setting for SO_LINGER. -1 returns implies that the
+ * Returns setting for {@link SocketOptions#SO_LINGER SO_LINGER}.
+ * -1 returns implies that the
* option is disabled.
*
* The setting only affects socket close.
@@ -1040,7 +1069,8 @@
}
/**
- * Enable/disable OOBINLINE (receipt of TCP urgent data)
+ * Enable/disable {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE}
+ * (receipt of TCP urgent data)
*
* By default, this option is disabled and TCP urgent data received on a
* socket is silently discarded. If the user wishes to receive urgent data, then
@@ -1052,8 +1082,9 @@
* and there is no capability to distinguish between normal data and urgent
* data unless provided by a higher level protocol.
*
- * @param on <code>true</code> to enable OOBINLINE,
- * <code>false</code> to disable.
+ * @param on {@code true} to enable
+ * {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE},
+ * {@code false} to disable.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
@@ -1069,9 +1100,11 @@
}
/**
- * Tests if OOBINLINE is enabled.
+ * Tests if {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
- * @return a <code>boolean</code> indicating whether or not OOBINLINE is enabled.
+ * @return a {@code boolean} indicating whether or not
+ * {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE}is enabled.
+ *
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
@@ -1084,15 +1117,16 @@
}
/**
- * Enable/disable SO_TIMEOUT with the specified timeout, in
- * milliseconds. With this option set to a non-zero timeout,
- * a read() call on the InputStream associated with this Socket
- * will block for only this amount of time. If the timeout expires,
- * a <B>java.net.SocketTimeoutException</B> is raised, though the
+ * Enable/disable {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
+ * with the specified timeout, in milliseconds. With this option set
+ * to a non-zero timeout, a read() call on the InputStream associated with
+ * this Socket will block for only this amount of time. If the timeout
+ * expires, a <B>java.net.SocketTimeoutException</B> is raised, though the
* Socket is still valid. The option <B>must</B> be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
+ *
* @param timeout the specified timeout, in milliseconds.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
@@ -1109,11 +1143,13 @@
}
/**
- * Returns setting for SO_TIMEOUT. 0 returns implies that the
- * option is disabled (i.e., timeout of infinity).
- * @return the setting for SO_TIMEOUT
+ * Returns setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
+ * 0 returns implies that the option is disabled (i.e., timeout of infinity).
+ *
+ * @return the setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
+ *
* @since JDK1.1
* @see #setSoTimeout(int)
*/
@@ -1130,14 +1166,15 @@
}
/**
- * Sets the SO_SNDBUF option to the specified value for this
- * <tt>Socket</tt>. The SO_SNDBUF option is used by the platform's
- * networking code as a hint for the size to set
- * the underlying network I/O buffers.
+ * Sets the {@link SocketOptions#SO_SNDBUF SO_SNDBUF} option to the
+ * specified value for this {@code Socket}.
+ * The {@link SocketOptions#SO_SNDBUF SO_SNDBUF} option is used by the
+ * platform's networking code as a hint for the size to set the underlying
+ * network I/O buffers.
*
- * <p>Because SO_SNDBUF is a hint, applications that want to
- * verify what size the buffers were set to should call
- * {@link #getSendBufferSize()}.
+ * <p>Because {@link SocketOptions#SO_SNDBUF SO_SNDBUF} is a hint,
+ * applications that want to verify what size the buffers were set to
+ * should call {@link #getSendBufferSize()}.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
@@ -1162,10 +1199,11 @@
}
/**
- * Get value of the SO_SNDBUF option for this <tt>Socket</tt>,
- * that is the buffer size used by the platform
- * for output on this <tt>Socket</tt>.
- * @return the value of the SO_SNDBUF option for this <tt>Socket</tt>.
+ * Get value of the {@link SocketOptions#SO_SNDBUF SO_SNDBUF} option
+ * for this {@code Socket}, that is the buffer size used by the platform
+ * for output on this {@code Socket}.
+ * @return the value of the {@link SocketOptions#SO_SNDBUF SO_SNDBUF}
+ * option for this {@code Socket}.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
@@ -1185,31 +1223,32 @@
}
/**
- * Sets the SO_RCVBUF option to the specified value for this
- * <tt>Socket</tt>. The SO_RCVBUF option is used by the platform's
- * networking code as a hint for the size to set
+ * Sets the {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option to the
+ * specified value for this {@code Socket}. The
+ * {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option is
+ * used by the platform's networking code as a hint for the size to set
* the underlying network I/O buffers.
*
* <p>Increasing the receive buffer size can increase the performance of
* network I/O for high-volume connection, while decreasing it can
* help reduce the backlog of incoming data.
*
- * <p>Because SO_RCVBUF is a hint, applications that want to
- * verify what size the buffers were set to should call
- * {@link #getReceiveBufferSize()}.
+ * <p>Because {@link SocketOptions#SO_RCVBUF SO_RCVBUF} is a hint,
+ * applications that want to verify what size the buffers were set to
+ * should call {@link #getReceiveBufferSize()}.
*
- * <p>The value of SO_RCVBUF is also used to set the TCP receive window
- * that is advertized 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 remote peer. There are two
- * cases to be aware of:<p>
+ * <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.
+ * 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
+ * remote peer. There are two cases to be aware of:
* <ol>
* <li>For sockets accepted from a ServerSocket, this must be done by calling
* {@link ServerSocket#setReceiveBufferSize(int)} before the ServerSocket
* is bound to a local address.<p></li>
* <li>For client sockets, setReceiveBufferSize() must be called before
- * connecting the socket to its remote peer.<p></li></ol>
+ * connecting the socket to its remote peer.</li></ol>
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
@@ -1234,11 +1273,12 @@
}
/**
- * Gets the value of the SO_RCVBUF option for this <tt>Socket</tt>,
- * that is the buffer size used by the platform for
- * input on this <tt>Socket</tt>.
+ * Gets the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option
+ * for this {@code Socket}, that is the buffer size used by the platform
+ * for input on this {@code Socket}.
*
- * @return the value of the SO_RCVBUF option for this <tt>Socket</tt>.
+ * @return the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF}
+ * option for this {@code Socket}.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
@@ -1257,9 +1297,9 @@
}
/**
- * Enable/disable SO_KEEPALIVE.
+ * Enable/disable {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE}.
*
- * @param on whether or not to have socket keep alive turned on.
+ * @param on whether or not to have socket keep alive turned on.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
@@ -1272,9 +1312,10 @@
}
/**
- * Tests if SO_KEEPALIVE is enabled.
+ * Tests if {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
*
- * @return a <code>boolean</code> indicating whether or not SO_KEEPALIVE is enabled.
+ * @return a {@code boolean} indicating whether or not
+ * {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
@@ -1292,15 +1333,15 @@
* As the underlying network implementation may ignore this
* value applications should consider it a hint.
*
- * <P> The tc <B>must</B> be in the range <code> 0 <= tc <=
- * 255</code> or an IllegalArgumentException will be thrown.
+ * <P> The tc <B>must</B> be in the range {@code 0 <= tc <=
+ * 255} or an IllegalArgumentException will be thrown.
* <p>Notes:
* <p>For Internet Protocol v4 the value consists of an
- * <code>integer</code>, the least significant 8 bits of which
+ * {@code integer}, the least significant 8 bits of which
* represent the value of the TOS octet in IP packets sent by
* the socket.
* RFC 1349 defines the TOS values as follows:
- * <p>
+ *
* <UL>
* <LI><CODE>IPTOS_LOWCOST (0x02)</CODE></LI>
* <LI><CODE>IPTOS_RELIABILITY (0x04)</CODE></LI>
@@ -1322,14 +1363,15 @@
* in the underlying platform. Applications should not assume that
* they can change the TOS field after the connection.
* <p>
- * For Internet Protocol v6 <code>tc</code> is the value that
+ * For Internet Protocol v6 {@code tc} is the value that
* would be placed into the sin6_flowinfo field of the IP header.
*
- * @param tc an <code>int</code> value for the bitset.
+ * @param tc an {@code int} value for the bitset.
* @throws SocketException if there is an error setting the
* traffic class or type-of-service
* @since 1.4
* @see #getTrafficClass
+ * @see SocketOptions#IP_TOS
*/
public void setTrafficClass(int tc) throws SocketException {
if (tc < 0 || tc > 255)
@@ -1354,39 +1396,41 @@
* traffic class or type-of-service value.
* @since 1.4
* @see #setTrafficClass(int)
+ * @see SocketOptions#IP_TOS
*/
public int getTrafficClass() throws SocketException {
return ((Integer) (getImpl().getOption(SocketOptions.IP_TOS))).intValue();
}
/**
- * Enable/disable the SO_REUSEADDR socket option.
+ * Enable/disable the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
+ * socket option.
* <p>
* When a TCP connection is closed the connection may remain
* in a timeout state for a period of time after the connection
- * is closed (typically known as the <tt>TIME_WAIT</tt> state
- * or <tt>2MSL</tt> wait state).
+ * is closed (typically known as the {@code TIME_WAIT} state
+ * or {@code 2MSL} wait state).
* For applications using a well known socket address or port
* it may not be possible to bind a socket to the required
- * <tt>SocketAddress</tt> if there is a connection in the
+ * {@code SocketAddress} if there is a connection in the
* timeout state involving the socket address or port.
* <p>
- * Enabling <tt>SO_REUSEADDR</tt> prior to binding the socket
- * using {@link #bind(SocketAddress)} allows the socket to be
- * bound even though a previous connection is in a timeout
+ * Enabling {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
+ * prior to binding the socket using {@link #bind(SocketAddress)} allows
+ * the socket to be bound even though a previous connection is in a timeout
* state.
* <p>
- * When a <tt>Socket</tt> is created the initial setting
- * of <tt>SO_REUSEADDR</tt> is disabled.
+ * When a {@code Socket} is created the initial setting
+ * of {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is disabled.
* <p>
- * The behaviour when <tt>SO_REUSEADDR</tt> is enabled or
- * disabled after a socket is bound (See {@link #isBound()})
+ * The behaviour when {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
+ * enabled or disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
* @exception SocketException if an error occurs enabling or
- * disabling the <tt>SO_RESUEADDR</tt> socket option,
- * or the socket is closed.
+ * disabling the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
+ * socket option, or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
@@ -1400,9 +1444,10 @@
}
/**
- * Tests if SO_REUSEADDR is enabled.
+ * Tests if {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
*
- * @return a <code>boolean</code> indicating whether or not SO_REUSEADDR is enabled.
+ * @return a {@code boolean} indicating whether or not
+ * {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
@@ -1451,8 +1496,9 @@
* Any data sent to the input stream side of the socket is acknowledged
* and then silently discarded.
* <p>
- * If you read from a socket input stream after invoking
- * shutdownInput() on the socket, the stream will return EOF.
+ * If you read from a socket input stream after invoking this method on the
+ * socket, the stream's {@code available} method will return 0, and its
+ * {@code read} methods will return {@code -1} (end of stream).
*
* @exception IOException if an I/O error occurs when shutting down this
* socket.
@@ -1506,7 +1552,7 @@
}
/**
- * Converts this socket to a <code>String</code>.
+ * Converts this socket to a {@code String}.
*
* @return a string representation of this socket.
*/
@@ -1526,7 +1572,7 @@
* Returns the connection state of the socket.
* <p>
* Note: Closing a socket doesn't clear its connection state, which means
- * this method will return <code>true</code> for a closed socket
+ * this method will return {@code true} for a closed socket
* (see {@link #isClosed()}) if it was successfuly connected prior
* to being closed.
*
@@ -1542,7 +1588,7 @@
* Returns the binding state of the socket.
* <p>
* Note: Closing a socket doesn't clear its binding state, which means
- * this method will return <code>true</code> for a closed socket
+ * this method will return {@code true} for a closed socket
* (see {@link #isClosed()}) if it was successfuly bound prior
* to being closed.
*
@@ -1600,13 +1646,13 @@
* application. The factory can be specified only once.
* <p>
* When an application creates a new client socket, the socket
- * implementation factory's <code>createSocketImpl</code> method is
+ * implementation factory's {@code createSocketImpl} method is
* called to create the actual socket implementation.
* <p>
- * Passing <code>null</code> to the method is a no-op unless the factory
+ * Passing {@code null} to the method is a no-op unless the factory
* was already set.
* <p>If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
@@ -1615,7 +1661,7 @@
* socket factory.
* @exception SocketException if the factory is already defined.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow the operation.
+ * {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
*/
@@ -1649,23 +1695,23 @@
* values represent a lower priority than positive values. If the
* application prefers short connection time over both low latency and high
* bandwidth, for example, then it could invoke this method with the values
- * <tt>(1, 0, 0)</tt>. If the application prefers high bandwidth above low
+ * {@code (1, 0, 0)}. If the application prefers high bandwidth above low
* latency, and low latency above short connection time, then it could
- * invoke this method with the values <tt>(0, 1, 2)</tt>.
+ * invoke this method with the values {@code (0, 1, 2)}.
*
* <p> Invoking this method after this socket has been connected
* will have no effect.
*
* @param connectionTime
- * An <tt>int</tt> expressing the relative importance of a short
+ * An {@code int} expressing the relative importance of a short
* connection time
*
* @param latency
- * An <tt>int</tt> expressing the relative importance of low
+ * An {@code int} expressing the relative importance of low
* latency
*
* @param bandwidth
- * An <tt>int</tt> expressing the relative importance of high
+ * An {@code int} expressing the relative importance of high
* bandwidth
*
* @since 1.5
diff --git a/ojluni/src/main/java/java/net/SocketAddress.java b/ojluni/src/main/java/java/net/SocketAddress.java
index 5cdd4a5..cfb014b 100755
--- a/ojluni/src/main/java/java/net/SocketAddress.java
+++ b/ojluni/src/main/java/java/net/SocketAddress.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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,4 +39,7 @@
* @since 1.4
*/
public abstract class SocketAddress implements java.io.Serializable {
+
+ static final long serialVersionUID = 5215720748342549866L;
+
}
diff --git a/ojluni/src/main/java/java/net/SocketException.java b/ojluni/src/main/java/java/net/SocketException.java
index 41933d9..286bc42 100755
--- a/ojluni/src/main/java/java/net/SocketException.java
+++ b/ojluni/src/main/java/java/net/SocketException.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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 @@
private static final long serialVersionUID = -5935874303556886934L;
/**
- * Constructs a new <code>SocketException</code> with the
+ * Constructs a new {@code SocketException} with the
* specified detail message.
*
* @param msg the detail message.
@@ -49,7 +49,7 @@
}
/**
- * Constructs a new <code>SocketException</code> with no detail message.
+ * Constructs a new {@code SocketException} with no detail message.
*/
public SocketException() {
}
diff --git a/ojluni/src/main/java/java/net/SocketImpl.java b/ojluni/src/main/java/java/net/SocketImpl.java
index d2123e2..eeacd64 100755
--- a/ojluni/src/main/java/java/net/SocketImpl.java
+++ b/ojluni/src/main/java/java/net/SocketImpl.java
@@ -32,7 +32,7 @@
import java.io.FileDescriptor;
/**
- * The abstract class <code>SocketImpl</code> is a common superclass
+ * The abstract class {@code SocketImpl} is a common superclass
* of all classes that actually implement sockets. It is used to
* create both client and server sockets.
* <p>
@@ -72,7 +72,7 @@
/**
* Creates either a stream or a datagram socket.
*
- * @param stream if <code>true</code>, create a stream socket;
+ * @param stream if {@code true}, create a stream socket;
* otherwise, create a datagram socket.
* @exception IOException if an I/O error occurs while creating the
* socket.
@@ -123,7 +123,7 @@
/**
* Sets the maximum queue length for incoming connection indications
- * (a request to connect) to the <code>count</code> argument. If a
+ * (a request to connect) to the {@code count} argument. If a
* connection indication arrives when the queue is full, the
* connection is refused.
*
@@ -217,9 +217,9 @@
}
/**
- * Returns the value of this socket's <code>fd</code> field.
+ * Returns the value of this socket's {@code fd} field.
*
- * @return the value of this socket's <code>fd</code> field.
+ * @return the value of this socket's {@code fd} field.
* @see java.net.SocketImpl#fd
*/
protected FileDescriptor getFileDescriptor() {
@@ -234,9 +234,9 @@
}
/**
- * Returns the value of this socket's <code>address</code> field.
+ * Returns the value of this socket's {@code address} field.
*
- * @return the value of this socket's <code>address</code> field.
+ * @return the value of this socket's {@code address} field.
* @see java.net.SocketImpl#address
*/
protected InetAddress getInetAddress() {
@@ -244,9 +244,9 @@
}
/**
- * Returns the value of this socket's <code>port</code> field.
+ * Returns the value of this socket's {@code port} field.
*
- * @return the value of this socket's <code>port</code> field.
+ * @return the value of this socket's {@code port} field.
* @see java.net.SocketImpl#port
*/
protected int getPort() {
@@ -277,9 +277,9 @@
protected abstract void sendUrgentData (int data) throws IOException;
/**
- * Returns the value of this socket's <code>localport</code> field.
+ * Returns the value of this socket's {@code localport} field.
*
- * @return the value of this socket's <code>localport</code> field.
+ * @return the value of this socket's {@code localport} field.
* @see java.net.SocketImpl#localport
*/
protected int getLocalPort() {
@@ -303,7 +303,7 @@
}
/**
- * Returns the address and port of this socket as a <code>String</code>.
+ * Returns the address and port of this socket as a {@code String}.
*
* @return a string representation of this socket.
*/
@@ -335,23 +335,23 @@
* values represent a lower priority than positive values. If the
* application prefers short connection time over both low latency and high
* bandwidth, for example, then it could invoke this method with the values
- * <tt>(1, 0, 0)</tt>. If the application prefers high bandwidth above low
+ * {@code (1, 0, 0)}. If the application prefers high bandwidth above low
* latency, and low latency above short connection time, then it could
- * invoke this method with the values <tt>(0, 1, 2)</tt>.
+ * invoke this method with the values {@code (0, 1, 2)}.
*
* By default, this method does nothing, unless it is overridden in a
* a sub-class.
*
* @param connectionTime
- * An <tt>int</tt> expressing the relative importance of a short
+ * An {@code int} expressing the relative importance of a short
* connection time
*
* @param latency
- * An <tt>int</tt> expressing the relative importance of low
+ * An {@code int} expressing the relative importance of low
* latency
*
* @param bandwidth
- * An <tt>int</tt> expressing the relative importance of high
+ * An {@code int} expressing the relative importance of high
* bandwidth
*
* @since 1.5
diff --git a/ojluni/src/main/java/java/net/SocketImplFactory.java b/ojluni/src/main/java/java/net/SocketImplFactory.java
index 52ab327..7aa6363 100755
--- a/ojluni/src/main/java/java/net/SocketImplFactory.java
+++ b/ojluni/src/main/java/java/net/SocketImplFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -27,8 +27,8 @@
/**
* This interface defines a factory for socket implementations. It
- * is used by the classes <code>Socket</code> and
- * <code>ServerSocket</code> to create actual socket
+ * is used by the classes {@code Socket} and
+ * {@code ServerSocket} to create actual socket
* implementations.
*
* @author Arthur van Hoff
@@ -39,9 +39,9 @@
public
interface SocketImplFactory {
/**
- * Creates a new <code>SocketImpl</code> instance.
+ * Creates a new {@code SocketImpl} instance.
*
- * @return a new instance of <code>SocketImpl</code>.
+ * @return a new instance of {@code SocketImpl}.
* @see java.net.SocketImpl
*/
SocketImpl createSocketImpl();
diff --git a/ojluni/src/main/java/java/net/SocketInputStream.java b/ojluni/src/main/java/java/net/SocketInputStream.java
index 9082fa8..ea849a0 100755
--- a/ojluni/src/main/java/java/net/SocketInputStream.java
+++ b/ojluni/src/main/java/java/net/SocketInputStream.java
@@ -66,8 +66,8 @@
* Returns the unique {@link java.nio.channels.FileChannel FileChannel}
* object associated with this file input stream.</p>
*
- * The <code>getChannel</code> method of <code>SocketInputStream</code>
- * returns <code>null</code> since it is a socket based stream.</p>
+ * The {@code getChannel} method of {@code SocketInputStream}
+ * returns {@code null} since it is a socket based stream.</p>
*
* @return the file channel associated with this file input stream
*
diff --git a/ojluni/src/main/java/java/net/SocketOption.java b/ojluni/src/main/java/java/net/SocketOption.java
index d3c5972..2ccf57f 100755
--- a/ojluni/src/main/java/java/net/SocketOption.java
+++ b/ojluni/src/main/java/java/net/SocketOption.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, 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
@@ -45,11 +45,15 @@
/**
* Returns the name of the socket option.
+ *
+ * @return the name of the socket option
*/
String name();
/**
* Returns the type of the socket option value.
+ *
+ * @return the type of the socket option value
*/
Class<T> type();
}
diff --git a/ojluni/src/main/java/java/net/SocketOptions.java b/ojluni/src/main/java/java/net/SocketOptions.java
index e57e8ab..7e1b0fc 100755
--- a/ojluni/src/main/java/java/net/SocketOptions.java
+++ b/ojluni/src/main/java/java/net/SocketOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -25,6 +25,8 @@
package java.net;
+import java.lang.annotation.Native;
+
/**
* Interface of methods to get/set socket options. This interface is
* implemented by: <B>SocketImpl</B> and <B>DatagramSocketImpl</B>.
@@ -113,7 +115,7 @@
* }
* </PRE>
*
- * @param optID an <code>int</code> identifying the option to fetch
+ * @param optID an {@code int} identifying the option to fetch
* @return the value of the option
* @throws SocketException if the socket is closed
* @throws SocketException if <I>optID</I> is unknown along the
@@ -132,12 +134,12 @@
* previously written data.
*<P>
* Valid for TCP only: SocketImpl.
- * <P>
+ *
* @see Socket#setTcpNoDelay
* @see Socket#getTcpNoDelay
*/
- public final static int TCP_NODELAY = 0x0001;
+ @Native public final static int TCP_NODELAY = 0x0001;
/**
* Fetch the local address binding of a socket (this option cannot
@@ -153,12 +155,12 @@
* This option <B>must</B> be specified in the constructor.
* <P>
* Valid for: SocketImpl, DatagramSocketImpl
- * <P>
+ *
* @see Socket#getLocalAddress
* @see DatagramSocket#getLocalAddress
*/
- public final static int SO_BINDADDR = 0x000F;
+ @Native public final static int SO_BINDADDR = 0x000F;
/** Sets SO_REUSEADDR for a socket. This is used only for MulticastSockets
* in java, and it is set by default for MulticastSockets.
@@ -166,7 +168,7 @@
* Valid for: DatagramSocketImpl
*/
- public final static int SO_REUSEADDR = 0x04;
+ @Native public final static int SO_REUSEADDR = 0x04;
/**
* Sets SO_BROADCAST for a socket. This option enables and disables
@@ -177,19 +179,19 @@
* @since 1.4
*/
- public final static int SO_BROADCAST = 0x0020;
+ @Native public final static int SO_BROADCAST = 0x0020;
/** Set which outgoing interface on which to send multicast packets.
* Useful on hosts with multiple network interfaces, where applications
* want to use other than the system default. Takes/returns an InetAddress.
* <P>
* Valid for Multicast: DatagramSocketImpl
- * <P>
+ *
* @see MulticastSocket#setInterface(InetAddress)
* @see MulticastSocket#getInterface()
*/
- public final static int IP_MULTICAST_IF = 0x10;
+ @Native public final static int IP_MULTICAST_IF = 0x10;
/** Same as above. This option is introduced so that the behaviour
* with IP_MULTICAST_IF will be kept the same as before, while
@@ -201,7 +203,7 @@
* @see MulticastSocket#getNetworkInterface()
* @since 1.4
*/
- public final static int IP_MULTICAST_IF2 = 0x1f;
+ @Native public final static int IP_MULTICAST_IF2 = 0x1f;
/**
* This option enables or disables local loopback of multicast datagrams.
@@ -209,7 +211,7 @@
* @since 1.4
*/
- public final static int IP_MULTICAST_LOOP = 0x12;
+ @Native public final static int IP_MULTICAST_LOOP = 0x12;
/**
* This option sets the type-of-service or traffic class field
@@ -217,7 +219,7 @@
* @since 1.4
*/
- public final static int IP_TOS = 0x3;
+ @Native public final static int IP_TOS = 0x3;
/**
* Specify a linger-on-close timeout. This option disables/enables
@@ -235,7 +237,7 @@
* @see Socket#setSoLinger
* @see Socket#getSoLinger
*/
- public final static int SO_LINGER = 0x0080;
+ @Native public final static int SO_LINGER = 0x0080;
/** Set a timeout on blocking Socket operations:
* <PRE>
@@ -256,7 +258,7 @@
* @see ServerSocket#setSoTimeout
* @see DatagramSocket#setSoTimeout
*/
- public final static int SO_TIMEOUT = 0x1006;
+ @Native public final static int SO_TIMEOUT = 0x1006;
/**
* Set a hint the size of the underlying buffers used by the
@@ -273,7 +275,7 @@
* @see DatagramSocket#setSendBufferSize
* @see DatagramSocket#getSendBufferSize
*/
- public final static int SO_SNDBUF = 0x1001;
+ @Native public final static int SO_SNDBUF = 0x1001;
/**
* Set a hint the size of the underlying buffers used by the
@@ -291,7 +293,7 @@
* @see DatagramSocket#setReceiveBufferSize
* @see DatagramSocket#getReceiveBufferSize
*/
- public final static int SO_RCVBUF = 0x1002;
+ @Native public final static int SO_RCVBUF = 0x1002;
/**
* When the keepalive option is set for a TCP socket and no data
@@ -314,7 +316,7 @@
* @see Socket#setKeepAlive
* @see Socket#getKeepAlive
*/
- public final static int SO_KEEPALIVE = 0x0008;
+ @Native public final static int SO_KEEPALIVE = 0x0008;
/**
* When the OOBINLINE option is set, any TCP urgent data received on
@@ -325,5 +327,5 @@
* @see Socket#setOOBInline
* @see Socket#getOOBInline
*/
- public final static int SO_OOBINLINE = 0x1003;
+ @Native public final static int SO_OOBINLINE = 0x1003;
}
diff --git a/ojluni/src/main/java/java/net/SocketOutputStream.java b/ojluni/src/main/java/java/net/SocketOutputStream.java
index f18545d..fff612f 100755
--- a/ojluni/src/main/java/java/net/SocketOutputStream.java
+++ b/ojluni/src/main/java/java/net/SocketOutputStream.java
@@ -64,8 +64,8 @@
* Returns the unique {@link java.nio.channels.FileChannel FileChannel}
* object associated with this file output stream. </p>
*
- * The <code>getChannel</code> method of <code>SocketOutputStream</code>
- * returns <code>null</code> since it is a socket based stream.</p>
+ * The {@code getChannel} method of {@code SocketOutputStream}
+ * returns {@code null} since it is a socket based stream.</p>
*
* @return the file channel associated with this file output stream
*
diff --git a/ojluni/src/main/java/java/net/SocketPermission.java b/ojluni/src/main/java/java/net/SocketPermission.java
index bb19d0e..cdd9f15 100755
--- a/ojluni/src/main/java/java/net/SocketPermission.java
+++ b/ojluni/src/main/java/java/net/SocketPermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
diff --git a/ojluni/src/main/java/java/net/SocksSocketImpl.java b/ojluni/src/main/java/java/net/SocksSocketImpl.java
index d7bc1c1..7905a7d 100755
--- a/ojluni/src/main/java/java/net/SocksSocketImpl.java
+++ b/ojluni/src/main/java/java/net/SocksSocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -315,7 +315,7 @@
* grants the connections, then the connect is successful and all
* further traffic will go to the "real" endpoint.
*
- * @param endpoint the <code>SocketAddress</code> to connect to.
+ * @param endpoint the {@code SocketAddress} to connect to.
* @param timeout the timeout value in milliseconds
* @throws IOException if the connection can't be established.
* @throws SecurityException if there is a security manager and it
@@ -841,9 +841,9 @@
}
/**
- * Returns the value of this socket's <code>address</code> field.
+ * Returns the value of this socket's {@code address} field.
*
- * @return the value of this socket's <code>address</code> field.
+ * @return the value of this socket's {@code address} field.
* @see java.net.SocketImpl#address
*/
@Override
@@ -855,9 +855,9 @@
}
/**
- * Returns the value of this socket's <code>port</code> field.
+ * Returns the value of this socket's {@code port} field.
*
- * @return the value of this socket's <code>port</code> field.
+ * @return the value of this socket's {@code port} field.
* @see java.net.SocketImpl#port
*/
@Override
diff --git a/ojluni/src/main/java/java/net/StandardSocketOptions.java b/ojluni/src/main/java/java/net/StandardSocketOptions.java
index 51d96b7..7fdd5f0 100755
--- a/ojluni/src/main/java/java/net/StandardSocketOptions.java
+++ b/ojluni/src/main/java/java/net/StandardSocketOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, 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
@@ -257,7 +257,7 @@
* represents the outgoing interface for multicast datagrams sent by the
* datagram-oriented socket. For {@link StandardProtocolFamily#INET6 IPv6}
* sockets then it is system dependent whether setting this option also
- * sets the outgoing interface for multlicast datagrams sent to IPv4
+ * sets the outgoing interface for multicast datagrams sent to IPv4
* addresses.
*
* <p> The initial/default value of this socket option may be {@code null}
@@ -267,6 +267,7 @@
* the socket option can be queried or changed prior to binding the socket
* is system dependent.
*
+ * @see java.nio.channels.MulticastChannel
* @see MulticastSocket#setInterface
*/
public static final SocketOption<NetworkInterface> IP_MULTICAST_IF =
@@ -276,8 +277,8 @@
* The <em>time-to-live</em> for Internet Protocol (IP) multicast datagrams.
*
* <p> The value of this socket option is an {@code Integer} in the range
- * <tt>0 <= value <= 255</tt>. It is used to control
- * the scope of multicast datagrams sent by the datagram-oriented socket.
+ * {@code 0 <= value <= 255}. It is used to control the scope of multicast
+ * datagrams sent by the datagram-oriented socket.
* In the case of an {@link StandardProtocolFamily#INET IPv4} socket
* the option is the time-to-live (TTL) on multicast datagrams sent by the
* socket. Datagrams with a TTL of zero are not transmitted on the network
@@ -293,6 +294,7 @@
* the socket is bound. Whether the socket option can be queried or changed
* prior to binding the socket is system dependent.
*
+ * @see java.nio.channels.MulticastChannel
* @see MulticastSocket#setTimeToLive
*/
public static final SocketOption<Integer> IP_MULTICAST_TTL =
@@ -317,6 +319,7 @@
* bound. Whether the socket option can be queried or changed prior to
* binding the socket is system dependent.
*
+ * @see java.nio.channels.MulticastChannel
* @see MulticastSocket#setLoopbackMode
*/
public static final SocketOption<Boolean> IP_MULTICAST_LOOP =
diff --git a/ojluni/src/main/java/java/net/URI.java b/ojluni/src/main/java/java/net/URI.java
index 5a78d6e..a49eeaf 100755
--- a/ojluni/src/main/java/java/net/URI.java
+++ b/ojluni/src/main/java/java/net/URI.java
@@ -61,30 +61,30 @@
* and relativizing URI instances. Instances of this class are immutable.
*
*
- * <h4> URI syntax and components </h4>
+ * <h3> URI syntax and components </h3>
*
* At the highest level a URI reference (hereinafter simply "URI") in string
* form has the syntax
*
* <blockquote>
- * [<i>scheme</i><tt><b>:</b></tt><i></i>]<i>scheme-specific-part</i>[<tt><b>#</b></tt><i>fragment</i>]
+ * [<i>scheme</i><b>{@code :}</b>]<i>scheme-specific-part</i>[<b>{@code #}</b><i>fragment</i>]
* </blockquote>
*
* where square brackets [...] delineate optional components and the characters
- * <tt><b>:</b></tt> and <tt><b>#</b></tt> stand for themselves.
+ * <b>{@code :}</b> and <b>{@code #}</b> stand for themselves.
*
* <p> An <i>absolute</i> URI specifies a scheme; a URI that is not absolute is
* said to be <i>relative</i>. URIs are also classified according to whether
* they are <i>opaque</i> or <i>hierarchical</i>.
*
* <p> An <i>opaque</i> URI is an absolute URI whose scheme-specific part does
- * not begin with a slash character (<tt>'/'</tt>). Opaque URIs are not
+ * not begin with a slash character ({@code '/'}). Opaque URIs are not
* subject to further parsing. Some examples of opaque URIs are:
*
* <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td><tt>mailto:java-net@java.sun.com</tt><td></tr>
- * <tr><td><tt>news:comp.lang.java</tt><td></tr>
- * <tr><td><tt>urn:isbn:096139210x</tt></td></tr>
+ * <tr><td>{@code mailto:java-net@java.sun.com}<td></tr>
+ * <tr><td>{@code news:comp.lang.java}<td></tr>
+ * <tr><td>{@code urn:isbn:096139210x}</td></tr>
* </table></blockquote>
*
* <p> A <i>hierarchical</i> URI is either an absolute URI whose
@@ -93,20 +93,20 @@
* URIs are:
*
* <blockquote>
- * <tt>http://java.sun.com/j2se/1.3/</tt><br>
- * <tt>docs/guide/collections/designfaq.html#28</tt><br>
- * <tt>../../../demo/jfc/SwingSet2/src/SwingSet2.java</tt><br>
- * <tt>file:///~/calendar</tt>
+ * {@code http://java.sun.com/j2se/1.3/}<br>
+ * {@code docs/guide/collections/designfaq.html#28}<br>
+ * {@code ../../../demo/jfc/SwingSet2/src/SwingSet2.java}<br>
+ * {@code file:///~/calendar}
* </blockquote>
*
* <p> A hierarchical URI is subject to further parsing according to the syntax
*
* <blockquote>
- * [<i>scheme</i><tt><b>:</b></tt>][<tt><b>//</b></tt><i>authority</i>][<i>path</i>][<tt><b>?</b></tt><i>query</i>][<tt><b>#</b></tt><i>fragment</i>]
+ * [<i>scheme</i><b>{@code :}</b>][<b>{@code //}</b><i>authority</i>][<i>path</i>][<b>{@code ?}</b><i>query</i>][<b>{@code #}</b><i>fragment</i>]
* </blockquote>
*
- * where the characters <tt><b>:</b></tt>, <tt><b>/</b></tt>,
- * <tt><b>?</b></tt>, and <tt><b>#</b></tt> stand for themselves. The
+ * where the characters <b>{@code :}</b>, <b>{@code /}</b>,
+ * <b>{@code ?}</b>, and <b>{@code #}</b> stand for themselves. The
* scheme-specific part of a hierarchical URI consists of the characters
* between the scheme and fragment components.
*
@@ -115,16 +115,16 @@
* parses according to the familiar syntax
*
* <blockquote>
- * [<i>user-info</i><tt><b>@</b></tt>]<i>host</i>[<tt><b>:</b></tt><i>port</i>]
+ * [<i>user-info</i><b>{@code @}</b>]<i>host</i>[<b>{@code :}</b><i>port</i>]
* </blockquote>
*
- * where the characters <tt><b>@</b></tt> and <tt><b>:</b></tt> stand for
+ * where the characters <b>{@code @}</b> and <b>{@code :}</b> stand for
* themselves. Nearly all URI schemes currently in use are server-based. An
* authority component that does not parse in this way is considered to be
* registry-based.
*
* <p> The path component of a hierarchical URI is itself said to be absolute
- * if it begins with a slash character (<tt>'/'</tt>); otherwise it is
+ * if it begins with a slash character ({@code '/'}); otherwise it is
* relative. The path of a hierarchical URI that is either absolute or
* specifies an authority is always absolute.
*
@@ -132,21 +132,21 @@
*
* <blockquote><table summary="Describes the components of a URI:scheme,scheme-specific-part,authority,user-info,host,port,path,query,fragment">
* <tr><th><i>Component</i></th><th><i>Type</i></th></tr>
- * <tr><td>scheme</td><td><tt>String</tt></td></tr>
- * <tr><td>scheme-specific-part </td><td><tt>String</tt></td></tr>
- * <tr><td>authority</td><td><tt>String</tt></td></tr>
- * <tr><td>user-info</td><td><tt>String</tt></td></tr>
- * <tr><td>host</td><td><tt>String</tt></td></tr>
- * <tr><td>port</td><td><tt>int</tt></td></tr>
- * <tr><td>path</td><td><tt>String</tt></td></tr>
- * <tr><td>query</td><td><tt>String</tt></td></tr>
- * <tr><td>fragment</td><td><tt>String</tt></td></tr>
+ * <tr><td>scheme</td><td>{@code String}</td></tr>
+ * <tr><td>scheme-specific-part </td><td>{@code String}</td></tr>
+ * <tr><td>authority</td><td>{@code String}</td></tr>
+ * <tr><td>user-info</td><td>{@code String}</td></tr>
+ * <tr><td>host</td><td>{@code String}</td></tr>
+ * <tr><td>port</td><td>{@code int}</td></tr>
+ * <tr><td>path</td><td>{@code String}</td></tr>
+ * <tr><td>query</td><td>{@code String}</td></tr>
+ * <tr><td>fragment</td><td>{@code String}</td></tr>
* </table></blockquote>
*
* In a given instance any particular component is either <i>undefined</i> or
* <i>defined</i> with a distinct value. Undefined string components are
- * represented by <tt>null</tt>, while undefined integer components are
- * represented by <tt>-1</tt>. A string component may be defined to have the
+ * represented by {@code null}, while undefined integer components are
+ * represented by {@code -1}. A string component may be defined to have the
* empty string as its value; this is not equivalent to that component being
* undefined.
*
@@ -165,10 +165,10 @@
* The key operations supported by this class are those of
* <i>normalization</i>, <i>resolution</i>, and <i>relativization</i>.
*
- * <p> <i>Normalization</i> is the process of removing unnecessary <tt>"."</tt>
- * and <tt>".."</tt> segments from the path component of a hierarchical URI.
- * Each <tt>"."</tt> segment is simply removed. A <tt>".."</tt> segment is
- * removed only if it is preceded by a non-<tt>".."</tt> segment.
+ * <p> <i>Normalization</i> is the process of removing unnecessary {@code "."}
+ * and {@code ".."} segments from the path component of a hierarchical URI.
+ * Each {@code "."} segment is simply removed. A {@code ".."} segment is
+ * removed only if it is preceded by a non-{@code ".."} segment.
* Normalization has no effect upon opaque URIs.
*
* <p> <i>Resolution</i> is the process of resolving one URI against another,
@@ -179,45 +179,47 @@
* normalized. The result, for example, of resolving
*
* <blockquote>
- * <tt>docs/guide/collections/designfaq.html#28 </tt>(1)
+ * {@code docs/guide/collections/designfaq.html#28}
+ *
+ * (1)
* </blockquote>
*
- * against the base URI <tt>http://java.sun.com/j2se/1.3/</tt> is the result
+ * against the base URI {@code http://java.sun.com/j2se/1.3/} is the result
* URI
*
* <blockquote>
- * <tt>http://java.sun.com/j2se/1.3/docs/guide/collections/designfaq.html#28</tt>
+ * {@code http://java.sun.com/j2se/1.3/docs/guide/collections/designfaq.html#28}
* </blockquote>
*
* Resolving the relative URI
*
* <blockquote>
- * <tt>../../../demo/jfc/SwingSet2/src/SwingSet2.java </tt>(2)
+ * {@code ../../../demo/jfc/SwingSet2/src/SwingSet2.java }(2)
* </blockquote>
*
* against this result yields, in turn,
*
* <blockquote>
- * <tt>http://java.sun.com/j2se/1.3/demo/jfc/SwingSet2/src/SwingSet2.java</tt>
+ * {@code http://java.sun.com/j2se/1.3/demo/jfc/SwingSet2/src/SwingSet2.java}
* </blockquote>
*
* Resolution of both absolute and relative URIs, and of both absolute and
* relative paths in the case of hierarchical URIs, is supported. Resolving
- * the URI <tt>file:///~calendar</tt> against any other URI simply yields the
+ * the URI {@code file:///~calendar} against any other URI simply yields the
* original URI, since it is absolute. Resolving the relative URI (2) above
* against the relative base URI (1) yields the normalized, but still relative,
* URI
*
* <blockquote>
- * <tt>demo/jfc/SwingSet2/src/SwingSet2.java</tt>
+ * {@code demo/jfc/SwingSet2/src/SwingSet2.java}
* </blockquote>
*
* <p> <i>Relativization</i>, finally, is the inverse of resolution: For any
* two normalized URIs <i>u</i> and <i>v</i>,
*
* <blockquote>
- * <i>u</i><tt>.relativize(</tt><i>u</i><tt>.resolve(</tt><i>v</i><tt>)).equals(</tt><i>v</i><tt>)</tt> and<br>
- * <i>u</i><tt>.resolve(</tt><i>u</i><tt>.relativize(</tt><i>v</i><tt>)).equals(</tt><i>v</i><tt>)</tt> .<br>
+ * <i>u</i>{@code .relativize(}<i>u</i>{@code .resolve(}<i>v</i>{@code )).equals(}<i>v</i>{@code )} and<br>
+ * <i>u</i>{@code .resolve(}<i>u</i>{@code .relativize(}<i>v</i>{@code )).equals(}<i>v</i>{@code )} .<br>
* </blockquote>
*
* This operation is often useful when constructing a document containing URIs
@@ -225,16 +227,16 @@
* possible. For example, relativizing the URI
*
* <blockquote>
- * <tt>http://java.sun.com/j2se/1.3/docs/guide/index.html</tt>
+ * {@code http://java.sun.com/j2se/1.3/docs/guide/index.html}
* </blockquote>
*
* against the base URI
*
* <blockquote>
- * <tt>http://java.sun.com/j2se/1.3</tt>
+ * {@code http://java.sun.com/j2se/1.3}
* </blockquote>
*
- * yields the relative URI <tt>docs/guide/index.html</tt>.
+ * yields the relative URI {@code docs/guide/index.html}.
*
*
* <h4> Character categories </h4>
@@ -247,26 +249,26 @@
* <blockquote><table cellspacing=2 summary="Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other">
* <tr><th valign=top><i>alpha</i></th>
* <td>The US-ASCII alphabetic characters,
- * <tt>'A'</tt> through <tt>'Z'</tt>
- * and <tt>'a'</tt> through <tt>'z'</tt></td></tr>
+ * {@code 'A'} through {@code 'Z'}
+ * and {@code 'a'} through {@code 'z'}</td></tr>
* <tr><th valign=top><i>digit</i></th>
* <td>The US-ASCII decimal digit characters,
- * <tt>'0'</tt> through <tt>'9'</tt></td></tr>
+ * {@code '0'} through {@code '9'}</td></tr>
* <tr><th valign=top><i>alphanum</i></th>
* <td>All <i>alpha</i> and <i>digit</i> characters</td></tr>
* <tr><th valign=top><i>unreserved</i> </th>
* <td>All <i>alphanum</i> characters together with those in the string
- * <tt>"_-!.~'()*"</tt></td></tr>
+ * {@code "_-!.~'()*"}</td></tr>
* <tr><th valign=top><i>punct</i></th>
- * <td>The characters in the string <tt>",;:$&+="</tt></td></tr>
+ * <td>The characters in the string {@code ",;:$&+="}</td></tr>
* <tr><th valign=top><i>reserved</i></th>
* <td>All <i>punct</i> characters together with those in the string
- * <tt>"?/[]@"</tt></td></tr>
+ * {@code "?/[]@"}</td></tr>
* <tr><th valign=top><i>escaped</i></th>
* <td>Escaped octets, that is, triplets consisting of the percent
- * character (<tt>'%'</tt>) followed by two hexadecimal digits
- * (<tt>'0'</tt>-<tt>'9'</tt>, <tt>'A'</tt>-<tt>'F'</tt>, and
- * <tt>'a'</tt>-<tt>'f'</tt>)</td></tr>
+ * character ({@code '%'}) followed by two hexadecimal digits
+ * ({@code '0'}-{@code '9'}, {@code 'A'}-{@code 'F'}, and
+ * {@code 'a'}-{@code 'f'})</td></tr>
* <tr><th valign=top><i>other</i></th>
* <td>The Unicode characters that are not in the US-ASCII character set,
* are not control characters (according to the {@link
@@ -306,14 +308,14 @@
*
* <li><p><a name="encode"></a> A character is <i>encoded</i> by replacing it
* with the sequence of escaped octets that represent that character in the
- * UTF-8 character set. The Euro currency symbol (<tt>'\u20AC'</tt>),
- * for example, is encoded as <tt>"%E2%82%AC"</tt>. <i>(<b>Deviation from
+ * UTF-8 character set. The Euro currency symbol ({@code '\u20AC'}),
+ * for example, is encoded as {@code "%E2%82%AC"}. <i>(<b>Deviation from
* RFC 2396</b>, which does not specify any particular character
* set.)</i> </p></li>
*
* <li><p><a name="quote"></a> An illegal character is <i>quoted</i> simply by
* encoding it. The space character, for example, is quoted by replacing it
- * with <tt>"%20"</tt>. UTF-8 contains US-ASCII, hence for US-ASCII
+ * with {@code "%20"}. UTF-8 contains US-ASCII, hence for US-ASCII
* characters this transformation has exactly the effect required by
* RFC 2396. </p></li>
*
@@ -325,7 +327,7 @@
* decoding any encoded non-US-ASCII characters. If a <a
* href="../nio/charset/CharsetDecoder.html#ce">decoding error</a> occurs
* when decoding the escaped octets then the erroneous octets are replaced by
- * <tt>'\uFFFD'</tt>, the Unicode replacement character. </p></li>
+ * {@code '\uFFFD'}, the Unicode replacement character. </p></li>
*
* </ul>
*
@@ -334,16 +336,16 @@
*
* <ul>
*
- * <li><p> The {@link #URI(java.lang.String) <code>single-argument
- * constructor</code>} requires any illegal characters in its argument to be
+ * <li><p> The {@linkplain #URI(java.lang.String) single-argument
+ * constructor} requires any illegal characters in its argument to be
* quoted and preserves any escaped octets and <i>other</i> characters that
* are present. </p></li>
*
- * <li><p> The {@link
+ * <li><p> The {@linkplain
* #URI(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String)
- * <code>multi-argument constructors</code>} quote illegal characters as
+ * multi-argument constructors} quote illegal characters as
* required by the components in which they appear. The percent character
- * (<tt>'%'</tt>) is always quoted by these constructors. Any <i>other</i>
+ * ({@code '%'}) is always quoted by these constructors. Any <i>other</i>
* characters are preserved. </p></li>
*
* <li><p> The {@link #getRawUserInfo() getRawUserInfo}, {@link #getRawPath()
@@ -379,42 +381,33 @@
* For any URI <i>u</i>, it is always the case that
*
* <blockquote>
- * <tt>new URI(</tt><i>u</i><tt>.toString()).equals(</tt><i>u</i><tt>)</tt> .
+ * {@code new URI(}<i>u</i>{@code .toString()).equals(}<i>u</i>{@code )} .
* </blockquote>
*
* For any URI <i>u</i> that does not contain redundant syntax such as two
- * slashes before an empty authority (as in <tt>file:///tmp/</tt> ) or a
+ * slashes before an empty authority (as in {@code file:///tmp/} ) or a
* colon following a host name but no port (as in
- * <tt>http://java.sun.com:</tt> ), and that does not encode characters
+ * {@code http://java.sun.com:} ), and that does not encode characters
* except those that must be quoted, the following identities also hold:
- *
- * <blockquote>
- * <tt>new URI(</tt><i>u</i><tt>.getScheme(),<br>
- * </tt><i>u</i><tt>.getSchemeSpecificPart(),<br>
- * </tt><i>u</i><tt>.getFragment())<br>
- * .equals(</tt><i>u</i><tt>)</tt>
- * </blockquote>
- *
+ * <pre>
+ * new URI(<i>u</i>.getScheme(),
+ * <i>u</i>.getSchemeSpecificPart(),
+ * <i>u</i>.getFragment())
+ * .equals(<i>u</i>)</pre>
* in all cases,
- *
- * <blockquote>
- * <tt>new URI(</tt><i>u</i><tt>.getScheme(),<br>
- * </tt><i>u</i><tt>.getUserInfo(), </tt><i>u</i><tt>.getAuthority(),<br>
- * </tt><i>u</i><tt>.getPath(), </tt><i>u</i><tt>.getQuery(),<br>
- * </tt><i>u</i><tt>.getFragment())<br>
- * .equals(</tt><i>u</i><tt>)</tt>
- * </blockquote>
- *
+ * <pre>
+ * new URI(<i>u</i>.getScheme(),
+ * <i>u</i>.getUserInfo(), <i>u</i>.getAuthority(),
+ * <i>u</i>.getPath(), <i>u</i>.getQuery(),
+ * <i>u</i>.getFragment())
+ * .equals(<i>u</i>)</pre>
* if <i>u</i> is hierarchical, and
- *
- * <blockquote>
- * <tt>new URI(</tt><i>u</i><tt>.getScheme(),<br>
- * </tt><i>u</i><tt>.getUserInfo(), </tt><i>u</i><tt>.getHost(), </tt><i>u</i><tt>.getPort(),<br>
- * </tt><i>u</i><tt>.getPath(), </tt><i>u</i><tt>.getQuery(),<br>
- * </tt><i>u</i><tt>.getFragment())<br>
- * .equals(</tt><i>u</i><tt>)</tt>
- * </blockquote>
- *
+ * <pre>
+ * new URI(<i>u</i>.getScheme(),
+ * <i>u</i>.getUserInfo(), <i>u</i>.getHost(), <i>u</i>.getPort(),
+ * <i>u</i>.getPath(), <i>u</i>.getQuery(),
+ * <i>u</i>.getFragment())
+ * .equals(<i>u</i>)</pre>
* if <i>u</i> is hierarchical and has either no authority or a server-based
* authority.
*
@@ -425,8 +418,8 @@
* resource <i>locator</i>. Hence every URL is a URI, abstractly speaking, but
* not every URI is a URL. This is because there is another subcategory of
* URIs, uniform resource <i>names</i> (URNs), which name resources but do not
- * specify how to locate them. The <tt>mailto</tt>, <tt>news</tt>, and
- * <tt>isbn</tt> URIs shown above are examples of URNs.
+ * specify how to locate them. The {@code mailto}, {@code news}, and
+ * {@code isbn} URIs shown above are examples of URNs.
*
* <p> The conceptual distinction between URIs and URLs is reflected in the
* differences between this class and the {@link URL} class.
@@ -466,6 +459,7 @@
public final class URI
implements Comparable<URI>, Serializable
{
+
// Note: Comments containing the word "ASSERT" indicate places where a
// throw of an InternalError should be replaced by an appropriate assertion
// statement once asserts are enabled in the build.
@@ -524,12 +518,12 @@
* href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>,
* Appendix A, <b><i>except for the following deviations:</i></b> </p>
*
- * <ul type=disc>
+ * <ul>
*
* <li><p> An empty authority component is permitted as long as it is
* followed by a non-empty path, a query component, or a fragment
* component. This allows the parsing of URIs such as
- * <tt>"file:///foo/bar"</tt>, which seems to be the intent of
+ * {@code "file:///foo/bar"}, which seems to be the intent of
* RFC 2396 although the grammar does not permit it. If the
* authority component is empty then the user-information, host, and port
* components are undefined. </p></li>
@@ -537,7 +531,7 @@
* <li><p> Empty relative paths are permitted; this seems to be the
* intent of RFC 2396 although the grammar does not permit it. The
* primary consequence of this deviation is that a standalone fragment
- * such as <tt>"#foo"</tt> parses as a relative URI with an empty path
+ * such as {@code "#foo"} parses as a relative URI with an empty path
* and the given fragment, and can be usefully <a
* href="#resolve-frag">resolved</a> against a base URI.
*
@@ -554,12 +548,12 @@
* href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>
* section 3.2.2 although the grammar does not permit it. The
* consequence of this deviation is that the authority component of a
- * hierarchical URI such as <tt>s://123</tt>, will parse as a server-based
+ * hierarchical URI such as {@code s://123}, will parse as a server-based
* authority. </p></li>
*
* <li><p> IPv6 addresses are permitted for the host component. An IPv6
- * address must be enclosed in square brackets (<tt>'['</tt> and
- * <tt>']'</tt>) as specified by <a
+ * address must be enclosed in square brackets ({@code '['} and
+ * {@code ']'}) as specified by <a
* href="http://www.ietf.org/rfc/rfc2732.txt">RFC 2732</a>. The
* IPv6 address itself must parse according to <a
* href="http://www.ietf.org/rfc/rfc2373.txt">RFC 2373</a>. IPv6
@@ -579,7 +573,7 @@
* @param str The string to be parsed into a URI
*
* @throws NullPointerException
- * If <tt>str</tt> is <tt>null</tt>
+ * If {@code str} is {@code null}
*
* @throws URISyntaxException
* If the given string violates RFC 2396, as augmented
@@ -593,10 +587,10 @@
* Constructs a hierarchical URI from the given components.
*
* <p> If a scheme is given then the path, if also given, must either be
- * empty or begin with a slash character (<tt>'/'</tt>). Otherwise a
- * component of the new URI may be left undefined by passing <tt>null</tt>
- * for the corresponding parameter or, in the case of the <tt>port</tt>
- * parameter, by passing <tt>-1</tt>.
+ * empty or begin with a slash character ({@code '/'}). Otherwise a
+ * component of the new URI may be left undefined by passing {@code null}
+ * for the corresponding parameter or, in the case of the {@code port}
+ * parameter, by passing {@code -1}.
*
* <p> This constructor first builds a URI string from the given components
* according to the rules specified in <a
@@ -608,37 +602,37 @@
* <li><p> Initially, the result string is empty. </p></li>
*
* <li><p> If a scheme is given then it is appended to the result,
- * followed by a colon character (<tt>':'</tt>). </p></li>
+ * followed by a colon character ({@code ':'}). </p></li>
*
* <li><p> If user information, a host, or a port are given then the
- * string <tt>"//"</tt> is appended. </p></li>
+ * string {@code "//"} is appended. </p></li>
*
* <li><p> If user information is given then it is appended, followed by
- * a commercial-at character (<tt>'@'</tt>). Any character not in the
+ * a commercial-at character ({@code '@'}). Any character not in the
* <i>unreserved</i>, <i>punct</i>, <i>escaped</i>, or <i>other</i>
* categories is <a href="#quote">quoted</a>. </p></li>
*
* <li><p> If a host is given then it is appended. If the host is a
* literal IPv6 address but is not enclosed in square brackets
- * (<tt>'['</tt> and <tt>']'</tt>) then the square brackets are added.
+ * ({@code '['} and {@code ']'}) then the square brackets are added.
* </p></li>
*
* <li><p> If a port number is given then a colon character
- * (<tt>':'</tt>) is appended, followed by the port number in decimal.
+ * ({@code ':'}) is appended, followed by the port number in decimal.
* </p></li>
*
* <li><p> If a path is given then it is appended. Any character not in
* the <i>unreserved</i>, <i>punct</i>, <i>escaped</i>, or <i>other</i>
- * categories, and not equal to the slash character (<tt>'/'</tt>) or the
- * commercial-at character (<tt>'@'</tt>), is quoted. </p></li>
+ * categories, and not equal to the slash character ({@code '/'}) or the
+ * commercial-at character ({@code '@'}), is quoted. </p></li>
*
* <li><p> If a query is given then a question-mark character
- * (<tt>'?'</tt>) is appended, followed by the query. Any character that
+ * ({@code '?'}) is appended, followed by the query. Any character that
* is not a <a href="#legal-chars">legal URI character</a> is quoted.
* </p></li>
*
* <li><p> Finally, if a fragment is given then a hash character
- * (<tt>'#'</tt>) is appended, followed by the fragment. Any character
+ * ({@code '#'}) is appended, followed by the fragment. Any character
* that is not a legal URI character is quoted. </p></li>
*
* </ol>
@@ -678,8 +672,8 @@
* Constructs a hierarchical URI from the given components.
*
* <p> If a scheme is given then the path, if also given, must either be
- * empty or begin with a slash character (<tt>'/'</tt>). Otherwise a
- * component of the new URI may be left undefined by passing <tt>null</tt>
+ * empty or begin with a slash character ({@code '/'}). Otherwise a
+ * component of the new URI may be left undefined by passing {@code null}
* for the corresponding parameter.
*
* <p> This constructor first builds a URI string from the given components
@@ -692,28 +686,28 @@
* <li><p> Initially, the result string is empty. </p></li>
*
* <li><p> If a scheme is given then it is appended to the result,
- * followed by a colon character (<tt>':'</tt>). </p></li>
+ * followed by a colon character ({@code ':'}). </p></li>
*
- * <li><p> If an authority is given then the string <tt>"//"</tt> is
+ * <li><p> If an authority is given then the string {@code "//"} is
* appended, followed by the authority. If the authority contains a
* literal IPv6 address then the address must be enclosed in square
- * brackets (<tt>'['</tt> and <tt>']'</tt>). Any character not in the
+ * brackets ({@code '['} and {@code ']'}). Any character not in the
* <i>unreserved</i>, <i>punct</i>, <i>escaped</i>, or <i>other</i>
* categories, and not equal to the commercial-at character
- * (<tt>'@'</tt>), is <a href="#quote">quoted</a>. </p></li>
+ * ({@code '@'}), is <a href="#quote">quoted</a>. </p></li>
*
* <li><p> If a path is given then it is appended. Any character not in
* the <i>unreserved</i>, <i>punct</i>, <i>escaped</i>, or <i>other</i>
- * categories, and not equal to the slash character (<tt>'/'</tt>) or the
- * commercial-at character (<tt>'@'</tt>), is quoted. </p></li>
+ * categories, and not equal to the slash character ({@code '/'}) or the
+ * commercial-at character ({@code '@'}), is quoted. </p></li>
*
* <li><p> If a query is given then a question-mark character
- * (<tt>'?'</tt>) is appended, followed by the query. Any character that
+ * ({@code '?'}) is appended, followed by the query. Any character that
* is not a <a href="#legal-chars">legal URI character</a> is quoted.
* </p></li>
*
* <li><p> Finally, if a fragment is given then a hash character
- * (<tt>'#'</tt>) is appended, followed by the fragment. Any character
+ * ({@code '#'}) is appended, followed by the fragment. Any character
* that is not a legal URI character is quoted. </p></li>
*
* </ol>
@@ -750,15 +744,15 @@
/**
* Constructs a hierarchical URI from the given components.
*
- * <p> A component may be left undefined by passing <tt>null</tt>.
+ * <p> A component may be left undefined by passing {@code null}.
*
* <p> This convenience constructor works as if by invoking the
* seven-argument constructor as follows:
*
- * <blockquote><tt>
- * new {@link #URI(String, String, String, int, String, String, String)
- * URI}(scheme, null, host, -1, path, null, fragment);
- * </tt></blockquote>
+ * <blockquote>
+ * {@code new} {@link #URI(String, String, String, int, String, String, String)
+ * URI}{@code (scheme, null, host, -1, path, null, fragment);}
+ * </blockquote>
*
* @param scheme Scheme name
* @param host Host name
@@ -778,7 +772,7 @@
/**
* Constructs a URI from the given components.
*
- * <p> A component may be left undefined by passing <tt>null</tt>.
+ * <p> A component may be left undefined by passing {@code null}.
*
* <p> This constructor first builds a URI in string form using the given
* components as follows: </p>
@@ -788,14 +782,14 @@
* <li><p> Initially, the result string is empty. </p></li>
*
* <li><p> If a scheme is given then it is appended to the result,
- * followed by a colon character (<tt>':'</tt>). </p></li>
+ * followed by a colon character ({@code ':'}). </p></li>
*
* <li><p> If a scheme-specific part is given then it is appended. Any
* character that is not a <a href="#legal-chars">legal URI character</a>
* is <a href="#quote">quoted</a>. </p></li>
*
* <li><p> Finally, if a fragment is given then a hash character
- * (<tt>'#'</tt>) is appended to the string, followed by the fragment.
+ * ({@code '#'}) is appended to the string, followed by the fragment.
* Any character that is not a legal URI character is quoted. </p></li>
*
* </ol>
@@ -841,7 +835,7 @@
* @return The new URI
*
* @throws NullPointerException
- * If <tt>str</tt> is <tt>null</tt>
+ * If {@code str} is {@code null}
*
* @throws IllegalArgumentException
* If the given string violates RFC 2396
@@ -876,7 +870,7 @@
* cannot always distinguish a malformed server-based authority from a
* legitimate registry-based authority. It must therefore treat some
* instances of the former as instances of the latter. The authority
- * component in the URI string <tt>"//foo:bar"</tt>, for example, is not a
+ * component in the URI string {@code "//foo:bar"}, for example, is not a
* legal server-based authority but it is legal as a registry-based
* authority.
*
@@ -886,7 +880,7 @@
* treated as an error. In these cases a statement such as
*
* <blockquote>
- * <tt>URI </tt><i>u</i><tt> = new URI(str).parseServerAuthority();</tt>
+ * {@code URI }<i>u</i>{@code = new URI(str).parseServerAuthority();}
* </blockquote>
*
* <p> can be used to ensure that <i>u</i> always refers to a URI that, if
@@ -930,26 +924,26 @@
*
* <ol>
*
- * <li><p> All <tt>"."</tt> segments are removed. </p></li>
+ * <li><p> All {@code "."} segments are removed. </p></li>
*
- * <li><p> If a <tt>".."</tt> segment is preceded by a non-<tt>".."</tt>
+ * <li><p> If a {@code ".."} segment is preceded by a non-{@code ".."}
* segment then both of these segments are removed. This step is
* repeated until it is no longer applicable. </p></li>
*
* <li><p> If the path is relative, and if its first segment contains a
- * colon character (<tt>':'</tt>), then a <tt>"."</tt> segment is
+ * colon character ({@code ':'}), then a {@code "."} segment is
* prepended. This prevents a relative URI with a path such as
- * <tt>"a:b/c/d"</tt> from later being re-parsed as an opaque URI with a
- * scheme of <tt>"a"</tt> and a scheme-specific part of <tt>"b/c/d"</tt>.
+ * {@code "a:b/c/d"} from later being re-parsed as an opaque URI with a
+ * scheme of {@code "a"} and a scheme-specific part of {@code "b/c/d"}.
* <b><i>(Deviation from RFC 2396)</i></b> </p></li>
*
* </ol>
*
- * <p> A normalized path will begin with one or more <tt>".."</tt> segments
- * if there were insufficient non-<tt>".."</tt> segments preceding them to
- * allow their removal. A normalized path will begin with a <tt>"."</tt>
+ * <p> A normalized path will begin with one or more {@code ".."} segments
+ * if there were insufficient non-{@code ".."} segments preceding them to
+ * allow their removal. A normalized path will begin with a {@code "."}
* segment if one was inserted by step 3 above. Otherwise, a normalized
- * path will not contain any <tt>"."</tt> or <tt>".."</tt> segments. </p>
+ * path will not contain any {@code "."} or {@code ".."} segments. </p>
*
* @return A URI equivalent to this URI,
* but whose path is in normal form
@@ -969,7 +963,7 @@
* query components are undefined, then a URI with the given fragment but
* with all other components equal to those of this URI is returned. This
* allows a URI representing a standalone fragment reference, such as
- * <tt>"#foo"</tt>, to be usefully resolved against a base URI.
+ * {@code "#foo"}, to be usefully resolved against a base URI.
*
* <p> Otherwise this method constructs a new hierarchical URI in a manner
* consistent with <a
@@ -987,7 +981,7 @@
* <li><p> Otherwise the new URI's authority component is copied from
* this URI, and its path is computed as follows: </p>
*
- * <ol type=a>
+ * <ol>
*
* <li><p> If the given URI's path is absolute then the new URI's path
* is taken from the given URI. </p></li>
@@ -1010,7 +1004,7 @@
* @return The resulting URI
*
* @throws NullPointerException
- * If <tt>uri</tt> is <tt>null</tt>
+ * If {@code uri} is {@code null}
*/
public URI resolve(URI uri) {
return resolve(this, uri);
@@ -1021,14 +1015,14 @@
* against this URI.
*
* <p> This convenience method works as if invoking it were equivalent to
- * evaluating the expression <tt>{@link #resolve(java.net.URI)
- * resolve}(URI.{@link #create(String) create}(str))</tt>. </p>
+ * evaluating the expression {@link #resolve(java.net.URI)
+ * resolve}{@code (URI.}{@link #create(String) create}{@code (str))}. </p>
*
* @param str The string to be parsed into a URI
* @return The resulting URI
*
* @throws NullPointerException
- * If <tt>str</tt> is <tt>null</tt>
+ * If {@code str} is {@code null}
*
* @throws IllegalArgumentException
* If the given string violates RFC 2396
@@ -1061,7 +1055,7 @@
* @return The resulting URI
*
* @throws NullPointerException
- * If <tt>uri</tt> is <tt>null</tt>
+ * If {@code uri} is {@code null}
*/
public URI relativize(URI uri) {
return relativize(this, uri);
@@ -1071,7 +1065,7 @@
* Constructs a URL from this URI.
*
* <p> This convenience method works as if invoking it were equivalent to
- * evaluating the expression <tt>new URL(this.toString())</tt> after
+ * evaluating the expression {@code new URL(this.toString())} after
* first checking that this URI is absolute. </p>
*
* @return A URL constructed from this URI
@@ -1096,14 +1090,14 @@
* Returns the scheme component of this URI.
*
* <p> The scheme component of a URI, if defined, only contains characters
- * in the <i>alphanum</i> category and in the string <tt>"-.+"</tt>. A
+ * in the <i>alphanum</i> category and in the string {@code "-.+"}. A
* scheme always starts with an <i>alpha</i> character. <p>
*
* The scheme component of a URI cannot contain escaped octets, hence this
* method does not perform any decoding.
*
* @return The scheme component of this URI,
- * or <tt>null</tt> if the scheme is undefined
+ * or {@code null} if the scheme is undefined
*/
public String getScheme() {
return scheme;
@@ -1114,7 +1108,7 @@
*
* <p> A URI is absolute if, and only if, it has a scheme component. </p>
*
- * @return <tt>true</tt> if, and only if, this URI is absolute
+ * @return {@code true} if, and only if, this URI is absolute
*/
public boolean isAbsolute() {
return scheme != null;
@@ -1128,7 +1122,7 @@
* An opaque URI has a scheme, a scheme-specific part, and possibly
* a fragment; all other components are undefined. </p>
*
- * @return <tt>true</tt> if, and only if, this URI is opaque
+ * @return {@code true} if, and only if, this URI is opaque
*/
public boolean isOpaque() {
return path == null;
@@ -1142,7 +1136,7 @@
* characters. </p>
*
* @return The raw scheme-specific part of this URI
- * (never <tt>null</tt>)
+ * (never {@code null})
*/
public String getRawSchemeSpecificPart() {
defineSchemeSpecificPart();
@@ -1158,7 +1152,7 @@
* href="#decode">decoded</a>. </p>
*
* @return The decoded scheme-specific part of this URI
- * (never <tt>null</tt>)
+ * (never {@code null})
*/
public String getSchemeSpecificPart() {
if (decodedSchemeSpecificPart == null)
@@ -1170,14 +1164,14 @@
* Returns the raw authority component of this URI.
*
* <p> The authority component of a URI, if defined, only contains the
- * commercial-at character (<tt>'@'</tt>) and characters in the
+ * commercial-at character ({@code '@'}) and characters in the
* <i>unreserved</i>, <i>punct</i>, <i>escaped</i>, and <i>other</i>
* categories. If the authority is server-based then it is further
* constrained to have valid user-information, host, and port
* components. </p>
*
* @return The raw authority component of this URI,
- * or <tt>null</tt> if the authority is undefined
+ * or {@code null} if the authority is undefined
*/
public String getRawAuthority() {
return authority;
@@ -1191,7 +1185,7 @@
* sequences of escaped octets are <a href="#decode">decoded</a>. </p>
*
* @return The decoded authority component of this URI,
- * or <tt>null</tt> if the authority is undefined
+ * or {@code null} if the authority is undefined
*/
public String getAuthority() {
if (decodedAuthority == null)
@@ -1207,7 +1201,7 @@
* <i>other</i> categories. </p>
*
* @return The raw user-information component of this URI,
- * or <tt>null</tt> if the user information is undefined
+ * or {@code null} if the user information is undefined
*/
public String getRawUserInfo() {
return userInfo;
@@ -1221,7 +1215,7 @@
* sequences of escaped octets are <a href="#decode">decoded</a>. </p>
*
* @return The decoded user-information component of this URI,
- * or <tt>null</tt> if the user information is undefined
+ * or {@code null} if the user information is undefined
*/
public String getUserInfo() {
if ((decodedUserInfo == null) && (userInfo != null))
@@ -1235,24 +1229,24 @@
* <p> The host component of a URI, if defined, will have one of the
* following forms: </p>
*
- * <ul type=disc>
+ * <ul>
*
* <li><p> A domain name consisting of one or more <i>labels</i>
- * separated by period characters (<tt>'.'</tt>), optionally followed by
+ * separated by period characters ({@code '.'}), optionally followed by
* a period character. Each label consists of <i>alphanum</i> characters
- * as well as hyphen characters (<tt>'-'</tt>), though hyphens never
+ * as well as hyphen characters ({@code '-'}), though hyphens never
* occur as the first or last characters in a label. The rightmost
* label of a domain name consisting of two or more labels, begins
* with an <i>alpha</i> character. </li>
*
* <li><p> A dotted-quad IPv4 address of the form
- * <i>digit</i><tt>+.</tt><i>digit</i><tt>+.</tt><i>digit</i><tt>+.</tt><i>digit</i><tt>+</tt>,
+ * <i>digit</i>{@code +.}<i>digit</i>{@code +.}<i>digit</i>{@code +.}<i>digit</i>{@code +},
* where no <i>digit</i> sequence is longer than three characters and no
* sequence has a value larger than 255. </p></li>
*
- * <li><p> An IPv6 address enclosed in square brackets (<tt>'['</tt> and
- * <tt>']'</tt>) and consisting of hexadecimal digits, colon characters
- * (<tt>':'</tt>), and possibly an embedded IPv4 address. The full
+ * <li><p> An IPv6 address enclosed in square brackets ({@code '['} and
+ * {@code ']'}) and consisting of hexadecimal digits, colon characters
+ * ({@code ':'}), and possibly an embedded IPv4 address. The full
* syntax of IPv6 addresses is specified in <a
* href="http://www.ietf.org/rfc/rfc2373.txt"><i>RFC 2373: IPv6
* Addressing Architecture</i></a>. </p></li>
@@ -1263,7 +1257,7 @@
* method does not perform any decoding.
*
* @return The host component of this URI,
- * or <tt>null</tt> if the host is undefined
+ * or {@code null} if the host is undefined
*/
public String getHost() {
return host;
@@ -1276,7 +1270,7 @@
* integer. </p>
*
* @return The port component of this URI,
- * or <tt>-1</tt> if the port is undefined
+ * or {@code -1} if the port is undefined
*/
public int getPort() {
return port;
@@ -1286,12 +1280,12 @@
* Returns the raw path component of this URI.
*
* <p> The path component of a URI, if defined, only contains the slash
- * character (<tt>'/'</tt>), the commercial-at character (<tt>'@'</tt>),
+ * character ({@code '/'}), the commercial-at character ({@code '@'}),
* and characters in the <i>unreserved</i>, <i>punct</i>, <i>escaped</i>,
* and <i>other</i> categories. </p>
*
* @return The path component of this URI,
- * or <tt>null</tt> if the path is undefined
+ * or {@code null} if the path is undefined
*/
public String getRawPath() {
return path;
@@ -1305,7 +1299,7 @@
* escaped octets are <a href="#decode">decoded</a>. </p>
*
* @return The decoded path component of this URI,
- * or <tt>null</tt> if the path is undefined
+ * or {@code null} if the path is undefined
*/
public String getPath() {
if ((decodedPath == null) && (path != null))
@@ -1320,7 +1314,7 @@
* characters. </p>
*
* @return The raw query component of this URI,
- * or <tt>null</tt> if the query is undefined
+ * or {@code null} if the query is undefined
*/
public String getRawQuery() {
return query;
@@ -1334,7 +1328,7 @@
* escaped octets are <a href="#decode">decoded</a>. </p>
*
* @return The decoded query component of this URI,
- * or <tt>null</tt> if the query is undefined
+ * or {@code null} if the query is undefined
*/
public String getQuery() {
if ((decodedQuery == null) && (query != null))
@@ -1349,7 +1343,7 @@
* characters. </p>
*
* @return The raw fragment component of this URI,
- * or <tt>null</tt> if the fragment is undefined
+ * or {@code null} if the fragment is undefined
*/
public String getRawFragment() {
return fragment;
@@ -1363,7 +1357,7 @@
* sequences of escaped octets are <a href="#decode">decoded</a>. </p>
*
* @return The decoded fragment component of this URI,
- * or <tt>null</tt> if the fragment is undefined
+ * or {@code null} if the fragment is undefined
*/
public String getFragment() {
if ((decodedFragment == null) && (fragment != null))
@@ -1378,7 +1372,7 @@
* Tests this URI for equality with another object.
*
* <p> If the given object is not a URI then this method immediately
- * returns <tt>false</tt>.
+ * returns {@code false}.
*
* <p> For two URIs to be considered equal requires that either both are
* opaque or both are hierarchical. Their schemes must either both be
@@ -1408,7 +1402,7 @@
*
* @param ob The object to which this object is to be compared
*
- * @return <tt>true</tt> if, and only if, the given object is a URI that
+ * @return {@code true} if, and only if, the given object is a URI that
* is identical to this URI
*/
public boolean equals(Object ob) {
@@ -1629,7 +1623,7 @@
/**
* Saves the content of this URI to the given serial stream.
*
- * <p> The only serializable field of a URI instance is its <tt>string</tt>
+ * <p> The only serializable field of a URI instance is its {@code string}
* field. That field is given a value, if it does not have one already,
* and then the {@link java.io.ObjectOutputStream#defaultWriteObject()}
* method of the given object-output stream is invoked. </p>
@@ -1648,7 +1642,7 @@
* Reconstitutes a URI from the given serial stream.
*
* <p> The {@link java.io.ObjectInputStream#defaultReadObject()} method is
- * invoked to read the value of the <tt>string</tt> field. The result is
+ * invoked to read the value of the {@code string} field. The result is
* then parsed in the usual way.
*
* @param is The object-input stream from which this object
diff --git a/ojluni/src/main/java/java/net/URISyntaxException.java b/ojluni/src/main/java/java/net/URISyntaxException.java
index df4a02a..8072c37 100755
--- a/ojluni/src/main/java/java/net/URISyntaxException.java
+++ b/ojluni/src/main/java/java/net/URISyntaxException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -50,13 +50,13 @@
* @param input The input string
* @param reason A string explaining why the input could not be parsed
* @param index The index at which the parse error occurred,
- * or <tt>-1</tt> if the index is not known
+ * or {@code -1} if the index is not known
*
* @throws NullPointerException
- * If either the input or reason strings are <tt>null</tt>
+ * If either the input or reason strings are {@code null}
*
* @throws IllegalArgumentException
- * If the error index is less than <tt>-1</tt>
+ * If the error index is less than {@code -1}
*/
public URISyntaxException(String input, String reason, int index) {
super(reason);
@@ -70,13 +70,13 @@
/**
* Constructs an instance from the given input string and reason. The
- * resulting object will have an error index of <tt>-1</tt>.
+ * resulting object will have an error index of {@code -1}.
*
* @param input The input string
* @param reason A string explaining why the input could not be parsed
*
* @throws NullPointerException
- * If either the input or reason strings are <tt>null</tt>
+ * If either the input or reason strings are {@code null}
*/
public URISyntaxException(String input, String reason) {
this(input, reason, -1);
@@ -102,7 +102,7 @@
/**
* Returns an index into the input string of the position at which the
- * parse error occurred, or <tt>-1</tt> if this position is not known.
+ * parse error occurred, or {@code -1} if this position is not known.
*
* @return The error index
*/
@@ -113,8 +113,8 @@
/**
* Returns a string describing the parse error. The resulting string
* consists of the reason string followed by a colon character
- * (<tt>':'</tt>), a space, and the input string. If the error index is
- * defined then the string <tt>" at index "</tt> followed by the index, in
+ * ({@code ':'}), a space, and the input string. If the error index is
+ * defined then the string {@code " at index "} followed by the index, in
* decimal, is inserted after the reason string and before the colon
* character.
*
diff --git a/ojluni/src/main/java/java/net/URL.java b/ojluni/src/main/java/java/net/URL.java
index 70825a0..8af827c 100755
--- a/ojluni/src/main/java/java/net/URL.java
+++ b/ojluni/src/main/java/java/net/URL.java
@@ -36,23 +36,27 @@
import sun.security.util.SecurityConstants;
/**
- * Class <code>URL</code> represents a Uniform Resource
+ * Class {@code URL} represents a Uniform Resource
* Locator, a pointer to a "resource" on the World
* Wide Web. A resource can be something as simple as a file or a
* directory, or it can be a reference to a more complicated object,
* such as a query to a database or to a search engine. More
* information on the types of URLs and their formats can be found at:
- * <blockquote>
- * <a href="http://www.socs.uts.edu.au/MosaicDocs-old/url-primer.html">
- * <i>http://www.socs.uts.edu.au/MosaicDocs-old/url-primer.html</i></a>
- * </blockquote>
+ * <a href=
+ * "http://web.archive.org/web/20051219043731/http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Demo/url-primer.html">
+ * <i>Types of URL</i></a>
* <p>
- * In general, a URL can be broken into several parts. The previous
- * example of a URL indicates that the protocol to use is
- * <code>http</code> (HyperText Transfer Protocol) and that the
+ * In general, a URL can be broken into several parts. Consider the
+ * following example:
+ * <blockquote><pre>
+ * http://www.example.com/docs/resource1.html
+ * </pre></blockquote>
+ * <p>
+ * The URL above indicates that the protocol to use is
+ * {@code http} (HyperText Transfer Protocol) and that the
* information resides on a host machine named
- * <code>www.socs.uts.edu.au</code>. The information on that host
- * machine is named <code>/MosaicDocs-old/url-primer.html</code>. The exact
+ * {@code www.example.com}. The information on that host
+ * machine is named {@code /docs/resource1.html}. The exact
* meaning of this name on the host machine is both protocol
* dependent and host dependent. The information normally resides in
* a file, but it could be generated on the fly. This component of
@@ -62,13 +66,13 @@
* port number to which the TCP connection is made on the remote host
* machine. If the port is not specified, the default port for
* the protocol is used instead. For example, the default port for
- * <code>http</code> is <code>80</code>. An alternative port could be
+ * {@code http} is {@code 80}. An alternative port could be
* specified as:
* <blockquote><pre>
- * http://www.socs.uts.edu.au:80/MosaicDocs-old/url-primer.html
+ * http://www.example.com:1080/docs/resource1.html
* </pre></blockquote>
* <p>
- * The syntax of <code>URL</code> is defined by <a
+ * The syntax of {@code URL} is defined by <a
* href="http://www.ietf.org/rfc/rfc2396.txt"><i>RFC 2396: Uniform
* Resource Identifiers (URI): Generic Syntax</i></a>, amended by <a
* href="http://www.ietf.org/rfc/rfc2732.txt"><i>RFC 2732: Format for
@@ -86,7 +90,7 @@
* This fragment is not technically part of the URL. Rather, it
* indicates that after the specified resource is retrieved, the
* application is specifically interested in that part of the
- * document that has the tag <code>chapter1</code> attached to it. The
+ * document that has the tag {@code chapter1} attached to it. The
* meaning of a tag is resource specific.
* <p>
* An application can also specify a "relative URL",
@@ -170,8 +174,8 @@
private int port = -1;
/**
- * The specified file name on that host. <code>file</code> is
- * defined as <code>path[?query]</code>
+ * The specified file name on that host. {@code file} is
+ * defined as {@code path[?query]}
* @serial
*/
private String file;
@@ -223,42 +227,42 @@
// ----- END android -----
/**
- * Creates a <code>URL</code> object from the specified
- * <code>protocol</code>, <code>host</code>, <code>port</code>
- * number, and <code>file</code>.<p>
+ * Creates a {@code URL} object from the specified
+ * {@code protocol}, {@code host}, {@code port}
+ * number, and {@code file}.<p>
*
- * <code>host</code> can be expressed as a host name or a literal
+ * {@code host} can be expressed as a host name or a literal
* IP address. If IPv6 literal address is used, it should be
- * enclosed in square brackets (<tt>'['</tt> and <tt>']'</tt>), as
+ * enclosed in square brackets ({@code '['} and {@code ']'}), as
* specified by <a
* href="http://www.ietf.org/rfc/rfc2732.txt">RFC 2732</a>;
* However, the literal IPv6 address format defined in <a
* href="http://www.ietf.org/rfc/rfc2373.txt"><i>RFC 2373: IP
* Version 6 Addressing Architecture</i></a> is also accepted.<p>
*
- * Specifying a <code>port</code> number of <code>-1</code>
+ * Specifying a {@code port} number of {@code -1}
* indicates that the URL should use the default port for the
* protocol.<p>
*
* If this is the first URL object being created with the specified
* protocol, a <i>stream protocol handler</i> object, an instance of
- * class <code>URLStreamHandler</code>, is created for that protocol:
+ * class {@code URLStreamHandler}, is created for that protocol:
* <ol>
* <li>If the application has previously set up an instance of
- * <code>URLStreamHandlerFactory</code> as the stream handler factory,
- * then the <code>createURLStreamHandler</code> method of that instance
+ * {@code URLStreamHandlerFactory} as the stream handler factory,
+ * then the {@code createURLStreamHandler} method of that instance
* is called with the protocol string as an argument to create the
* stream protocol handler.
- * <li>If no <code>URLStreamHandlerFactory</code> has yet been set up,
- * or if the factory's <code>createURLStreamHandler</code> method
- * returns <code>null</code>, then the constructor finds the
+ * <li>If no {@code URLStreamHandlerFactory} has yet been set up,
+ * or if the factory's {@code createURLStreamHandler} method
+ * returns {@code null}, then the constructor finds the
* value of the system property:
* <blockquote><pre>
* java.protocol.handler.pkgs
* </pre></blockquote>
- * If the value of that system property is not <code>null</code>,
+ * If the value of that system property is not {@code null},
* it is interpreted as a list of packages separated by a vertical
- * slash character '<code>|</code>'. The constructor tries to load
+ * slash character '{@code |}'. The constructor tries to load
* the class named:
* <blockquote><pre>
* <<i>package</i>>.<<i>protocol</i>>.Handler
@@ -266,7 +270,7 @@
* where <<i>package</i>> is replaced by the name of the package
* and <<i>protocol</i>> is replaced by the name of the protocol.
* If this class does not exist, or if the class exists but it is not
- * a subclass of <code>URLStreamHandler</code>, then the next package
+ * a subclass of {@code URLStreamHandler}, then the next package
* in the list is tried.
* <li>If the previous step fails to find a protocol handler, then the
* constructor tries to load from a system default package.
@@ -274,14 +278,14 @@
* <<i>system default package</i>>.<<i>protocol</i>>.Handler
* </pre></blockquote>
* If this class does not exist, or if the class exists but it is not a
- * subclass of <code>URLStreamHandler</code>, then a
- * <code>MalformedURLException</code> is thrown.
+ * subclass of {@code URLStreamHandler}, then a
+ * {@code MalformedURLException} is thrown.
* </ol>
*
* <p>Protocol handlers for the following protocols are guaranteed
* to exist on the search path :-
* <blockquote><pre>
- * http, https, ftp, file, and jar
+ * http, https, file, and jar
* </pre></blockquote>
* Protocol handlers for additional protocols may also be
* available.
@@ -307,13 +311,13 @@
}
/**
- * Creates a URL from the specified <code>protocol</code>
- * name, <code>host</code> name, and <code>file</code> name. The
+ * Creates a URL from the specified {@code protocol}
+ * name, {@code host} name, and {@code file} name. The
* default port for the specified protocol is used.
* <p>
* This method is equivalent to calling the four-argument
- * constructor with the arguments being <code>protocol</code>,
- * <code>host</code>, <code>-1</code>, and <code>file</code>.
+ * constructor with the arguments being {@code protocol},
+ * {@code host}, {@code -1}, and {@code file}.
*
* No validation of the inputs is performed by this constructor.
*
@@ -330,21 +334,21 @@
}
/**
- * Creates a <code>URL</code> object from the specified
- * <code>protocol</code>, <code>host</code>, <code>port</code>
- * number, <code>file</code>, and <code>handler</code>. Specifying
- * a <code>port</code> number of <code>-1</code> indicates that
+ * Creates a {@code URL} object from the specified
+ * {@code protocol}, {@code host}, {@code port}
+ * number, {@code file}, and {@code handler}. Specifying
+ * a {@code port} number of {@code -1} indicates that
* the URL should use the default port for the protocol. Specifying
- * a <code>handler</code> of <code>null</code> indicates that the URL
+ * a {@code handler} of {@code null} indicates that the URL
* should use a default stream handler for the protocol, as outlined
* for:
* java.net.URL#URL(java.lang.String, java.lang.String, int,
* java.lang.String)
*
* <p>If the handler is not null and there is a security manager,
- * the security manager's <code>checkPermission</code>
+ * the security manager's {@code checkPermission}
* method is called with a
- * <code>NetPermission("specifyStreamHandler")</code> permission.
+ * {@code NetPermission("specifyStreamHandler")} permission.
* This may result in a SecurityException.
*
* No validation of the inputs is performed by this constructor.
@@ -357,7 +361,7 @@
* @exception MalformedURLException if an unknown protocol is specified.
* @exception SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* specifying a stream handler explicitly.
* @see java.lang.System#getProperty(java.lang.String)
* @see java.net.URL#setURLStreamHandlerFactory(
@@ -420,15 +424,15 @@
}
/**
- * Creates a <code>URL</code> object from the <code>String</code>
+ * Creates a {@code URL} object from the {@code String}
* representation.
* <p>
* This constructor is equivalent to a call to the two-argument
- * constructor with a <code>null</code> first argument.
+ * constructor with a {@code null} first argument.
*
- * @param spec the <code>String</code> to parse as a URL.
+ * @param spec the {@code String} to parse as a URL.
* @exception MalformedURLException if no protocol is specified, or an
- * unknown protocol is found, or <tt>spec</tt> is <tt>null</tt>.
+ * unknown protocol is found, or {@code spec} is {@code null}.
* @see java.net.URL#URL(java.net.URL, java.lang.String)
*/
public URL(String spec) throws MalformedURLException {
@@ -468,14 +472,14 @@
* Otherwise, the path is treated as a relative path and is appended to the
* context path, as described in RFC2396. Also, in this case,
* the path is canonicalized through the removal of directory
- * changes made by occurences of ".." and ".".
+ * changes made by occurrences of ".." and ".".
* <p>
* For a more detailed description of URL parsing, refer to RFC2396.
*
* @param context the context in which to parse the specification.
- * @param spec the <code>String</code> to parse as a URL.
+ * @param spec the {@code String} to parse as a URL.
* @exception MalformedURLException if no protocol is specified, or an
- * unknown protocol is found, or <tt>spec</tt> is <tt>null</tt>.
+ * unknown protocol is found, or {@code spec} is {@code null}.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
* @see java.net.URLStreamHandler
@@ -492,13 +496,13 @@
* occurs as with the two argument constructor.
*
* @param context the context in which to parse the specification.
- * @param spec the <code>String</code> to parse as a URL.
+ * @param spec the {@code String} to parse as a URL.
* @param handler the stream handler for the URL.
* @exception MalformedURLException if no protocol is specified, or an
- * unknown protocol is found, or <tt>spec</tt> is <tt>null</tt>.
+ * unknown protocol is found, or {@code spec} is {@code null}.
* @exception SecurityException
* if a security manager exists and its
- * <code>checkPermission</code> method doesn't allow
+ * {@code checkPermission} method doesn't allow
* specifying a stream handler.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
@@ -722,9 +726,9 @@
}
/**
- * Gets the query part of this <code>URL</code>.
+ * Gets the query part of this {@code URL}.
*
- * @return the query part of this <code>URL</code>,
+ * @return the query part of this {@code URL},
* or <CODE>null</CODE> if one does not exist
* @since 1.3
*/
@@ -733,9 +737,9 @@
}
/**
- * Gets the path part of this <code>URL</code>.
+ * Gets the path part of this {@code URL}.
*
- * @return the path part of this <code>URL</code>, or an
+ * @return the path part of this {@code URL}, or an
* empty string if one does not exist
* @since 1.3
*/
@@ -744,9 +748,9 @@
}
/**
- * Gets the userInfo part of this <code>URL</code>.
+ * Gets the userInfo part of this {@code URL}.
*
- * @return the userInfo part of this <code>URL</code>, or
+ * @return the userInfo part of this {@code URL}, or
* <CODE>null</CODE> if one does not exist
* @since 1.3
*/
@@ -755,9 +759,9 @@
}
/**
- * Gets the authority part of this <code>URL</code>.
+ * Gets the authority part of this {@code URL}.
*
- * @return the authority part of this <code>URL</code>
+ * @return the authority part of this {@code URL}
* @since 1.3
*/
public String getAuthority() {
@@ -765,7 +769,7 @@
}
/**
- * Gets the port number of this <code>URL</code>.
+ * Gets the port number of this {@code URL}.
*
* @return the port number, or -1 if the port is not set
*/
@@ -775,7 +779,7 @@
/**
* Gets the default port number of the protocol associated
- * with this <code>URL</code>. If the URL scheme or the URLStreamHandler
+ * with this {@code URL}. If the URL scheme or the URLStreamHandler
* for the URL do not define a default port number,
* then -1 is returned.
*
@@ -787,35 +791,35 @@
}
/**
- * Gets the protocol name of this <code>URL</code>.
+ * Gets the protocol name of this {@code URL}.
*
- * @return the protocol of this <code>URL</code>.
+ * @return the protocol of this {@code URL}.
*/
public String getProtocol() {
return protocol;
}
/**
- * Gets the host name of this <code>URL</code>, if applicable.
+ * Gets the host name of this {@code URL}, if applicable.
* The format of the host conforms to RFC 2732, i.e. for a
* literal IPv6 address, this method will return the IPv6 address
- * enclosed in square brackets (<tt>'['</tt> and <tt>']'</tt>).
+ * enclosed in square brackets ({@code '['} and {@code ']'}).
*
- * @return the host name of this <code>URL</code>.
+ * @return the host name of this {@code URL}.
*/
public String getHost() {
return host;
}
/**
- * Gets the file name of this <code>URL</code>.
+ * Gets the file name of this {@code URL}.
* The returned file portion will be
* the same as <CODE>getPath()</CODE>, plus the concatenation of
* the value of <CODE>getQuery()</CODE>, if any. If there is
* no query portion, this method and <CODE>getPath()</CODE> will
* return identical results.
*
- * @return the file name of this <code>URL</code>,
+ * @return the file name of this {@code URL},
* or an empty string if one does not exist
*/
public String getFile() {
@@ -824,10 +828,10 @@
/**
* Gets the anchor (also known as the "reference") of this
- * <code>URL</code>.
+ * {@code URL}.
*
* @return the anchor (also known as the "reference") of this
- * <code>URL</code>, or <CODE>null</CODE> if one does not exist
+ * {@code URL}, or <CODE>null</CODE> if one does not exist
*/
public String getRef() {
return ref;
@@ -837,7 +841,7 @@
* Compares this URL for equality with another object.<p>
*
* If the given object is not a URL then this method immediately returns
- * <code>false</code>.<p>
+ * {@code false}.<p>
*
* Two URL objects are equal if they have the same protocol, reference
* equivalent hosts, have the same port number on the host, and the same
@@ -871,8 +875,8 @@
* case).
*
* @param obj the URL to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ * @return {@code true} if the objects are the same;
+ * {@code false} otherwise.
*/
public boolean equals(Object obj) {
if (!(obj instanceof URL))
@@ -888,7 +892,7 @@
* The hash code is based upon all the URL components relevant for URL
* comparison. As such, this operation is a blocking operation.<p>
*
- * @return a hash code for this <code>URL</code>.
+ * @return a hash code for this {@code URL}.
*/
public synchronized int hashCode() {
if (hashCode != -1)
@@ -901,21 +905,21 @@
/**
* Compares two URLs, excluding the fragment component.<p>
*
- * Returns <code>true</code> if this <code>URL</code> and the
- * <code>other</code> argument are equal without taking the
+ * Returns {@code true} if this {@code URL} and the
+ * {@code other} argument are equal without taking the
* fragment component into consideration.
*
- * @param other the <code>URL</code> to compare against.
- * @return <code>true</code> if they reference the same remote object;
- * <code>false</code> otherwise.
+ * @param other the {@code URL} to compare against.
+ * @return {@code true} if they reference the same remote object;
+ * {@code false} otherwise.
*/
public boolean sameFile(URL other) {
return handler.sameFile(this, other);
}
/**
- * Constructs a string representation of this <code>URL</code>. The
- * string is created by calling the <code>toExternalForm</code>
+ * Constructs a string representation of this {@code URL}. The
+ * string is created by calling the {@code toExternalForm}
* method of the stream protocol handler for this object.
*
* @return a string representation of this object.
@@ -928,8 +932,8 @@
}
/**
- * Constructs a string representation of this <code>URL</code>. The
- * string is created by calling the <code>toExternalForm</code>
+ * Constructs a string representation of this {@code URL}. The
+ * string is created by calling the {@code toExternalForm}
* method of the stream protocol handler for this object.
*
* @return a string representation of this object.
@@ -943,7 +947,7 @@
/**
* Returns a {@link java.net.URI} equivalent to this URL.
- * This method functions in the same way as <code>new URI (this.toString())</code>.
+ * This method functions in the same way as {@code new URI (this.toString())}.
* <p>Note, any URL instance that complies with RFC 2396 can be converted
* to a URI. However, some URLs that are not strictly in compliance
* can not be converted to a URI.
@@ -1003,7 +1007,7 @@
* @param proxy the Proxy through which this connection
* will be made. If direct connection is desired,
* Proxy.NO_PROXY should be specified.
- * @return a <code>URLConnection</code> to the URL.
+ * @return a {@code URLConnection} to the URL.
* @exception IOException if an I/O exception occurs.
* @exception SecurityException if a security manager is present
* and the caller doesn't have permission to connect
@@ -1041,8 +1045,8 @@
}
/**
- * Opens a connection to this <code>URL</code> and returns an
- * <code>InputStream</code> for reading from that connection. This
+ * Opens a connection to this {@code URL} and returns an
+ * {@code InputStream} for reading from that connection. This
* method is a shorthand for:
* <blockquote><pre>
* openConnection().getInputStream()
@@ -1096,22 +1100,22 @@
static URLStreamHandlerFactory factory;
/**
- * Sets an application's <code>URLStreamHandlerFactory</code>.
+ * Sets an application's {@code URLStreamHandlerFactory}.
* This method can be called at most once in a given Java Virtual
* Machine.
*
- *<p> The <code>URLStreamHandlerFactory</code> instance is used to
+ *<p> The {@code URLStreamHandlerFactory} instance is used to
*construct a stream protocol handler from a protocol name.
*
* <p> If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
* @exception Error if the application has already set a factory.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow
+ * {@code checkSetFactory} method doesn't allow
* the operation.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
diff --git a/ojluni/src/main/java/java/net/URLClassLoader.java b/ojluni/src/main/java/java/net/URLClassLoader.java
index f473b8e..fa994ba 100755
--- a/ojluni/src/main/java/java/net/URLClassLoader.java
+++ b/ojluni/src/main/java/java/net/URLClassLoader.java
@@ -91,6 +91,7 @@
* @exception SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
+ * @exception NullPointerException if {@code urls} is {@code null}.
* @see SecurityManager#checkCreateClassLoader
*/
public URLClassLoader(URL[] urls, ClassLoader parent) {
@@ -118,7 +119,7 @@
/**
* Constructs a new URLClassLoader for the specified URLs using the
- * default delegation parent <code>ClassLoader</code>. The URLs will
+ * default delegation parent {@code ClassLoader}. The URLs will
* be searched in the order specified for classes and resources after
* first searching in the parent class loader. Any URL that ends with
* a '/' is assumed to refer to a directory. Otherwise, the URL is
@@ -126,14 +127,15 @@
* as needed.
*
* <p>If there is a security manager, this method first
- * calls the security manager's <code>checkCreateClassLoader</code> method
+ * calls the security manager's {@code checkCreateClassLoader} method
* to ensure creation of a class loader is allowed.
*
* @param urls the URLs from which to load classes and resources
*
* @exception SecurityException if a security manager exists and its
- * <code>checkCreateClassLoader</code> method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
+ * @exception NullPointerException if {@code urls} is {@code null}.
* @see SecurityManager#checkCreateClassLoader
*/
public URLClassLoader(URL[] urls) {
@@ -166,7 +168,7 @@
* obtain protocol handlers when creating new jar URLs.
*
* <p>If there is a security manager, this method first
- * calls the security manager's <code>checkCreateClassLoader</code> method
+ * calls the security manager's {@code checkCreateClassLoader} method
* to ensure creation of a class loader is allowed.
*
* @param urls the URLs from which to load classes and resources
@@ -174,7 +176,7 @@
* @param factory the URLStreamHandlerFactory to use when creating URLs
*
* @exception SecurityException if a security manager exists and its
- * <code>checkCreateClassLoader</code> method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -218,7 +220,7 @@
* @param name
* The resource name
*
- * @return An input stream for reading the resource, or <tt>null</tt>
+ * @return An input stream for reading the resource, or {@code null}
* if the resource could not be found
*
* @since 1.7
@@ -274,7 +276,7 @@
* as suppressed exceptions of the first one caught, which is then re-thrown.
*
* @throws SecurityException if a security manager is set, and it denies
- * {@link RuntimePermission}<tt>("closeClassLoader")</tt>
+ * {@link RuntimePermission}{@code ("closeClassLoader")}
*
* @since 1.7
*/
@@ -317,7 +319,7 @@
* Appends the specified URL to the list of URLs to search for
* classes and resources.
* <p>
- * If the URL specified is <code>null</code> or is already in the
+ * If the URL specified is {@code null} or is already in the
* list of URLs, or if this loader is closed, then invoking this
* method has no effect.
*
@@ -348,7 +350,7 @@
* or if the loader is closed.
*/
protected Class<?> findClass(final String name)
- throws ClassNotFoundException
+ throws ClassNotFoundException
{
try {
return AccessController.doPrivileged(
@@ -536,7 +538,7 @@
* Finds the resource with the specified name on the URL search path.
*
* @param name the name of the resource
- * @return a <code>URL</code> for the resource, or <code>null</code>
+ * @return a {@code URL} for the resource, or {@code null}
* if the resource could not be found, or if the loader is closed.
*/
public URL findResource(final String name) {
@@ -559,7 +561,7 @@
*
* @param name the resource name
* @exception IOException if an I/O exception occurs
- * @return an <code>Enumeration</code> of <code>URL</code>s
+ * @return an {@code Enumeration} of {@code URL}s
* If the loader is closed, the Enumeration will be empty.
*/
public Enumeration<URL> findResources(final String name)
@@ -626,6 +628,7 @@
* If the protocol is not "file", then permission
* to connect to and accept connections from the URL's host is granted.
* @param codesource the codesource
+ * @exception NullPointerException if {@code codesource} is {@code null}.
* @return the permissions granted to the codesource
*/
protected PermissionCollection getPermissions(CodeSource codesource)
@@ -698,13 +701,14 @@
/**
* Creates a new instance of URLClassLoader for the specified
* URLs and parent class loader. If a security manager is
- * installed, the <code>loadClass</code> method of the URLClassLoader
+ * installed, the {@code loadClass} method of the URLClassLoader
* returned by this method will invoke the
- * <code>SecurityManager.checkPackageAccess</code> method before
+ * {@code SecurityManager.checkPackageAccess} method before
* loading the class.
*
* @param urls the URLs to search for classes and resources
* @param parent the parent class loader for delegation
+ * @exception NullPointerException if {@code urls} is {@code null}.
* @return the resulting class loader
*/
public static URLClassLoader newInstance(final URL[] urls,
@@ -724,12 +728,13 @@
/**
* Creates a new instance of URLClassLoader for the specified
* URLs and default parent class loader. If a security manager is
- * installed, the <code>loadClass</code> method of the URLClassLoader
+ * installed, the {@code loadClass} method of the URLClassLoader
* returned by this method will invoke the
- * <code>SecurityManager.checkPackageAccess</code> before
+ * {@code SecurityManager.checkPackageAccess} before
* loading the class.
*
* @param urls the URLs to search for classes and resources
+ * @exception NullPointerException if {@code urls} is {@code null}.
* @return the resulting class loader
*/
public static URLClassLoader newInstance(final URL[] urls) {
diff --git a/ojluni/src/main/java/java/net/URLConnection.java b/ojluni/src/main/java/java/net/URLConnection.java
index 610a072..8ea13ee 100755
--- a/ojluni/src/main/java/java/net/URLConnection.java
+++ b/ojluni/src/main/java/java/net/URLConnection.java
@@ -41,15 +41,15 @@
import sun.net.www.MessageHeader;
/**
- * The abstract class <code>URLConnection</code> is the superclass
+ * The abstract class {@code URLConnection} is the superclass
* of all classes that represent a communications link between the
* application and a URL. Instances of this class can be used both to
* read from and to write to the resource referenced by the URL. In
* general, creating a connection to a URL is a multistep process:
* <p>
* <center><table border=2 summary="Describes the process of creating a connection to a URL: openConnection() and connect() over time.">
- * <tr><th><code>openConnection()</code></th>
- * <th><code>connect()</code></th></tr>
+ * <tr><th>{@code openConnection()}</th>
+ * <th>{@code connect()}</th></tr>
* <tr><td>Manipulate parameters that affect the connection to the remote
* resource.</td>
* <td>Interact with the resource; query header fields and
@@ -60,87 +60,78 @@
*
* <ol>
* <li>The connection object is created by invoking the
- * <code>openConnection</code> method on a URL.
+ * {@code openConnection} method on a URL.
* <li>The setup parameters and general request properties are manipulated.
* <li>The actual connection to the remote object is made, using the
- * <code>connect</code> method.
+ * {@code connect} method.
* <li>The remote object becomes available. The header fields and the contents
* of the remote object can be accessed.
* </ol>
* <p>
* The setup parameters are modified using the following methods:
* <ul>
- * <li><code>setAllowUserInteraction</code>
- * <li><code>setDoInput</code>
- * <li><code>setDoOutput</code>
- * <li><code>setIfModifiedSince</code>
- * <li><code>setUseCaches</code>
+ * <li>{@code setAllowUserInteraction}
+ * <li>{@code setDoInput}
+ * <li>{@code setDoOutput}
+ * <li>{@code setIfModifiedSince}
+ * <li>{@code setUseCaches}
* </ul>
* <p>
* and the general request properties are modified using the method:
* <ul>
- * <li><code>setRequestProperty</code>
+ * <li>{@code setRequestProperty}
* </ul>
* <p>
- * Default values for the <code>AllowUserInteraction</code> and
- * <code>UseCaches</code> parameters can be set using the methods
- * <code>setDefaultAllowUserInteraction</code> and
- * <code>setDefaultUseCaches</code>.
+ * Default values for the {@code AllowUserInteraction} and
+ * {@code UseCaches} parameters can be set using the methods
+ * {@code setDefaultAllowUserInteraction} and
+ * {@code setDefaultUseCaches}.
* <p>
- * Each of the above <code>set</code> methods has a corresponding
- * <code>get</code> method to retrieve the value of the parameter or
+ * Each of the above {@code set} methods has a corresponding
+ * {@code get} method to retrieve the value of the parameter or
* general request property. The specific parameters and general
* request properties that are applicable are protocol specific.
* <p>
* The following methods are used to access the header fields and
* the contents after the connection is made to the remote object:
* <ul>
- * <li><code>getContent</code>
- * <li><code>getHeaderField</code>
- * <li><code>getInputStream</code>
- * <li><code>getOutputStream</code>
+ * <li>{@code getContent}
+ * <li>{@code getHeaderField}
+ * <li>{@code getInputStream}
+ * <li>{@code getOutputStream}
* </ul>
* <p>
* Certain header fields are accessed frequently. The methods:
* <ul>
- * <li><code>getContentEncoding</code>
- * <li><code>getContentLength</code>
- * <li><code>getContentType</code>
- * <li><code>getDate</code>
- * <li><code>getExpiration</code>
- * <li><code>getLastModifed</code>
+ * <li>{@code getContentEncoding}
+ * <li>{@code getContentLength}
+ * <li>{@code getContentType}
+ * <li>{@code getDate}
+ * <li>{@code getExpiration}
+ * <li>{@code getLastModifed}
* </ul>
* <p>
* provide convenient access to these fields. The
- * <code>getContentType</code> method is used by the
- * <code>getContent</code> method to determine the type of the remote
+ * {@code getContentType} method is used by the
+ * {@code getContent} method to determine the type of the remote
* object; subclasses may find it convenient to override the
- * <code>getContentType</code> method.
+ * {@code getContentType} method.
* <p>
* In the common case, all of the pre-connection parameters and
* general request properties can be ignored: the pre-connection
* parameters and request properties default to sensible values. For
* most clients of this interface, there are only two interesting
- * methods: <code>getInputStream</code> and <code>getContent</code>,
- * which are mirrored in the <code>URL</code> class by convenience methods.
+ * methods: {@code getInputStream} and {@code getContent},
+ * which are mirrored in the {@code URL} class by convenience methods.
* <p>
* More information on the request properties and header fields of
- * an <code>http</code> connection can be found at:
+ * an {@code http} connection can be found at:
* <blockquote><pre>
* <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>
* </pre></blockquote>
*
- * Note about <code>fileNameMap</code>: In versions prior to JDK 1.1.6,
- * field <code>fileNameMap</code> of <code>URLConnection</code> was public.
- * In JDK 1.1.6 and later, <code>fileNameMap</code> is private; accessor
- * and mutator methods {@link #getFileNameMap() getFileNameMap} and
- * {@link #setFileNameMap(java.net.FileNameMap) setFileNameMap} are added
- * to access it. This change is also described on the <a href=
- * "http://java.sun.com/products/jdk/1.2/compatibility.html">
- * Compatibility</a> page.
- *
- * Invoking the <tt>close()</tt> methods on the <tt>InputStream</tt> or <tt>OutputStream</tt> of an
- * <tt>URLConnection</tt> after a request may free network resources associated with this
+ * Invoking the {@code close()} methods on the {@code InputStream} or {@code OutputStream} of an
+ * {@code URLConnection} after a request may free network resources associated with this
* instance, unless particular protocol specifications specify different behaviours
* for it.
*
@@ -174,10 +165,10 @@
* which this connection is opened.
* <p>
* The value of this field can be accessed by the
- * <code>getURL</code> method.
+ * {@code getURL} method.
* <p>
* The default value of this variable is the value of the URL
- * argument in the <code>URLConnection</code> constructor.
+ * argument in the {@code URLConnection} constructor.
*
* @see java.net.URLConnection#getURL()
* @see java.net.URLConnection#url
@@ -185,14 +176,14 @@
protected URL url;
/**
- * This variable is set by the <code>setDoInput</code> method. Its
- * value is returned by the <code>getDoInput</code> method.
+ * This variable is set by the {@code setDoInput} method. Its
+ * value is returned by the {@code getDoInput} method.
* <p>
* A URL connection can be used for input and/or output. Setting the
- * <code>doInput</code> flag to <code>true</code> indicates that
+ * {@code doInput} flag to {@code true} indicates that
* the application intends to read data from the URL connection.
* <p>
- * The default value of this field is <code>true</code>.
+ * The default value of this field is {@code true}.
*
* @see java.net.URLConnection#getDoInput()
* @see java.net.URLConnection#setDoInput(boolean)
@@ -200,14 +191,14 @@
protected boolean doInput = true;
/**
- * This variable is set by the <code>setDoOutput</code> method. Its
- * value is returned by the <code>getDoOutput</code> method.
+ * This variable is set by the {@code setDoOutput} method. Its
+ * value is returned by the {@code getDoOutput} method.
* <p>
* A URL connection can be used for input and/or output. Setting the
- * <code>doOutput</code> flag to <code>true</code> indicates
+ * {@code doOutput} flag to {@code true} indicates
* that the application intends to write data to the URL connection.
* <p>
- * The default value of this field is <code>false</code>.
+ * The default value of this field is {@code false}.
*
* @see java.net.URLConnection#getDoOutput()
* @see java.net.URLConnection#setDoOutput(boolean)
@@ -217,17 +208,17 @@
private static boolean defaultAllowUserInteraction = false;
/**
- * If <code>true</code>, this <code>URL</code> is being examined in
+ * If {@code true}, this {@code URL} is being examined in
* a context in which it makes sense to allow user interactions such
- * as popping up an authentication dialog. If <code>false</code>,
+ * as popping up an authentication dialog. If {@code false},
* then no user interaction is allowed.
* <p>
* The value of this field can be set by the
- * <code>setAllowUserInteraction</code> method.
+ * {@code setAllowUserInteraction} method.
* Its value is returned by the
- * <code>getAllowUserInteraction</code> method.
+ * {@code getAllowUserInteraction} method.
* Its default value is the value of the argument in the last invocation
- * of the <code>setDefaultAllowUserInteraction</code> method.
+ * of the {@code setDefaultAllowUserInteraction} method.
*
* @see java.net.URLConnection#getAllowUserInteraction()
* @see java.net.URLConnection#setAllowUserInteraction(boolean)
@@ -238,15 +229,15 @@
private static boolean defaultUseCaches = true;
/**
- * If <code>true</code>, the protocol is allowed to use caching
- * whenever it can. If <code>false</code>, the protocol must always
+ * If {@code true}, the protocol is allowed to use caching
+ * whenever it can. If {@code false}, the protocol must always
* try to get a fresh copy of the object.
* <p>
- * This field is set by the <code>setUseCaches</code> method. Its
- * value is returned by the <code>getUseCaches</code> method.
+ * This field is set by the {@code setUseCaches} method. Its
+ * value is returned by the {@code getUseCaches} method.
* <p>
* Its default value is the value given in the last invocation of the
- * <code>setDefaultUseCaches</code> method.
+ * {@code setDefaultUseCaches} method.
*
* @see java.net.URLConnection#setUseCaches(boolean)
* @see java.net.URLConnection#getUseCaches()
@@ -262,11 +253,11 @@
* January 1, 1970, GMT. The object is fetched only if it has been
* modified more recently than that time.
* <p>
- * This variable is set by the <code>setIfModifiedSince</code>
+ * This variable is set by the {@code setIfModifiedSince}
* method. Its value is returned by the
- * <code>getIfModifiedSince</code> method.
+ * {@code getIfModifiedSince} method.
* <p>
- * The default value of this field is <code>0</code>, indicating
+ * The default value of this field is {@code 0}, indicating
* that the fetching must always occur.
*
* @see java.net.URLConnection#getIfModifiedSince()
@@ -275,8 +266,8 @@
protected long ifModifiedSince = 0;
/**
- * If <code>false</code>, this connection object has not created a
- * communications link to the specified URL. If <code>true</code>,
+ * If {@code false}, this connection object has not created a
+ * communications link to the specified URL. If {@code true},
* the communications link has been established.
*/
protected boolean connected = false;
@@ -301,8 +292,7 @@
* Loads filename map (a mimetable) from a data file. It will
* first try to load the user-specific table, defined
* by "content.types.user.table" property. If that fails,
- * it tries to load the default built-in table at
- * lib/content-types.properties under java home.
+ * it tries to load the default built-in table.
*
* @return the FileNameMap
* @since 1.2
@@ -319,13 +309,13 @@
* Sets the FileNameMap.
* <p>
* If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param map the FileNameMap to be set
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow the operation.
+ * {@code checkSetFactory} method doesn't allow the operation.
* @see SecurityManager#checkSetFactory
* @see #getFileNameMap()
* @since 1.2
@@ -340,9 +330,9 @@
* Opens a communications link to the resource referenced by this
* URL, if such a connection has not already been established.
* <p>
- * If the <code>connect</code> method is called when the connection
- * has already been opened (indicated by the <code>connected</code>
- * field having the value <code>true</code>), the call is ignored.
+ * If the {@code connect} method is called when the connection
+ * has already been opened (indicated by the {@code connected}
+ * field having the value {@code true}), the call is ignored.
* <p>
* URLConnection objects go through two phases: first they are
* created, then they are connected. After being created, and
@@ -370,11 +360,11 @@
* java.net.SocketTimeoutException is raised. A timeout of zero is
* interpreted as an infinite timeout.
- * <p> Some non-standard implmentation of this method may ignore
+ * <p> Some non-standard implementation of this method may ignore
* the specified timeout. To see the connect timeout set, please
* call getConnectTimeout().
*
- * @param timeout an <code>int</code> that specifies the connect
+ * @param timeout an {@code int} that specifies the connect
* timeout value in milliseconds
* @throws IllegalArgumentException if the timeout parameter is negative
*
@@ -395,7 +385,7 @@
* 0 return implies that the option is disabled
* (i.e., timeout of infinity).
*
- * @return an <code>int</code> that indicates the connect timeout
+ * @return an {@code int} that indicates the connect timeout
* value in milliseconds
* @see #setConnectTimeout(int)
* @see #connect()
@@ -417,7 +407,7 @@
* specified timeout. To see the read timeout set, please call
* getReadTimeout().
*
- * @param timeout an <code>int</code> that specifies the timeout
+ * @param timeout an {@code int} that specifies the timeout
* value to be used in milliseconds
* @throws IllegalArgumentException if the timeout parameter is negative
*
@@ -436,7 +426,7 @@
* Returns setting for read timeout. 0 return implies that the
* option is disabled (i.e., timeout of infinity).
*
- * @return an <code>int</code> that indicates the read timeout
+ * @return an {@code int} that indicates the read timeout
* value in milliseconds
*
* @see #setReadTimeout(int)
@@ -458,10 +448,10 @@
}
/**
- * Returns the value of this <code>URLConnection</code>'s <code>URL</code>
+ * Returns the value of this {@code URLConnection}'s {@code URL}
* field.
*
- * @return the value of this <code>URLConnection</code>'s <code>URL</code>
+ * @return the value of this {@code URLConnection}'s {@code URL}
* field.
* @see java.net.URLConnection#url
*/
@@ -470,7 +460,7 @@
}
/**
- * Returns the value of the <code>content-length</code> header field.
+ * Returns the value of the {@code content-length} header field.
* <P>
* <B>Note</B>: {@link #getContentLengthLong() getContentLengthLong()}
* should be preferred over this method, since it returns a {@code long}
@@ -488,11 +478,11 @@
}
/**
- * Returns the value of the <code>content-length</code> header field as a
+ * Returns the value of the {@code content-length} header field as a
* long.
*
* @return the content length of the resource that this connection's URL
- * references, or <code>-1</code> if the content length is
+ * references, or {@code -1} if the content length is
* not known.
* @since 7.0
*/
@@ -501,10 +491,10 @@
}
/**
- * Returns the value of the <code>content-type</code> header field.
+ * Returns the value of the {@code content-type} header field.
*
* @return the content type of the resource that the URL references,
- * or <code>null</code> if not known.
+ * or {@code null} if not known.
* @see java.net.URLConnection#getHeaderField(java.lang.String)
*/
public String getContentType() {
@@ -512,10 +502,10 @@
}
/**
- * Returns the value of the <code>content-encoding</code> header field.
+ * Returns the value of the {@code content-encoding} header field.
*
* @return the content encoding of the resource that the URL references,
- * or <code>null</code> if not known.
+ * or {@code null} if not known.
* @see java.net.URLConnection#getHeaderField(java.lang.String)
*/
public String getContentEncoding() {
@@ -523,7 +513,7 @@
}
/**
- * Returns the value of the <code>expires</code> header field.
+ * Returns the value of the {@code expires} header field.
*
* @return the expiration date of the resource that this URL references,
* or 0 if not known. The value is the number of milliseconds since
@@ -535,10 +525,10 @@
}
/**
- * Returns the value of the <code>date</code> header field.
+ * Returns the value of the {@code date} header field.
*
* @return the sending date of the resource that the URL references,
- * or <code>0</code> if not known. The value returned is the
+ * or {@code 0} if not known. The value returned is the
* number of milliseconds since January 1, 1970 GMT.
* @see java.net.URLConnection#getHeaderField(java.lang.String)
*/
@@ -547,11 +537,11 @@
}
/**
- * Returns the value of the <code>last-modified</code> header field.
+ * Returns the value of the {@code last-modified} header field.
* The result is the number of milliseconds since January 1, 1970 GMT.
*
* @return the date the resource referenced by this
- * <code>URLConnection</code> was last modified, or 0 if not known.
+ * {@code URLConnection} was last modified, or 0 if not known.
* @see java.net.URLConnection#getHeaderField(java.lang.String)
*/
public long getLastModified() {
@@ -566,7 +556,7 @@
*
*
* @param name the name of a header field.
- * @return the value of the named header field, or <code>null</code>
+ * @return the value of the named header field, or {@code null}
* if there is no such field in the header.
*/
public String getHeaderField(String name) {
@@ -584,21 +574,21 @@
* @since 1.4
*/
public Map<String,List<String>> getHeaderFields() {
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
/**
* Returns the value of the named field parsed as a number.
* <p>
- * This form of <code>getHeaderField</code> exists because some
- * connection types (e.g., <code>http-ng</code>) have pre-parsed
+ * This form of {@code getHeaderField} exists because some
+ * connection types (e.g., {@code http-ng}) have pre-parsed
* headers. Classes for that connection type can override this method
* and short-circuit the parsing.
*
* @param name the name of the header field.
* @param Default the default value.
* @return the value of the named field, parsed as an integer. The
- * <code>Default</code> value is returned if the field is
+ * {@code Default} value is returned if the field is
* missing or malformed.
*/
public int getHeaderFieldInt(String name, int Default) {
@@ -612,15 +602,15 @@
/**
* Returns the value of the named field parsed as a number.
* <p>
- * This form of <code>getHeaderField</code> exists because some
- * connection types (e.g., <code>http-ng</code>) have pre-parsed
+ * This form of {@code getHeaderField} exists because some
+ * connection types (e.g., {@code http-ng}) have pre-parsed
* headers. Classes for that connection type can override this method
* and short-circuit the parsing.
*
* @param name the name of the header field.
* @param Default the default value.
* @return the value of the named field, parsed as a long. The
- * <code>Default</code> value is returned if the field is
+ * {@code Default} value is returned if the field is
* missing or malformed.
* @since 7.0
*/
@@ -637,17 +627,18 @@
* The result is the number of milliseconds since January 1, 1970 GMT
* represented by the named field.
* <p>
- * This form of <code>getHeaderField</code> exists because some
- * connection types (e.g., <code>http-ng</code>) have pre-parsed
+ * This form of {@code getHeaderField} exists because some
+ * connection types (e.g., {@code http-ng}) have pre-parsed
* headers. Classes for that connection type can override this method
* and short-circuit the parsing.
*
* @param name the name of the header field.
* @param Default a default value.
* @return the value of the field, parsed as a date. The value of the
- * <code>Default</code> argument is returned if the field is
+ * {@code Default} argument is returned if the field is
* missing or malformed.
*/
+ @SuppressWarnings("deprecation")
public long getHeaderFieldDate(String name, long Default) {
String value = getHeaderField(name);
try {
@@ -657,12 +648,12 @@
}
/**
- * Returns the key for the <code>n</code><sup>th</sup> header field.
- * It returns <code>null</code> if there are fewer than <code>n+1</code> fields.
+ * Returns the key for the {@code n}<sup>th</sup> header field.
+ * It returns {@code null} if there are fewer than {@code n+1} fields.
*
* @param n an index, where n>=0
- * @return the key for the <code>n</code><sup>th</sup> header field,
- * or <code>null</code> if there are fewer than <code>n+1</code>
+ * @return the key for the {@code n}<sup>th</sup> header field,
+ * or {@code null} if there are fewer than {@code n+1}
* fields.
*/
public String getHeaderFieldKey(int n) {
@@ -670,17 +661,17 @@
}
/**
- * Returns the value for the <code>n</code><sup>th</sup> header field.
- * It returns <code>null</code> if there are fewer than
- * <code>n+1</code>fields.
+ * Returns the value for the {@code n}<sup>th</sup> header field.
+ * It returns {@code null} if there are fewer than
+ * {@code n+1}fields.
* <p>
* This method can be used in conjunction with the
* {@link #getHeaderFieldKey(int) getHeaderFieldKey} method to iterate through all
* the headers in the message.
*
* @param n an index, where n>=0
- * @return the value of the <code>n</code><sup>th</sup> header field
- * or <code>null</code> if there are fewer than <code>n+1</code> fields
+ * @return the value of the {@code n}<sup>th</sup> header field
+ * or {@code null} if there are fewer than {@code n+1} fields
* @see java.net.URLConnection#getHeaderFieldKey(int)
*/
public String getHeaderField(int n) {
@@ -691,35 +682,35 @@
* Retrieves the contents of this URL connection.
* <p>
* This method first determines the content type of the object by
- * calling the <code>getContentType</code> method. If this is
+ * calling the {@code getContentType} method. If this is
* the first time that the application has seen that specific content
* type, a content handler for that content type is created:
* <ol>
* <li>If the application has set up a content handler factory instance
- * using the <code>setContentHandlerFactory</code> method, the
- * <code>createContentHandler</code> method of that instance is called
+ * using the {@code setContentHandlerFactory} method, the
+ * {@code createContentHandler} method of that instance is called
* with the content type as an argument; the result is a content
* handler for that content type.
* <li>If no content handler factory has yet been set up, or if the
- * factory's <code>createContentHandler</code> method returns
- * <code>null</code>, then the application loads the class named:
+ * factory's {@code createContentHandler} method returns
+ * {@code null}, then the application loads the class named:
* <blockquote><pre>
* sun.net.www.content.<<i>contentType</i>>
* </pre></blockquote>
* where <<i>contentType</i>> is formed by taking the
* content-type string, replacing all slash characters with a
- * <code>period</code> ('.'), and all other non-alphanumeric characters
- * with the underscore character '<code>_</code>'. The alphanumeric
+ * {@code period} ('.'), and all other non-alphanumeric characters
+ * with the underscore character '{@code _}'. The alphanumeric
* characters are specifically the 26 uppercase ASCII letters
- * '<code>A</code>' through '<code>Z</code>', the 26 lowercase ASCII
- * letters '<code>a</code>' through '<code>z</code>', and the 10 ASCII
- * digits '<code>0</code>' through '<code>9</code>'. If the specified
+ * '{@code A}' through '{@code Z}', the 26 lowercase ASCII
+ * letters '{@code a}' through '{@code z}', and the 10 ASCII
+ * digits '{@code 0}' through '{@code 9}'. If the specified
* class does not exist, or is not a subclass of
- * <code>ContentHandler</code>, then an
- * <code>UnknownServiceException</code> is thrown.
+ * {@code ContentHandler}, then an
+ * {@code UnknownServiceException} is thrown.
* </ol>
*
- * @return the object fetched. The <code>instanceof</code> operator
+ * @return the object fetched. The {@code instanceof} operator
* should be used to determine the specific kind of object
* returned.
* @exception IOException if an I/O error occurs while
@@ -741,12 +732,12 @@
/**
* Retrieves the contents of this URL connection.
*
- * @param classes the <code>Class</code> array
+ * @param classes the {@code Class} array
* indicating the requested types
* @return the object fetched that is the first match of the type
* specified in the classes array. null if none of
* the requested types are supported.
- * The <code>instanceof</code> operator should be used to
+ * The {@code instanceof} operator should be used to
* determine the specific kind of object returned.
* @exception IOException if an I/O error occurs while
* getting the content.
@@ -771,12 +762,12 @@
* necessary to make the connection represented by this
* object. This method returns null if no permission is
* required to make the connection. By default, this method
- * returns <code>java.security.AllPermission</code>. Subclasses
+ * returns {@code java.security.AllPermission}. Subclasses
* should override this method and return the permission
* that best represents the permission required to make a
- * a connection to the URL. For example, a <code>URLConnection</code>
- * representing a <code>file:</code> URL would return a
- * <code>java.io.FilePermission</code> object.
+ * a connection to the URL. For example, a {@code URLConnection}
+ * representing a {@code file:} URL would return a
+ * {@code java.io.FilePermission} object.
*
* <p>The permission returned may dependent upon the state of the
* connection. For example, the permission before connecting may be
@@ -842,17 +833,17 @@
}
/**
- * Returns a <code>String</code> representation of this URL connection.
+ * Returns a {@code String} representation of this URL connection.
*
- * @return a string representation of this <code>URLConnection</code>.
+ * @return a string representation of this {@code URLConnection}.
*/
public String toString() {
return this.getClass().getName() + ":" + url;
}
/**
- * Sets the value of the <code>doInput</code> field for this
- * <code>URLConnection</code> to the specified value.
+ * Sets the value of the {@code doInput} field for this
+ * {@code URLConnection} to the specified value.
* <p>
* A URL connection can be used for input and/or output. Set the DoInput
* flag to true if you intend to use the URL connection for input,
@@ -870,11 +861,11 @@
}
/**
- * Returns the value of this <code>URLConnection</code>'s
- * <code>doInput</code> flag.
+ * Returns the value of this {@code URLConnection}'s
+ * {@code doInput} flag.
*
- * @return the value of this <code>URLConnection</code>'s
- * <code>doInput</code> flag.
+ * @return the value of this {@code URLConnection}'s
+ * {@code doInput} flag.
* @see #setDoInput(boolean)
*/
public boolean getDoInput() {
@@ -882,8 +873,8 @@
}
/**
- * Sets the value of the <code>doOutput</code> field for this
- * <code>URLConnection</code> to the specified value.
+ * Sets the value of the {@code doOutput} field for this
+ * {@code URLConnection} to the specified value.
* <p>
* A URL connection can be used for input and/or output. Set the DoOutput
* flag to true if you intend to use the URL connection for output,
@@ -900,11 +891,11 @@
}
/**
- * Returns the value of this <code>URLConnection</code>'s
- * <code>doOutput</code> flag.
+ * Returns the value of this {@code URLConnection}'s
+ * {@code doOutput} flag.
*
- * @return the value of this <code>URLConnection</code>'s
- * <code>doOutput</code> flag.
+ * @return the value of this {@code URLConnection}'s
+ * {@code doOutput} flag.
* @see #setDoOutput(boolean)
*/
public boolean getDoOutput() {
@@ -912,8 +903,8 @@
}
/**
- * Set the value of the <code>allowUserInteraction</code> field of
- * this <code>URLConnection</code>.
+ * Set the value of the {@code allowUserInteraction} field of
+ * this {@code URLConnection}.
*
* @param allowuserinteraction the new value.
* @throws IllegalStateException if already connected
@@ -926,10 +917,10 @@
}
/**
- * Returns the value of the <code>allowUserInteraction</code> field for
+ * Returns the value of the {@code allowUserInteraction} field for
* this object.
*
- * @return the value of the <code>allowUserInteraction</code> field for
+ * @return the value of the {@code allowUserInteraction} field for
* this object.
* @see #setAllowUserInteraction(boolean)
*/
@@ -939,8 +930,8 @@
/**
* Sets the default value of the
- * <code>allowUserInteraction</code> field for all future
- * <code>URLConnection</code> objects to the specified value.
+ * {@code allowUserInteraction} field for all future
+ * {@code URLConnection} objects to the specified value.
*
* @param defaultallowuserinteraction the new value.
* @see #getDefaultAllowUserInteraction()
@@ -950,14 +941,14 @@
}
/**
- * Returns the default value of the <code>allowUserInteraction</code>
+ * Returns the default value of the {@code allowUserInteraction}
* field.
* <p>
* Ths default is "sticky", being a part of the static state of all
* URLConnections. This flag applies to the next, and all following
* URLConnections that are created.
*
- * @return the default value of the <code>allowUserInteraction</code>
+ * @return the default value of the {@code allowUserInteraction}
* field.
* @see #setDefaultAllowUserInteraction(boolean)
*/
@@ -966,8 +957,8 @@
}
/**
- * Sets the value of the <code>useCaches</code> field of this
- * <code>URLConnection</code> to the specified value.
+ * Sets the value of the {@code useCaches} field of this
+ * {@code URLConnection} to the specified value.
* <p>
* Some protocols do caching of documents. Occasionally, it is important
* to be able to "tunnel through" and ignore the caches (e.g., the
@@ -977,7 +968,7 @@
* The default value comes from DefaultUseCaches, which defaults to
* true.
*
- * @param usecaches a <code>boolean</code> indicating whether
+ * @param usecaches a {@code boolean} indicating whether
* or not to allow caching
* @throws IllegalStateException if already connected
* @see #getUseCaches()
@@ -989,11 +980,11 @@
}
/**
- * Returns the value of this <code>URLConnection</code>'s
- * <code>useCaches</code> field.
+ * Returns the value of this {@code URLConnection}'s
+ * {@code useCaches} field.
*
- * @return the value of this <code>URLConnection</code>'s
- * <code>useCaches</code> field.
+ * @return the value of this {@code URLConnection}'s
+ * {@code useCaches} field.
* @see #setUseCaches(boolean)
*/
public boolean getUseCaches() {
@@ -1001,8 +992,8 @@
}
/**
- * Sets the value of the <code>ifModifiedSince</code> field of
- * this <code>URLConnection</code> to the specified value.
+ * Sets the value of the {@code ifModifiedSince} field of
+ * this {@code URLConnection} to the specified value.
*
* @param ifmodifiedsince the new value.
* @throws IllegalStateException if already connected
@@ -1015,9 +1006,9 @@
}
/**
- * Returns the value of this object's <code>ifModifiedSince</code> field.
+ * Returns the value of this object's {@code ifModifiedSince} field.
*
- * @return the value of this object's <code>ifModifiedSince</code> field.
+ * @return the value of this object's {@code ifModifiedSince} field.
* @see #setIfModifiedSince(long)
*/
public long getIfModifiedSince() {
@@ -1025,15 +1016,15 @@
}
/**
- * Returns the default value of a <code>URLConnection</code>'s
- * <code>useCaches</code> flag.
+ * Returns the default value of a {@code URLConnection}'s
+ * {@code useCaches} flag.
* <p>
* Ths default is "sticky", being a part of the static state of all
* URLConnections. This flag applies to the next, and all following
* URLConnections that are created.
*
- * @return the default value of a <code>URLConnection</code>'s
- * <code>useCaches</code> flag.
+ * @return the default value of a {@code URLConnection}'s
+ * {@code useCaches} flag.
* @see #setDefaultUseCaches(boolean)
*/
public boolean getDefaultUseCaches() {
@@ -1041,7 +1032,7 @@
}
/**
- * Sets the default value of the <code>useCaches</code> field to the
+ * Sets the default value of the {@code useCaches} field to the
* specified value.
*
* @param defaultusecaches the new value.
@@ -1057,11 +1048,11 @@
*
* <p> NOTE: HTTP requires all request properties which can
* legally have multiple instances with the same key
- * to use a comma-seperated list syntax which enables multiple
+ * to use a comma-separated list syntax which enables multiple
* properties to be appended into a single property.
*
* @param key the keyword by which the request is known
- * (e.g., "<code>Accept</code>").
+ * (e.g., "{@code Accept}").
* @param value the value associated with it.
* @throws IllegalStateException if already connected
* @throws NullPointerException if key is <CODE>null</CODE>
@@ -1085,7 +1076,7 @@
* existing values associated with the same key.
*
* @param key the keyword by which the request is known
- * (e.g., "<code>Accept</code>").
+ * (e.g., "{@code Accept}").
* @param value the value associated with it.
* @throws IllegalStateException if already connected
* @throws NullPointerException if key is null
@@ -1142,18 +1133,18 @@
throw new IllegalStateException("Already connected");
if (requests == null)
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
return requests.getHeaders(null);
}
/**
* Sets the default value of a general request property. When a
- * <code>URLConnection</code> is created, it is initialized with
+ * {@code URLConnection} is created, it is initialized with
* these properties.
*
* @param key the keyword by which the request is known
- * (e.g., "<code>Accept</code>").
+ * (e.g., "{@code Accept}").
* @param value the value associated with the key.
*
* @see java.net.URLConnection#setRequestProperty(java.lang.String,java.lang.String)
@@ -1195,21 +1186,21 @@
static ContentHandlerFactory factory;
/**
- * Sets the <code>ContentHandlerFactory</code> of an
+ * Sets the {@code ContentHandlerFactory} of an
* application. It can be called at most once by an application.
* <p>
- * The <code>ContentHandlerFactory</code> instance is used to
+ * The {@code ContentHandlerFactory} instance is used to
* construct a content handler from a content type
* <p>
* If there is a security manager, this method first calls
- * the security manager's <code>checkSetFactory</code> method
+ * the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
* @exception Error if the factory has already been defined.
* @exception SecurityException if a security manager exists and its
- * <code>checkSetFactory</code> method doesn't allow the operation.
+ * {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.ContentHandlerFactory
* @see java.net.URLConnection#getContent()
* @see SecurityManager#checkSetFactory
@@ -1229,7 +1220,6 @@
/**
* Gets the Content Handler appropriate for this connection.
- * @param connection the connection to use.
*/
synchronized ContentHandler getContentHandler()
throws IOException
@@ -1380,7 +1370,7 @@
* Tries to determine the content type of an object, based
* on the specified "file" component of a URL.
* This is a convenience method that can be used by
- * subclasses that override the <code>getContentType</code> method.
+ * subclasses that override the {@code getContentType} method.
*
* @param fname a filename.
* @return a guess as to what the content type of the object is,
@@ -1395,16 +1385,16 @@
* Tries to determine the type of an input stream based on the
* characters at the beginning of the input stream. This method can
* be used by subclasses that override the
- * <code>getContentType</code> method.
+ * {@code getContentType} method.
* <p>
* Ideally, this routine would not be needed. But many
- * <code>http</code> servers return the incorrect content type; in
+ * {@code http} servers return the incorrect content type; in
* addition, there are many nonstandard extensions. Direct inspection
* of the bytes to determine the content type is often more accurate
- * than believing the content type claimed by the <code>http</code> server.
+ * than believing the content type claimed by the {@code http} server.
*
* @param is an input stream that supports marks.
- * @return a guess at the content type, or <code>null</code> if none
+ * @return a guess at the content type, or {@code null} if none
* can be determined.
* @exception IOException if an I/O error occurs while reading the
* input stream.
diff --git a/ojluni/src/main/java/java/net/URLDecoder.java b/ojluni/src/main/java/java/net/URLDecoder.java
index fc80bb4..f811d07 100755
--- a/ojluni/src/main/java/java/net/URLDecoder.java
+++ b/ojluni/src/main/java/java/net/URLDecoder.java
@@ -35,27 +35,27 @@
* <p>
* The conversion process is the reverse of that used by the URLEncoder class. It is assumed
* that all characters in the encoded string are one of the following:
- * "<code>a</code>" through "<code>z</code>",
- * "<code>A</code>" through "<code>Z</code>",
- * "<code>0</code>" through "<code>9</code>", and
- * "<code>-</code>", "<code>_</code>",
- * "<code>.</code>", and "<code>*</code>". The
- * character "<code>%</code>" is allowed but is interpreted
+ * "{@code a}" through "{@code z}",
+ * "{@code A}" through "{@code Z}",
+ * "{@code 0}" through "{@code 9}", and
+ * "{@code -}", "{@code _}",
+ * "{@code .}", and "{@code *}". The
+ * character "{@code %}" is allowed but is interpreted
* as the start of a special escaped sequence.
* <p>
* The following rules are applied in the conversion:
- * <p>
+ *
* <ul>
- * <li>The alphanumeric characters "<code>a</code>" through
- * "<code>z</code>", "<code>A</code>" through
- * "<code>Z</code>" and "<code>0</code>"
- * through "<code>9</code>" remain the same.
- * <li>The special characters "<code>.</code>",
- * "<code>-</code>", "<code>*</code>", and
- * "<code>_</code>" remain the same.
- * <li>The plus sign "<code>+</code>" is converted into a
- * space character "<code> </code>" .
- * <li>A sequence of the form "<code>%<i>xy</i></code>" will be
+ * <li>The alphanumeric characters "{@code a}" through
+ * "{@code z}", "{@code A}" through
+ * "{@code Z}" and "{@code 0}"
+ * through "{@code 9}" remain the same.
+ * <li>The special characters "{@code .}",
+ * "{@code -}", "{@code *}", and
+ * "{@code _}" remain the same.
+ * <li>The plus sign "{@code +}" is converted into a
+ * space character " " .
+ * <li>A sequence of the form "<i>{@code %xy}</i>" will be
* treated as representing a byte where <i>xy</i> is the two-digit
* hexadecimal representation of the 8 bits. Then, all substrings
* that contain one or more of these byte sequences consecutively
@@ -67,7 +67,7 @@
* <p>
* There are two possible ways in which this decoder could deal with
* illegal strings. It could either leave illegal characters alone or
- * it could throw an <tt>{@link java.lang.IllegalArgumentException}</tt>.
+ * it could throw an {@code {@link java.lang.IllegalArgumentException}}.
* Which approach the decoder takes is left to the
* implementation.
*
@@ -82,15 +82,15 @@
static String dfltEncName = URLEncoder.dfltEncName;
/**
- * Decodes a <code>x-www-form-urlencoded</code> string.
+ * Decodes a {@code x-www-form-urlencoded} string.
* The platform's default encoding is used to determine what characters
* are represented by any consecutive sequences of the form
- * "<code>%<i>xy</i></code>".
- * @param s the <code>String</code> to decode
+ * "<i>{@code %xy}</i>".
+ * @param s the {@code String} to decode
* @deprecated The resulting string may vary depending on the platform's
* default encoding. Instead, use the decode(String,String) method
* to specify the encoding.
- * @return the newly decoded <code>String</code>
+ * @return the newly decoded {@code String}
*/
@Deprecated
public static String decode(String s) {
@@ -107,23 +107,23 @@
}
/**
- * Decodes a <code>application/x-www-form-urlencoded</code> string using a specific
+ * Decodes a {@code application/x-www-form-urlencoded} string using a specific
* encoding scheme.
* The supplied encoding is used to determine
* what characters are represented by any consecutive sequences of the
- * form "<code>%<i>xy</i></code>".
+ * form "<i>{@code %xy}</i>".
* <p>
* <em><strong>Note:</strong> The <a href=
* "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars">
* World Wide Web Consortium Recommendation</a> states that
* UTF-8 should be used. Not doing so may introduce
- * incompatibilites.</em>
+ * incompatibilities.</em>
*
- * @param s the <code>String</code> to decode
+ * @param s the {@code String} to decode
* @param enc The name of a supported
* <a href="../lang/package-summary.html#charenc">character
* encoding</a>.
- * @return the newly decoded <code>String</code>
+ * @return the newly decoded {@code String}
* @exception UnsupportedEncodingException
* If character encoding needs to be consulted, but
* named character encoding is not supported
diff --git a/ojluni/src/main/java/java/net/URLEncoder.java b/ojluni/src/main/java/java/net/URLEncoder.java
index 68fca8c..86377b7 100755
--- a/ojluni/src/main/java/java/net/URLEncoder.java
+++ b/ojluni/src/main/java/java/net/URLEncoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -49,21 +49,20 @@
* <p>
* When encoding a String, the following rules apply:
*
- * <p>
* <ul>
- * <li>The alphanumeric characters "<code>a</code>" through
- * "<code>z</code>", "<code>A</code>" through
- * "<code>Z</code>" and "<code>0</code>"
- * through "<code>9</code>" remain the same.
- * <li>The special characters "<code>.</code>",
- * "<code>-</code>", "<code>*</code>", and
- * "<code>_</code>" remain the same.
- * <li>The space character "<code> </code>" is
- * converted into a plus sign "<code>+</code>".
+ * <li>The alphanumeric characters "{@code a}" through
+ * "{@code z}", "{@code A}" through
+ * "{@code Z}" and "{@code 0}"
+ * through "{@code 9}" remain the same.
+ * <li>The special characters "{@code .}",
+ * "{@code -}", "{@code *}", and
+ * "{@code _}" remain the same.
+ * <li>The space character " " is
+ * converted into a plus sign "{@code +}".
* <li>All other characters are unsafe and are first converted into
* one or more bytes using some encoding scheme. Then each byte is
* represented by the 3-character string
- * "<code>%<i>xy</i></code>", where <i>xy</i> is the
+ * "<i>{@code %xy}</i>", where <i>xy</i> is the
* two-digit hexadecimal representation of the byte.
* The recommended encoding scheme to use is UTF-8. However,
* for compatibility reasons, if an encoding is not specified,
@@ -152,15 +151,15 @@
private URLEncoder() { }
/**
- * Translates a string into <code>x-www-form-urlencoded</code>
+ * Translates a string into {@code x-www-form-urlencoded}
* format. This method uses the platform's default encoding
* as the encoding scheme to obtain the bytes for unsafe characters.
*
- * @param s <code>String</code> to be translated.
+ * @param s {@code String} to be translated.
* @deprecated The resulting string may vary depending on the platform's
* default encoding. Instead, use the encode(String,String)
* method to specify the encoding.
- * @return the translated <code>String</code>.
+ * @return the translated {@code String}.
*/
@Deprecated
public static String encode(String s) {
@@ -177,7 +176,7 @@
}
/**
- * Translates a string into <code>application/x-www-form-urlencoded</code>
+ * Translates a string into {@code application/x-www-form-urlencoded}
* format using a specific encoding scheme. This method uses the
* supplied encoding scheme to obtain the bytes for unsafe
* characters.
@@ -186,13 +185,13 @@
* "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars">
* World Wide Web Consortium Recommendation</a> states that
* UTF-8 should be used. Not doing so may introduce
- * incompatibilites.</em>
+ * incompatibilities.</em>
*
- * @param s <code>String</code> to be translated.
+ * @param s {@code String} to be translated.
* @param enc The name of a supported
* <a href="../lang/package-summary.html#charenc">character
* encoding</a>.
- * @return the translated <code>String</code>.
+ * @return the translated {@code String}.
* @exception UnsupportedEncodingException
* If the named encoding is not supported
* @see URLDecoder#decode(java.lang.String, java.lang.String)
diff --git a/ojluni/src/main/java/java/net/URLStreamHandler.java b/ojluni/src/main/java/java/net/URLStreamHandler.java
index e177363..445104a7 100755
--- a/ojluni/src/main/java/java/net/URLStreamHandler.java
+++ b/ojluni/src/main/java/java/net/URLStreamHandler.java
@@ -32,16 +32,15 @@
import sun.net.util.IPAddressUtil;
/**
- * The abstract class <code>URLStreamHandler</code> is the common
+ * The abstract class {@code URLStreamHandler} is the common
* superclass for all stream protocol handlers. A stream protocol
* handler knows how to make a connection for a particular protocol
- * type, such as <code>http</code>, <code>ftp</code>, or
- * <code>gopher</code>.
+ * type, such as {@code http} or {@code https}.
* <p>
- * In most cases, an instance of a <code>URLStreamHandler</code>
+ * In most cases, an instance of a {@code URLStreamHandler}
* subclass is not created directly by an application. Rather, the
* first time a protocol name is encountered when constructing a
- * <code>URL</code>, the appropriate stream protocol handler is
+ * {@code URL}, the appropriate stream protocol handler is
* automatically loaded.
*
* @author James Gosling
@@ -51,7 +50,7 @@
public abstract class URLStreamHandler {
/**
* Opens a connection to the object referenced by the
- * <code>URL</code> argument.
+ * {@code URL} argument.
* This method should be overridden by a subclass.
*
* <p>If for the handler's protocol (such as HTTP or JAR), there
@@ -63,7 +62,7 @@
* JarURLConnection will be returned.
*
* @param u the URL that this connects to.
- * @return a <code>URLConnection</code> object for the <code>URL</code>.
+ * @return a {@code URLConnection} object for the {@code URL}.
* @exception IOException if an I/O error occurs while opening the
* connection.
*/
@@ -82,7 +81,7 @@
* @param p the proxy through which the connection will be made.
* If direct connection is desired, Proxy.NO_PROXY
* should be specified.
- * @return a <code>URLConnection</code> object for the <code>URL</code>.
+ * @return a {@code URLConnection} object for the {@code URL}.
* @exception IOException if an I/O error occurs while opening the
* connection.
* @exception IllegalArgumentException if either u or p is null,
@@ -96,28 +95,28 @@
}
/**
- * Parses the string representation of a <code>URL</code> into a
- * <code>URL</code> object.
+ * Parses the string representation of a {@code URL} into a
+ * {@code URL} object.
* <p>
* If there is any inherited context, then it has already been
- * copied into the <code>URL</code> argument.
+ * copied into the {@code URL} argument.
* <p>
- * The <code>parseURL</code> method of <code>URLStreamHandler</code>
+ * The {@code parseURL} method of {@code URLStreamHandler}
* parses the string representation as if it were an
- * <code>http</code> specification. Most URL protocol families have a
+ * {@code http} specification. Most URL protocol families have a
* similar parsing. A stream protocol handler for a protocol that has
* a different syntax must override this routine.
*
- * @param u the <code>URL</code> to receive the result of parsing
+ * @param u the {@code URL} to receive the result of parsing
* the spec.
- * @param spec the <code>String</code> representing the URL that
+ * @param spec the {@code String} representing the URL that
* must be parsed.
* @param start the character index at which to begin parsing. This is
- * just past the '<code>:</code>' (if there is one) that
+ * just past the '{@code :}' (if there is one) that
* specifies the determination of the protocol name.
* @param limit the character position to stop parsing at. This is the
* end of the string or the position of the
- * "<code>#</code>" character, if present. All information
+ * "{@code #}" character, if present. All information
* after the sharp sign indicates an anchor.
*/
protected void parseURL(URL u, String spec, int start, int limit) {
@@ -349,7 +348,7 @@
/**
* Returns the default port for a URL parsed by this handler. This method
* is meant to be overidden by handlers with default port numbers.
- * @return the default port for a <code>URL</code> parsed by this handler.
+ * @return the default port for a {@code URL} parsed by this handler.
* @since 1.3
*/
protected int getDefaultPort() {
@@ -363,7 +362,7 @@
* 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 <tt>true</tt> if the two urls are
+ * @return {@code true} if the two urls are
* considered equal, ie. they refer to the same
* fragment in the same file.
* @since 1.3
@@ -381,7 +380,7 @@
* other protocols that have different requirements for hashCode
* calculation.
* @param u a URL object
- * @return an <tt>int</tt> suitable for hash table indexing
+ * @return an {@code int} suitable for hash table indexing
* @since 1.3
*/
protected int hashCode(URL u) {
@@ -437,7 +436,7 @@
* will result in a null return.
*
* @param u a URL object
- * @return an <code>InetAddress</code> representing the host
+ * @return an {@code InetAddress} representing the host
* IP address.
* @since 1.3
*/
@@ -464,8 +463,8 @@
* Compares the host components of two URLs.
* @param u1 the URL of the first host to compare
* @param u2 the URL of the second host to compare
- * @return <tt>true</tt> if and only if they
- * are equal, <tt>false</tt> otherwise.
+ * @return {@code true} if and only if they
+ * are equal, {@code false} otherwise.
* @since 1.3
*/
protected boolean hostsEqual(URL u1, URL u2) {
@@ -477,13 +476,14 @@
}
/**
- * Converts a <code>URL</code> of a specific protocol to a
- * <code>String</code>.
+ * Converts a {@code URL} of a specific protocol to a
+ * {@code String}.
*
* @param u the URL.
- * @return a string representation of the <code>URL</code> argument.
+ * @return a string representation of the {@code URL} argument.
*/
protected String toExternalForm(URL u) {
+
// pre-compute length of StringBuffer
int len = u.getProtocol().length() + 1;
if (u.getAuthority() != null && u.getAuthority().length() > 0)
@@ -516,9 +516,9 @@
}
/**
- * Sets the fields of the <code>URL</code> argument to the indicated values.
- * Only classes derived from URLStreamHandler are supposed to be able
- * to call the set method on a URL.
+ * Sets the fields of the {@code URL} argument to the indicated values.
+ * Only classes derived from URLStreamHandler are able
+ * to use this method to set the values of the URL fields.
*
* @param u the URL to modify.
* @param protocol the protocol name.
@@ -546,9 +546,9 @@
}
/**
- * Sets the fields of the <code>URL</code> argument to the indicated values.
- * Only classes derived from URLStreamHandler are supposed to be able
- * to call the set method on a URL.
+ * Sets the fields of the {@code URL} argument to the indicated values.
+ * Only classes derived from URLStreamHandler are able
+ * to use this method to set the values of the URL fields.
*
* @param u the URL to modify.
* @param protocol the protocol name. This value is ignored since 1.2.
diff --git a/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java b/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java
index 1a58474..e46e028 100755
--- a/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java
+++ b/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -26,11 +26,11 @@
package java.net;
/**
- * This interface defines a factory for <code>URL</code> stream
+ * This interface defines a factory for {@code URL} stream
* protocol handlers.
* <p>
- * It is used by the <code>URL</code> class to create a
- * <code>URLStreamHandler</code> for a specific protocol.
+ * It is used by the {@code URL} class to create a
+ * {@code URLStreamHandler} for a specific protocol.
*
* @author Arthur van Hoff
* @see java.net.URL
@@ -39,12 +39,12 @@
*/
public interface URLStreamHandlerFactory {
/**
- * Creates a new <code>URLStreamHandler</code> instance with the specified
+ * Creates a new {@code URLStreamHandler} instance with the specified
* protocol.
*
- * @param protocol the protocol ("<code>ftp</code>",
- * "<code>http</code>", "<code>nntp</code>", etc.).
- * @return a <code>URLStreamHandler</code> for the specific protocol.
+ * @param protocol the protocol ("{@code ftp}",
+ * "{@code http}", "{@code nntp}", etc.).
+ * @return a {@code URLStreamHandler} for the specific protocol.
* @see java.net.URLStreamHandler
*/
URLStreamHandler createURLStreamHandler(String protocol);
diff --git a/ojluni/src/main/java/java/net/UnknownHostException.java b/ojluni/src/main/java/java/net/UnknownHostException.java
index 0c68c78..21a9d14 100755
--- a/ojluni/src/main/java/java/net/UnknownHostException.java
+++ b/ojluni/src/main/java/java/net/UnknownHostException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -38,7 +38,7 @@
private static final long serialVersionUID = -4639126076052875403L;
/**
- * Constructs a new <code>UnknownHostException</code> with the
+ * Constructs a new {@code UnknownHostException} with the
* specified detail message.
*
* @param host the detail message.
@@ -48,7 +48,7 @@
}
/**
- * Constructs a new <code>UnknownHostException</code> with no detail
+ * Constructs a new {@code UnknownHostException} with no detail
* message.
*/
public UnknownHostException() {
diff --git a/ojluni/src/main/java/java/net/UnknownServiceException.java b/ojluni/src/main/java/java/net/UnknownServiceException.java
index e954ce9..4eea4a7 100755
--- a/ojluni/src/main/java/java/net/UnknownServiceException.java
+++ b/ojluni/src/main/java/java/net/UnknownServiceException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -40,14 +40,14 @@
private static final long serialVersionUID = -4169033248853639508L;
/**
- * Constructs a new <code>UnknownServiceException</code> with no
+ * Constructs a new {@code UnknownServiceException} with no
* detail message.
*/
public UnknownServiceException() {
}
/**
- * Constructs a new <code>UnknownServiceException</code> with the
+ * Constructs a new {@code UnknownServiceException} with the
* specified detail message.
*
* @param msg the detail message.
diff --git a/ojluni/src/main/java/java/net/package-info.java b/ojluni/src/main/java/java/net/package-info.java
new file mode 100644
index 0000000..fda2e4f
--- /dev/null
+++ b/ojluni/src/main/java/java/net/package-info.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 1998, 2013, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the classes for implementing networking applications.
+ *
+ * <p> The java.net package can be roughly divided in two sections:</p>
+ * <ul>
+ * <li><p><i>A Low Level API</i>, which deals with the
+ * following abstractions:</p>
+ * <ul>
+ * <li><p><i>Addresses</i>, which are networking identifiers,
+ * like IP addresses.</p></li>
+ * <li><p><i>Sockets</i>, which are basic bidirectional data communication
+ * mechanisms.</p></li>
+ * <li><p><i>Interfaces</i>, which describe network interfaces. </p></li>
+ * </ul></li>
+ * <li> <p><i>A High Level API</i>, which deals with the following
+ * abstractions:</p>
+ * <ul>
+ * <li><p><i>URIs</i>, which represent
+ * Universal Resource Identifiers.</p></li>
+ * <li><p><i>URLs</i>, which represent
+ * Universal Resource Locators.</p></li>
+ * <li><p><i>Connections</i>, which represents connections to the resource
+ * pointed to by <i>URLs</i>.</p></li>
+ * </ul></li>
+ * </ul>
+ * <h2>Addresses</h2>
+ * <p>Addresses are used throughout the java.net APIs as either host
+ * identifiers, or socket endpoint identifiers.</p>
+ * <p>The {@link java.net.InetAddress} class is the abstraction representing an
+ * IP (Internet Protocol) address. It has two subclasses:
+ * <ul>
+ * <li>{@link java.net.Inet4Address} for IPv4 addresses.</li>
+ * <li>{@link java.net.Inet6Address} for IPv6 addresses.</li>
+ * </ul>
+ * <p>But, in most cases, there is no need to deal directly with the subclasses,
+ * as the InetAddress abstraction should cover most of the needed
+ * functionality.</p>
+ * <h3><b>About IPv6</b></h3>
+ * <p>Not all systems have support for the IPv6 protocol, and while the Java
+ * networking stack will attempt to detect it and use it transparently when
+ * available, it is also possible to disable its use with a system property.
+ * In the case where IPv6 is not available, or explicitly disabled,
+ * Inet6Address are not valid arguments for most networking operations any
+ * more. While methods like {@link java.net.InetAddress#getByName} are
+ * guaranteed not to return an Inet6Address when looking up host names, it
+ * is possible, by passing literals, to create such an object. In which
+ * case, most methods, when called with an Inet6Address will throw an
+ * Exception.</p>
+ * <h2>Sockets</h2>
+ * <p>Sockets are means to establish a communication link between machines over
+ * the network. The java.net package provides 4 kinds of Sockets:</p>
+ * <ul>
+ * <li>{@link java.net.Socket} is a TCP client API, and will typically
+ * be used to {@linkplain java.net.Socket#connect(SocketAddress)
+ * connect} to a remote host.</li>
+ * <li>{@link java.net.ServerSocket} is a TCP server API, and will
+ * typically {@linkplain java.net.ServerSocket#accept accept}
+ * connections from client sockets.</li>
+ * <li>{@link java.net.DatagramSocket} is a UDP endpoint API and is used
+ * to {@linkplain java.net.DatagramSocket#send send} and
+ * {@linkplain java.net.DatagramSocket#receive receive}
+ * {@linkplain java.net.DatagramPacket datagram packets}.</li>
+ * <li>{@link java.net.MulticastSocket} is a subclass of
+ * {@code DatagramSocket} used when dealing with multicast
+ * groups.</li>
+ * </ul>
+ * <p>Sending and receiving with TCP sockets is done through InputStreams and
+ * OutputStreams which can be obtained via the
+ * {@link java.net.Socket#getInputStream} and
+ * {@link java.net.Socket#getOutputStream} methods.</p>
+ * <h2>Interfaces</h2>
+ * <p>The {@link java.net.NetworkInterface} class provides APIs to browse and
+ * query all the networking interfaces (e.g. ethernet connection or PPP
+ * endpoint) of the local machine. It is through that class that you can
+ * check if any of the local interfaces is configured to support IPv6.</p>
+ * <p>Note, all conforming implementations must support at least one
+ * {@code NetworkInterface} object, which must either be connected to a
+ * network, or be a "loopback" interface that can only communicate with
+ * entities on the same machine.</p>
+ *
+ * <h2>High level API</h2>
+ * <p>A number of classes in the java.net package do provide for a much higher
+ * level of abstraction and allow for easy access to resources on the
+ * network. The classes are:
+ * <ul>
+ * <li>{@link java.net.URI} is the class representing a
+ * Universal Resource Identifier, as specified in RFC 2396.
+ * As the name indicates, this is just an Identifier and doesn't
+ * provide directly the means to access the resource.</li>
+ * <li>{@link java.net.URL} is the class representing a
+ * Universal Resource Locator, which is both an older concept for
+ * URIs and a means to access the resources.</li>
+ * <li>{@link java.net.URLConnection} is created from a URL and is the
+ * communication link used to access the resource pointed by the
+ * URL. This abstract class will delegate most of the work to the
+ * underlying protocol handlers like http or https.</li>
+ * <li>{@link java.net.HttpURLConnection} is a subclass of URLConnection
+ * and provides some additional functionalities specific to the
+ * HTTP protocol.</li>
+ * </ul>
+ * <p>The recommended usage is to use {@link java.net.URI} to identify
+ * resources, then convert it into a {@link java.net.URL} when it is time to
+ * access the resource. From that URL, you can either get the
+ * {@link java.net.URLConnection} for fine control, or get directly the
+ * InputStream.
+ * <p>Here is an example:</p>
+ * <pre>
+ * URI uri = new URI("http://java.sun.com/");
+ * URL url = uri.toURL();
+ * InputStream in = url.openStream();
+ * </pre>
+ * <h2>Protocol Handlers</h2>
+ * As mentioned, URL and URLConnection rely on protocol handlers which must be
+ * present, otherwise an Exception is thrown. This is the major difference with
+ * URIs which only identify resources, and therefore don't need to have access
+ * to the protocol handler. So, while it is possible to create an URI with any
+ * kind of protocol scheme (e.g. {@code myproto://myhost.mydomain/resource/}),
+ * a similar URL will try to instantiate the handler for the specified protocol;
+ * if it doesn't exist an exception will be thrown.
+ * <p>By default the protocol handlers are loaded dynamically from the default
+ * location. It is, however, possible to add to the search path by setting
+ * the {@code java.protocol.handler.pkgs} system property. For instance if
+ * it is set to {@code myapp.protocols}, then the URL code will try, in the
+ * case of http, first to load {@code myapp.protocols.http.Handler}, then,
+ * if this fails, {@code http.Handler} from the default location.
+ * <p>Note that the Handler class <b>has to</b> be a subclass of the abstract
+ * class {@link java.net.URLStreamHandler}.</p>
+ * <h2>Additional Specification</h2>
+ * <ul>
+ * <li><a href="doc-files/net-properties.html">
+ * Networking System Properties</a></li>
+ * </ul>
+ *
+ * @since JDK1.0
+ */
+package java.net;
diff --git a/ojluni/src/main/java/java/net/package.html b/ojluni/src/main/java/java/net/package.html
deleted file mode 100755
index c014676..0000000
--- a/ojluni/src/main/java/java/net/package.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
- Copyright (c) 1998, 2011, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Provides the classes for implementing networking applications.
-
-<p> The java.net package can be roughly divided in two sections:</p>
-<ul>
- <li> <p><i>A Low Level API</i>, which deals with the following abstractions:</p>
- <ul>
- <li><p><i>Addresses</i>, which are networking identifiers, like IP addresses.</p></li>
- <li><p><i>Sockets</i>, which are basic bidirectional data communication mechanisms.</p></li>
- <li><p><i>Interfaces</i>, which describe network interfaces. </p></li>
- </ul></li>
- <li> <p><i>A High Level API</i>, which deals with the following abstractions:</p>
- <ul>
- <li><p><i>URIs</i>, which represent Universal Resource Identifiers.</p></li>
- <li><p><i>URLs</i>, which represent Universal Resource Locators.</p></li>
- <li><p><i>Connections</i>, which represents connections to the resource pointed to by <i>URLs</i>.</p></li>
- </ul></li>
-</ul>
-<h2>Addresses</h2>
-<p>Addresses are used throughout the java.net APIs as either host identifiers, or socket endpoint identifiers.</p>
-<p>The {@link java.net.InetAddress} class is the abstraction representing an IP (Internet Protocol) address. It has two subclasses:
-<ul>
- <li>{@link java.net.Inet4Address} for IPv4 addresses.</li>
- <li>{@link java.net.Inet6Address} for IPv6 addresses.</li>
-</ul>
-<p>But, in most cases, there is no need to deal directly with the subclasses, as the InetAddress abstraction should cover most of the needed functionality.</p>
-<h3><b>About IPv6</b></h3>
-<p>Not all systems have support for the IPv6 protocol, and while the Java networking stack will attempt to detect it and use it transparently when available, it is also possible to disable its use with a system property. In the case where IPv6 is not available, or explicitly disabled, Inet6Address are not valid arguments for most networking operations any more. While methods like {@link java.net.InetAddress#getByName} are guaranteed not to return an Inet6Address when looking up host names, it is possible, by passing literals, to create such an object. In which case, most methods, when called with an Inet6Address will throw an Exception.</p>
-<h2>Sockets</h2>
-<p>Sockets are means to establish a communication link between machines over the network. The java.net package provides 4 kinds of Sockets:</p>
-<ul>
- <li>{@link java.net.Socket} is a TCP client API, and will typically be used to {@linkplain java.net.Socket#connect(SocketAddress) connect} to a remote host.</li>
- <li>{@link java.net.ServerSocket} is a TCP server API, and will typically {@linkplain java.net.ServerSocket#accept accept} connections from client sockets.</li>
- <li>{@link java.net.DatagramSocket} is a UDP endpoint API and is used to {@linkplain java.net.DatagramSocket#send send} and {@linkplain java.net.DatagramSocket#receive receive} {@linkplain java.net.DatagramPacket datagram packets}.</li>
- <li>{@link java.net.MulticastSocket} is a subclass of {@code DatagramSocket} used when dealing with multicast groups.</li>
-</ul>
-<p>Sending and receiving with TCP sockets is done through InputStreams and OutputStreams which can be obtained via the {@link java.net.Socket#getInputStream} and {@link java.net.Socket#getOutputStream} methods.</p>
-<h2>Interfaces</h2>
-<p>The {@link java.net.NetworkInterface} class provides APIs to browse and query all the networking interfaces (e.g. ethernet connection or PPP endpoint) of the local machine. It is through that class that you can check if any of the local interfaces is configured to support IPv6.</p>
-
-<h2>High level API</h2>
-<p>A number of classes in the java.net package do provide for a much higher level of abstraction and allow for easy access to resources on the network. The classes are:
-<ul>
- <li>{@link java.net.URI} is the class representing a Universal Resource Identifier, as specified in RFC 2396. As the name indicates, this is just an Identifier and doesn't provide directly the means to access the resource.</li>
- <li>{@link java.net.URL} is the class representing a Universal Resource Locator, which is both an older concept for URIs and a means to access the resources.</li>
- <li>{@link java.net.URLConnection} is created from a URL and is the communication link used to access the resource pointed by the URL. This abstract class will delegate most of the work to the underlying protocol handlers like http or ftp.</li>
- <li>{@link java.net.HttpURLConnection} is a subclass of URLConnection and provides some additional functionalities specific to the HTTP protocol.</li>
-</ul>
-<p>The recommended usage is to use {@link java.net.URI} to identify resources, then convert it into a {@link java.net.URL} when it is time to access the resource. From that URL, you can either get the {@link java.net.URLConnection} for fine control, or get directly the InputStream.<p>
-<p>Here is an example:</p>
-<p><code>
-URI uri = new URI("http://java.sun.com/");<br>
-URL url = uri.toURL();<br>
-InputStream in = url.openStream();
-</code></p>
-<h2>Protocol Handlers</h2>
-As mentioned, URL and URLConnection rely on protocol handlers which must be present, otherwise an Exception is thrown. This is the major difference with URIs which only identify resources, and therefore don't need to have access to the protocol handler. So, while it is possible to create an URI with any kind of protocol scheme (e.g. <code>myproto://myhost.mydomain/resource/</code>), a similar URL will try to instantiate the handler for the specified protocol; if it doesn't exist an exception will be thrown.</p>
-<p>By default the protocol handlers are loaded dynamically from the default location. It is, however, possible to add to the search path by setting the <code>java.protocol.handler.pkgs</code> system property. For instance if it is set to <code>myapp.protocols</code>, then the URL code will try, in the case of http, first to load <code>myapp.protocols.http.Handler</code>, then, if this fails, <code>http.Handler</code> from the default location.<p>
-<p>Note that the Handler class <b>has to</b> be a subclass of the abstract class {@link java.net.URLStreamHandler}.</p>
-<h2>Additional Specification</h2>
-<ul>
- <li><a href="doc-files/net-properties.html">Networking System Properties</a></li>
-</ul>
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
- <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
--->
-
-@since JDK1.0
-</body>
-</html>
diff --git a/openjdk_java_files.mk b/openjdk_java_files.mk
index d71e9fe..fba2e73 100644
--- a/openjdk_java_files.mk
+++ b/openjdk_java_files.mk
@@ -100,6 +100,7 @@
ojluni/src/main/java/java/lang/annotation/ElementType.java \
ojluni/src/main/java/java/lang/annotation/IncompleteAnnotationException.java \
ojluni/src/main/java/java/lang/annotation/Inherited.java \
+ ojluni/src/main/java/java/lang/annotation/Native.java \
ojluni/src/main/java/java/lang/annotation/Retention.java \
ojluni/src/main/java/java/lang/annotation/Repeatable.java \
ojluni/src/main/java/java/lang/annotation/RetentionPolicy.java \
@@ -310,6 +311,7 @@
ojluni/src/main/java/java/net/URL.java \
ojluni/src/main/java/java/net/URLStreamHandlerFactory.java \
ojluni/src/main/java/java/net/URLStreamHandler.java \
+ ojluni/src/main/java/java/net/package-info.java \
ojluni/src/main/java/java/nio/Bits.java \
ojluni/src/main/java/java/nio/Buffer.java \
ojluni/src/main/java/java/nio/BufferOverflowException.java \