diff -r f2358d18923a -r 1d9cb0d080e3 jdk/src/share/classes/java/net/URLConnection.java --- a/jdk/src/share/classes/java/net/URLConnection.java Mon Jul 29 19:36:54 2013 -0700 +++ b/jdk/src/share/classes/java/net/URLConnection.java Tue Jul 30 11:04:19 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2012, 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,15 +40,15 @@ import sun.net.www.MessageHeader; /** - * The abstract class URLConnection 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: *

*

- * - * + * + * * *
openConnection()connect()
{@code openConnection()}{@code connect()}
Manipulate parameters that affect the connection to the remote * resource.Interact with the resource; query header fields and @@ -59,78 +59,78 @@ * *
    *
  1. The connection object is created by invoking the - * openConnection method on a URL. + * {@code openConnection} method on a URL. *
  2. The setup parameters and general request properties are manipulated. *
  3. The actual connection to the remote object is made, using the - * connect method. + * {@code connect} method. *
  4. The remote object becomes available. The header fields and the contents * of the remote object can be accessed. *
*

* The setup parameters are modified using the following methods: *

    - *
  • setAllowUserInteraction - *
  • setDoInput - *
  • setDoOutput - *
  • setIfModifiedSince - *
  • setUseCaches + *
  • {@code setAllowUserInteraction} + *
  • {@code setDoInput} + *
  • {@code setDoOutput} + *
  • {@code setIfModifiedSince} + *
  • {@code setUseCaches} *
*

* and the general request properties are modified using the method: *

    - *
  • setRequestProperty + *
  • {@code setRequestProperty} *
*

- * Default values for the AllowUserInteraction and - * UseCaches parameters can be set using the methods - * setDefaultAllowUserInteraction and - * setDefaultUseCaches. + * Default values for the {@code AllowUserInteraction} and + * {@code UseCaches} parameters can be set using the methods + * {@code setDefaultAllowUserInteraction} and + * {@code setDefaultUseCaches}. *

- * Each of the above set methods has a corresponding - * get 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. *

* The following methods are used to access the header fields and * the contents after the connection is made to the remote object: *

    - *
  • getContent - *
  • getHeaderField - *
  • getInputStream - *
  • getOutputStream + *
  • {@code getContent} + *
  • {@code getHeaderField} + *
  • {@code getInputStream} + *
  • {@code getOutputStream} *
*

* Certain header fields are accessed frequently. The methods: *

    - *
  • getContentEncoding - *
  • getContentLength - *
  • getContentType - *
  • getDate - *
  • getExpiration - *
  • getLastModifed + *
  • {@code getContentEncoding} + *
  • {@code getContentLength} + *
  • {@code getContentType} + *
  • {@code getDate} + *
  • {@code getExpiration} + *
  • {@code getLastModifed} *
*

* provide convenient access to these fields. The - * getContentType method is used by the - * getContent 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 - * getContentType method. + * {@code getContentType} method. *

* 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: getInputStream and getContent, - * which are mirrored in the URL class by convenience methods. + * methods: {@code getInputStream} and {@code getContent}, + * which are mirrored in the {@code URL} class by convenience methods. *

* More information on the request properties and header fields of - * an http connection can be found at: + * an {@code http} connection can be found at: *

  * http://www.ietf.org/rfc/rfc2616.txt
  * 
* - * Invoking the close() methods on the InputStream or OutputStream of an - * URLConnection 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. * @@ -164,10 +164,10 @@ * which this connection is opened. *

* The value of this field can be accessed by the - * getURL method. + * {@code getURL} method. *

* The default value of this variable is the value of the URL - * argument in the URLConnection constructor. + * argument in the {@code URLConnection} constructor. * * @see java.net.URLConnection#getURL() * @see java.net.URLConnection#url @@ -175,14 +175,14 @@ protected URL url; /** - * This variable is set by the setDoInput method. Its - * value is returned by the getDoInput method. + * This variable is set by the {@code setDoInput} method. Its + * value is returned by the {@code getDoInput} method. *

* A URL connection can be used for input and/or output. Setting the - * doInput flag to true indicates that + * {@code doInput} flag to {@code true} indicates that * the application intends to read data from the URL connection. *

- * The default value of this field is true. + * The default value of this field is {@code true}. * * @see java.net.URLConnection#getDoInput() * @see java.net.URLConnection#setDoInput(boolean) @@ -190,14 +190,14 @@ protected boolean doInput = true; /** - * This variable is set by the setDoOutput method. Its - * value is returned by the getDoOutput method. + * This variable is set by the {@code setDoOutput} method. Its + * value is returned by the {@code getDoOutput} method. *

* A URL connection can be used for input and/or output. Setting the - * doOutput flag to true indicates + * {@code doOutput} flag to {@code true} indicates * that the application intends to write data to the URL connection. *

- * The default value of this field is false. + * The default value of this field is {@code false}. * * @see java.net.URLConnection#getDoOutput() * @see java.net.URLConnection#setDoOutput(boolean) @@ -207,17 +207,17 @@ private static boolean defaultAllowUserInteraction = false; /** - * If true, this URL 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 false, + * as popping up an authentication dialog. If {@code false}, * then no user interaction is allowed. *

* The value of this field can be set by the - * setAllowUserInteraction method. + * {@code setAllowUserInteraction} method. * Its value is returned by the - * getAllowUserInteraction method. + * {@code getAllowUserInteraction} method. * Its default value is the value of the argument in the last invocation - * of the setDefaultAllowUserInteraction method. + * of the {@code setDefaultAllowUserInteraction} method. * * @see java.net.URLConnection#getAllowUserInteraction() * @see java.net.URLConnection#setAllowUserInteraction(boolean) @@ -228,15 +228,15 @@ private static boolean defaultUseCaches = true; /** - * If true, the protocol is allowed to use caching - * whenever it can. If false, 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. *

- * This field is set by the setUseCaches method. Its - * value is returned by the getUseCaches method. + * This field is set by the {@code setUseCaches} method. Its + * value is returned by the {@code getUseCaches} method. *

* Its default value is the value given in the last invocation of the - * setDefaultUseCaches method. + * {@code setDefaultUseCaches} method. * * @see java.net.URLConnection#setUseCaches(boolean) * @see java.net.URLConnection#getUseCaches() @@ -252,11 +252,11 @@ * January 1, 1970, GMT. The object is fetched only if it has been * modified more recently than that time. *

- * This variable is set by the setIfModifiedSince + * This variable is set by the {@code setIfModifiedSince} * method. Its value is returned by the - * getIfModifiedSince method. + * {@code getIfModifiedSince} method. *

- * The default value of this field is 0, indicating + * The default value of this field is {@code 0}, indicating * that the fetching must always occur. * * @see java.net.URLConnection#getIfModifiedSince() @@ -265,8 +265,8 @@ protected long ifModifiedSince = 0; /** - * If false, this connection object has not created a - * communications link to the specified URL. If true, + * 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; @@ -320,13 +320,13 @@ * Sets the FileNameMap. *

* If there is a security manager, this method first calls - * the security manager's checkSetFactory 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 - * checkSetFactory method doesn't allow the operation. + * {@code checkSetFactory} method doesn't allow the operation. * @see SecurityManager#checkSetFactory * @see #getFileNameMap() * @since 1.2 @@ -341,9 +341,9 @@ * Opens a communications link to the resource referenced by this * URL, if such a connection has not already been established. *

- * If the connect method is called when the connection - * has already been opened (indicated by the connected - * field having the value true), 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. *

* URLConnection objects go through two phases: first they are * created, then they are connected. After being created, and @@ -375,7 +375,7 @@ * the specified timeout. To see the connect timeout set, please * call getConnectTimeout(). * - * @param timeout an int 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 * @@ -396,7 +396,7 @@ * 0 return implies that the option is disabled * (i.e., timeout of infinity). * - * @return an int that indicates the connect timeout + * @return an {@code int} that indicates the connect timeout * value in milliseconds * @see #setConnectTimeout(int) * @see #connect() @@ -418,7 +418,7 @@ * specified timeout. To see the read timeout set, please call * getReadTimeout(). * - * @param timeout an int 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 * @@ -437,7 +437,7 @@ * Returns setting for read timeout. 0 return implies that the * option is disabled (i.e., timeout of infinity). * - * @return an int that indicates the read timeout + * @return an {@code int} that indicates the read timeout * value in milliseconds * * @see #setReadTimeout(int) @@ -459,10 +459,10 @@ } /** - * Returns the value of this URLConnection's URL + * Returns the value of this {@code URLConnection}'s {@code URL} * field. * - * @return the value of this URLConnection's URL + * @return the value of this {@code URLConnection}'s {@code URL} * field. * @see java.net.URLConnection#url */ @@ -471,7 +471,7 @@ } /** - * Returns the value of the content-length header field. + * Returns the value of the {@code content-length} header field. *

* Note: {@link #getContentLengthLong() getContentLengthLong()} * should be preferred over this method, since it returns a {@code long} @@ -489,11 +489,11 @@ } /** - * Returns the value of the content-length 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 -1 if the content length is + * references, or {@code -1} if the content length is * not known. * @since 7.0 */ @@ -502,10 +502,10 @@ } /** - * Returns the value of the content-type header field. + * Returns the value of the {@code content-type} header field. * * @return the content type of the resource that the URL references, - * or null if not known. + * or {@code null} if not known. * @see java.net.URLConnection#getHeaderField(java.lang.String) */ public String getContentType() { @@ -513,10 +513,10 @@ } /** - * Returns the value of the content-encoding header field. + * Returns the value of the {@code content-encoding} header field. * * @return the content encoding of the resource that the URL references, - * or null if not known. + * or {@code null} if not known. * @see java.net.URLConnection#getHeaderField(java.lang.String) */ public String getContentEncoding() { @@ -524,7 +524,7 @@ } /** - * Returns the value of the expires 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 @@ -536,10 +536,10 @@ } /** - * Returns the value of the date header field. + * Returns the value of the {@code date} header field. * * @return the sending date of the resource that the URL references, - * or 0 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) */ @@ -548,11 +548,11 @@ } /** - * Returns the value of the last-modified 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 - * URLConnection 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() { @@ -567,7 +567,7 @@ * * * @param name the name of a header field. - * @return the value of the named header field, or null + * @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) { @@ -591,15 +591,15 @@ /** * Returns the value of the named field parsed as a number. *

- * This form of getHeaderField exists because some - * connection types (e.g., http-ng) 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 - * Default 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) { @@ -613,15 +613,15 @@ /** * Returns the value of the named field parsed as a number. *

- * This form of getHeaderField exists because some - * connection types (e.g., http-ng) 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 - * Default value is returned if the field is + * {@code Default} value is returned if the field is * missing or malformed. * @since 7.0 */ @@ -638,15 +638,15 @@ * The result is the number of milliseconds since January 1, 1970 GMT * represented by the named field. *

- * This form of getHeaderField exists because some - * connection types (e.g., http-ng) 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 - * Default argument is returned if the field is + * {@code Default} argument is returned if the field is * missing or malformed. */ @SuppressWarnings("deprecation") @@ -659,12 +659,12 @@ } /** - * Returns the key for the nth header field. - * It returns null if there are fewer than n+1 fields. + * Returns the key for the {@code n}th header field. + * It returns {@code null} if there are fewer than {@code n+1} fields. * * @param n an index, where {@code n>=0} - * @return the key for the nth header field, - * or null if there are fewer than n+1 + * @return the key for the {@code n}th header field, + * or {@code null} if there are fewer than {@code n+1} * fields. */ public String getHeaderFieldKey(int n) { @@ -672,17 +672,17 @@ } /** - * Returns the value for the nth header field. - * It returns null if there are fewer than - * n+1fields. + * Returns the value for the {@code n}th header field. + * It returns {@code null} if there are fewer than + * {@code n+1}fields. *

* 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 {@code n>=0} - * @return the value of the nth header field - * or null if there are fewer than n+1 fields + * @return the value of the {@code n}th 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) { @@ -693,35 +693,35 @@ * Retrieves the contents of this URL connection. *

* This method first determines the content type of the object by - * calling the getContentType 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: *

    *
  1. If the application has set up a content handler factory instance - * using the setContentHandlerFactory method, the - * createContentHandler 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. *
  2. If no content handler factory has yet been set up, or if the - * factory's createContentHandler method returns - * null, then the application loads the class named: + * factory's {@code createContentHandler} method returns + * {@code null}, then the application loads the class named: *
          *         sun.net.www.content.<contentType>
          *     
    * where <contentType> is formed by taking the * content-type string, replacing all slash characters with a - * period ('.'), and all other non-alphanumeric characters - * with the underscore character '_'. 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 - * 'A' through 'Z', the 26 lowercase ASCII - * letters 'a' through 'z', and the 10 ASCII - * digits '0' through '9'. 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 - * ContentHandler, then an - * UnknownServiceException is thrown. + * {@code ContentHandler}, then an + * {@code UnknownServiceException} is thrown. *
* - * @return the object fetched. The instanceof 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 @@ -743,12 +743,12 @@ /** * Retrieves the contents of this URL connection. * - * @param classes the Class 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 instanceof 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. @@ -773,12 +773,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 java.security.AllPermission. 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 URLConnection - * representing a file: URL would return a - * java.io.FilePermission object. + * a connection to the URL. For example, a {@code URLConnection} + * representing a {@code file:} URL would return a + * {@code java.io.FilePermission} object. * *

The permission returned may dependent upon the state of the * connection. For example, the permission before connecting may be @@ -844,17 +844,17 @@ } /** - * Returns a String representation of this URL connection. + * Returns a {@code String} representation of this URL connection. * - * @return a string representation of this URLConnection. + * @return a string representation of this {@code URLConnection}. */ public String toString() { return this.getClass().getName() + ":" + url; } /** - * Sets the value of the doInput field for this - * URLConnection to the specified value. + * Sets the value of the {@code doInput} field for this + * {@code URLConnection} to the specified value. *

* 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, @@ -872,11 +872,11 @@ } /** - * Returns the value of this URLConnection's - * doInput flag. + * Returns the value of this {@code URLConnection}'s + * {@code doInput} flag. * - * @return the value of this URLConnection's - * doInput flag. + * @return the value of this {@code URLConnection}'s + * {@code doInput} flag. * @see #setDoInput(boolean) */ public boolean getDoInput() { @@ -884,8 +884,8 @@ } /** - * Sets the value of the doOutput field for this - * URLConnection to the specified value. + * Sets the value of the {@code doOutput} field for this + * {@code URLConnection} to the specified value. *

* 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, @@ -902,11 +902,11 @@ } /** - * Returns the value of this URLConnection's - * doOutput flag. + * Returns the value of this {@code URLConnection}'s + * {@code doOutput} flag. * - * @return the value of this URLConnection's - * doOutput flag. + * @return the value of this {@code URLConnection}'s + * {@code doOutput} flag. * @see #setDoOutput(boolean) */ public boolean getDoOutput() { @@ -914,8 +914,8 @@ } /** - * Set the value of the allowUserInteraction field of - * this URLConnection. + * Set the value of the {@code allowUserInteraction} field of + * this {@code URLConnection}. * * @param allowuserinteraction the new value. * @throws IllegalStateException if already connected @@ -928,10 +928,10 @@ } /** - * Returns the value of the allowUserInteraction field for + * Returns the value of the {@code allowUserInteraction} field for * this object. * - * @return the value of the allowUserInteraction field for + * @return the value of the {@code allowUserInteraction} field for * this object. * @see #setAllowUserInteraction(boolean) */ @@ -941,8 +941,8 @@ /** * Sets the default value of the - * allowUserInteraction field for all future - * URLConnection 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() @@ -952,14 +952,14 @@ } /** - * Returns the default value of the allowUserInteraction + * Returns the default value of the {@code allowUserInteraction} * field. *

* 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 allowUserInteraction + * @return the default value of the {@code allowUserInteraction} * field. * @see #setDefaultAllowUserInteraction(boolean) */ @@ -968,8 +968,8 @@ } /** - * Sets the value of the useCaches field of this - * URLConnection to the specified value. + * Sets the value of the {@code useCaches} field of this + * {@code URLConnection} to the specified value. *

* Some protocols do caching of documents. Occasionally, it is important * to be able to "tunnel through" and ignore the caches (e.g., the @@ -979,7 +979,7 @@ * The default value comes from DefaultUseCaches, which defaults to * true. * - * @param usecaches a boolean indicating whether + * @param usecaches a {@code boolean} indicating whether * or not to allow caching * @throws IllegalStateException if already connected * @see #getUseCaches() @@ -991,11 +991,11 @@ } /** - * Returns the value of this URLConnection's - * useCaches field. + * Returns the value of this {@code URLConnection}'s + * {@code useCaches} field. * - * @return the value of this URLConnection's - * useCaches field. + * @return the value of this {@code URLConnection}'s + * {@code useCaches} field. * @see #setUseCaches(boolean) */ public boolean getUseCaches() { @@ -1003,8 +1003,8 @@ } /** - * Sets the value of the ifModifiedSince field of - * this URLConnection 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 @@ -1017,9 +1017,9 @@ } /** - * Returns the value of this object's ifModifiedSince field. + * Returns the value of this object's {@code ifModifiedSince} field. * - * @return the value of this object's ifModifiedSince field. + * @return the value of this object's {@code ifModifiedSince} field. * @see #setIfModifiedSince(long) */ public long getIfModifiedSince() { @@ -1027,15 +1027,15 @@ } /** - * Returns the default value of a URLConnection's - * useCaches flag. + * Returns the default value of a {@code URLConnection}'s + * {@code useCaches} flag. *

* 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 URLConnection's - * useCaches flag. + * @return the default value of a {@code URLConnection}'s + * {@code useCaches} flag. * @see #setDefaultUseCaches(boolean) */ public boolean getDefaultUseCaches() { @@ -1043,7 +1043,7 @@ } /** - * Sets the default value of the useCaches field to the + * Sets the default value of the {@code useCaches} field to the * specified value. * * @param defaultusecaches the new value. @@ -1063,7 +1063,7 @@ * properties to be appended into a single property. * * @param key the keyword by which the request is known - * (e.g., "Accept"). + * (e.g., "{@code Accept}"). * @param value the value associated with it. * @throws IllegalStateException if already connected * @throws NullPointerException if key is null @@ -1087,7 +1087,7 @@ * existing values associated with the same key. * * @param key the keyword by which the request is known - * (e.g., "Accept"). + * (e.g., "{@code Accept}"). * @param value the value associated with it. * @throws IllegalStateException if already connected * @throws NullPointerException if key is null @@ -1151,11 +1151,11 @@ /** * Sets the default value of a general request property. When a - * URLConnection 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., "Accept"). + * (e.g., "{@code Accept}"). * @param value the value associated with the key. * * @see java.net.URLConnection#setRequestProperty(java.lang.String,java.lang.String) @@ -1197,21 +1197,21 @@ static ContentHandlerFactory factory; /** - * Sets the ContentHandlerFactory of an + * Sets the {@code ContentHandlerFactory} of an * application. It can be called at most once by an application. *

- * The ContentHandlerFactory instance is used to + * The {@code ContentHandlerFactory} instance is used to * construct a content handler from a content type *

* If there is a security manager, this method first calls - * the security manager's checkSetFactory 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 - * checkSetFactory 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 @@ -1374,7 +1374,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 getContentType 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, @@ -1389,16 +1389,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 - * getContentType method. + * {@code getContentType} method. *

* Ideally, this routine would not be needed. But many - * http 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 http 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 null 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.