提交 1bc949f6 编写于 作者: B bpb

8019862: Fix doclint errors in java.lang.*.

Summary: Fix doclint errors in java.lang.*
Reviewed-by: darcy
Contributed-by: NBrian Burkhalter <brian.burkhalter@oracle.com>
上级 0d04cb4a
...@@ -60,7 +60,7 @@ public interface CharSequence { ...@@ -60,7 +60,7 @@ public interface CharSequence {
/** /**
* Returns the length of this character sequence. The length is the number * Returns the length of this character sequence. The length is the number
* of 16-bit <code>char</code>s in the sequence.</p> * of 16-bit <code>char</code>s in the sequence.
* *
* @return the number of <code>char</code>s in this sequence * @return the number of <code>char</code>s in this sequence
*/ */
...@@ -70,7 +70,7 @@ public interface CharSequence { ...@@ -70,7 +70,7 @@ public interface CharSequence {
* Returns the <code>char</code> value at the specified index. An index ranges from zero * Returns the <code>char</code> value at the specified index. An index ranges from zero
* to <tt>length() - 1</tt>. The first <code>char</code> value of the sequence is at * to <tt>length() - 1</tt>. The first <code>char</code> value of the sequence is at
* index zero, the next at index one, and so on, as for array * index zero, the next at index one, and so on, as for array
* indexing. </p> * indexing.
* *
* <p>If the <code>char</code> value specified by the index is a * <p>If the <code>char</code> value specified by the index is a
* <a href="{@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate * <a href="{@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate
...@@ -92,7 +92,7 @@ public interface CharSequence { ...@@ -92,7 +92,7 @@ public interface CharSequence {
* ends with the <code>char</code> value at index <tt>end - 1</tt>. The length * ends with the <code>char</code> value at index <tt>end - 1</tt>. The length
* (in <code>char</code>s) of the * (in <code>char</code>s) of the
* returned sequence is <tt>end - start</tt>, so if <tt>start == end</tt> * returned sequence is <tt>end - start</tt>, so if <tt>start == end</tt>
* then an empty sequence is returned. </p> * then an empty sequence is returned.
* *
* @param start the start index, inclusive * @param start the start index, inclusive
* @param end the end index, exclusive * @param end the end index, exclusive
...@@ -109,7 +109,7 @@ public interface CharSequence { ...@@ -109,7 +109,7 @@ public interface CharSequence {
/** /**
* Returns a string containing the characters in this sequence in the same * Returns a string containing the characters in this sequence in the same
* order as this sequence. The length of the string will be the length of * order as this sequence. The length of the string will be the length of
* this sequence. </p> * this sequence.
* *
* @return a string consisting of exactly this sequence of characters * @return a string consisting of exactly this sequence of characters
*/ */
......
...@@ -54,7 +54,7 @@ import java.util.Locale; ...@@ -54,7 +54,7 @@ import java.util.Locale;
* <li><a href="http://www.unicode.org">http://www.unicode.org</a> * <li><a href="http://www.unicode.org">http://www.unicode.org</a>
* </ul> * </ul>
* *
* <h4><a name="unicode">Unicode Character Representations</a></h4> * <h3><a name="unicode">Unicode Character Representations</a></h3>
* *
* <p>The {@code char} data type (and therefore the value that a * <p>The {@code char} data type (and therefore the value that a
* {@code Character} object encapsulates) are based on the * {@code Character} object encapsulates) are based on the
...@@ -68,7 +68,7 @@ import java.util.Locale; ...@@ -68,7 +68,7 @@ import java.util.Locale;
* definition</i></a> of the U+<i>n</i> notation in the Unicode * definition</i></a> of the U+<i>n</i> notation in the Unicode
* Standard.) * Standard.)
* *
* <p><a name="BMP">The set of characters from U+0000 to U+FFFF is * <p><a name="BMP">The set of characters from U+0000 to U+FFFF</a> is
* sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>. * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>.
* <a name="supplementary">Characters</a> whose code points are greater * <a name="supplementary">Characters</a> whose code points are greater
* than U+FFFF are called <em>supplementary character</em>s. The Java * than U+FFFF are called <em>supplementary character</em>s. The Java
...@@ -4599,6 +4599,7 @@ class Character implements java.io.Serializable, Comparable<Character> { ...@@ -4599,6 +4599,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* *
* @since 1.8 * @since 1.8
* *
* @param value The {@code char} for which to return a hash code.
* @return a hash code value for a {@code char} value. * @return a hash code value for a {@code char} value.
*/ */
public static int hashCode(char value) { public static int hashCode(char value) {
...@@ -6637,7 +6638,7 @@ class Character implements java.io.Serializable, Comparable<Character> { ...@@ -6637,7 +6638,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* Determines if the specified character is ISO-LATIN-1 white space. * Determines if the specified character is ISO-LATIN-1 white space.
* This method returns {@code true} for the following five * This method returns {@code true} for the following five
* characters only: * characters only:
* <table> * <table summary="truechars">
* <tr><td>{@code '\t'}</td> <td>{@code U+0009}</td> * <tr><td>{@code '\t'}</td> <td>{@code U+0009}</td>
* <td>{@code HORIZONTAL TABULATION}</td></tr> * <td>{@code HORIZONTAL TABULATION}</td></tr>
* <tr><td>{@code '\n'}</td> <td>{@code U+000A}</td> * <tr><td>{@code '\n'}</td> <td>{@code U+000A}</td>
...@@ -7174,6 +7175,7 @@ class Character implements java.io.Serializable, Comparable<Character> { ...@@ -7174,6 +7175,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* Returns the value obtained by reversing the order of the bytes in the * Returns the value obtained by reversing the order of the bytes in the
* specified <tt>char</tt> value. * specified <tt>char</tt> value.
* *
* @param ch The {@code char} of which to reverse the byte order.
* @return the value obtained by reversing (or, equivalently, swapping) * @return the value obtained by reversing (or, equivalently, swapping)
* the bytes in the specified <tt>char</tt> value. * the bytes in the specified <tt>char</tt> value.
* @since 1.5 * @since 1.5
......
...@@ -157,7 +157,7 @@ import sun.security.util.SecurityConstants; ...@@ -157,7 +157,7 @@ import sun.security.util.SecurityConstants;
* } * }
* </pre></blockquote> * </pre></blockquote>
* *
* <h4> <a name="name">Binary names</a> </h4> * <h3> <a name="name">Binary names</a> </h3>
* *
* <p> Any class name provided as a {@link String} parameter to methods in * <p> Any class name provided as a {@link String} parameter to methods in
* <tt>ClassLoader</tt> must be a binary name as defined by * <tt>ClassLoader</tt> must be a binary name as defined by
...@@ -342,7 +342,7 @@ public abstract class ClassLoader { ...@@ -342,7 +342,7 @@ public abstract class ClassLoader {
* #loadClass(String, boolean)} method. It is invoked by the Java virtual * #loadClass(String, boolean)} method. It is invoked by the Java virtual
* machine to resolve class references. Invoking this method is equivalent * machine to resolve class references. Invoking this method is equivalent
* to invoking {@link #loadClass(String, boolean) <tt>loadClass(name, * to invoking {@link #loadClass(String, boolean) <tt>loadClass(name,
* false)</tt>}. </p> * false)</tt>}.
* *
* @param name * @param name
* The <a href="#name">binary name</a> of the class * The <a href="#name">binary name</a> of the class
...@@ -441,7 +441,7 @@ public abstract class ClassLoader { ...@@ -441,7 +441,7 @@ public abstract class ClassLoader {
* behaves as follows. If this ClassLoader object is registered as * behaves as follows. If this ClassLoader object is registered as
* parallel capable, the method returns a dedicated object associated * parallel capable, the method returns a dedicated object associated
* with the specified class name. Otherwise, the method returns this * with the specified class name. Otherwise, the method returns this
* ClassLoader object. </p> * ClassLoader object.
* *
* @param className * @param className
* The name of the to-be-loaded class * The name of the to-be-loaded class
...@@ -506,7 +506,7 @@ public abstract class ClassLoader { ...@@ -506,7 +506,7 @@ public abstract class ClassLoader {
* follow the delegation model for loading classes, and will be invoked by * follow the delegation model for loading classes, and will be invoked by
* the {@link #loadClass <tt>loadClass</tt>} method after checking the * the {@link #loadClass <tt>loadClass</tt>} method after checking the
* parent class loader for the requested class. The default implementation * parent class loader for the requested class. The default implementation
* throws a <tt>ClassNotFoundException</tt>. </p> * throws a <tt>ClassNotFoundException</tt>.
* *
* @param name * @param name
* The <a href="#name">binary name</a> of the class * The <a href="#name">binary name</a> of the class
...@@ -772,16 +772,16 @@ public abstract class ClassLoader { ...@@ -772,16 +772,16 @@ public abstract class ClassLoader {
* <i>bBuffer</i><tt>,</tt> <i>pd</i><tt>)</tt> yields exactly the same * <i>bBuffer</i><tt>,</tt> <i>pd</i><tt>)</tt> yields exactly the same
* result as the statements * result as the statements
* *
* <blockquote><tt> *<p> <tt>
* ...<br> * ...<br>
* byte[] temp = new byte[</tt><i>bBuffer</i><tt>.{@link * byte[] temp = new byte[bBuffer.{@link
* java.nio.ByteBuffer#remaining remaining}()];<br> * java.nio.ByteBuffer#remaining remaining}()];<br>
* </tt><i>bBuffer</i><tt>.{@link java.nio.ByteBuffer#get(byte[]) * bBuffer.{@link java.nio.ByteBuffer#get(byte[])
* get}(temp);<br> * get}(temp);<br>
* return {@link #defineClass(String, byte[], int, int, ProtectionDomain) * return {@link #defineClass(String, byte[], int, int, ProtectionDomain)
* </tt><i>cl</i><tt>.defineClass}(</tt><i>name</i><tt>, temp, 0, * cl.defineClass}(name, temp, 0,
* temp.length, </tt><i>pd</i><tt>);<br> * temp.length, pd);<br>
* </tt></blockquote> * </tt></p>
* *
* @param name * @param name
* The expected <a href="#name">binary name</a>. of the class, or * The expected <a href="#name">binary name</a>. of the class, or
...@@ -940,7 +940,6 @@ public abstract class ClassLoader { ...@@ -940,7 +940,6 @@ public abstract class ClassLoader {
* already been linked, then this method simply returns. Otherwise, the * already been linked, then this method simply returns. Otherwise, the
* class is linked as described in the "Execution" chapter of * class is linked as described in the "Execution" chapter of
* <cite>The Java&trade; Language Specification</cite>. * <cite>The Java&trade; Language Specification</cite>.
* </p>
* *
* @param c * @param c
* The class to link * The class to link
...@@ -1012,7 +1011,7 @@ public abstract class ClassLoader { ...@@ -1012,7 +1011,7 @@ public abstract class ClassLoader {
* Returns the class with the given <a href="#name">binary name</a> if this * Returns the class with the given <a href="#name">binary name</a> if this
* loader has been recorded by the Java virtual machine as an initiating * loader has been recorded by the Java virtual machine as an initiating
* loader of a class with that <a href="#name">binary name</a>. Otherwise * loader of a class with that <a href="#name">binary name</a>. Otherwise
* <tt>null</tt> is returned. </p> * <tt>null</tt> is returned.
* *
* @param name * @param name
* The <a href="#name">binary name</a> of the class * The <a href="#name">binary name</a> of the class
...@@ -1032,7 +1031,7 @@ public abstract class ClassLoader { ...@@ -1032,7 +1031,7 @@ public abstract class ClassLoader {
/** /**
* Sets the signers of a class. This should be invoked after defining a * Sets the signers of a class. This should be invoked after defining a
* class. </p> * class.
* *
* @param c * @param c
* The <tt>Class</tt> object * The <tt>Class</tt> object
...@@ -1125,7 +1124,7 @@ public abstract class ClassLoader { ...@@ -1125,7 +1124,7 @@ public abstract class ClassLoader {
/** /**
* Finds the resource with the given name. Class loader implementations * Finds the resource with the given name. Class loader implementations
* should override this method to specify where to find resources. </p> * should override this method to specify where to find resources.
* *
* @param name * @param name
* The resource name * The resource name
...@@ -1143,7 +1142,7 @@ public abstract class ClassLoader { ...@@ -1143,7 +1142,7 @@ public abstract class ClassLoader {
* Returns an enumeration of {@link java.net.URL <tt>URL</tt>} objects * Returns an enumeration of {@link java.net.URL <tt>URL</tt>} objects
* representing all the resources with the given name. Class loader * representing all the resources with the given name. Class loader
* implementations should override this method to specify where to load * implementations should override this method to specify where to load
* resources from. </p> * resources from.
* *
* @param name * @param name
* The resource name * The resource name
...@@ -1161,14 +1160,16 @@ public abstract class ClassLoader { ...@@ -1161,14 +1160,16 @@ public abstract class ClassLoader {
} }
/** /**
* Registers the caller as parallel capable.</p> * Registers the caller as parallel capable.
* The registration succeeds if and only if all of the following * The registration succeeds if and only if all of the following
* conditions are met: <br> * conditions are met:
* 1. no instance of the caller has been created</p> * <ol>
* 2. all of the super classes (except class Object) of the caller are * <li> no instance of the caller has been created</li>
* registered as parallel capable</p> * <li> all of the super classes (except class Object) of the caller are
* Note that once a class loader is registered as parallel capable, there * registered as parallel capable</li>
* is no way to change it back. </p> * </ol>
* <p>Note that once a class loader is registered as parallel capable, there
* is no way to change it back.</p>
* *
* @return true if the caller is successfully registered as * @return true if the caller is successfully registered as
* parallel capable and false if otherwise. * parallel capable and false if otherwise.
...@@ -1185,7 +1186,7 @@ public abstract class ClassLoader { ...@@ -1185,7 +1186,7 @@ public abstract class ClassLoader {
/** /**
* Find a resource of the specified name from the search path used to load * Find a resource of the specified name from the search path used to load
* classes. This method locates the resource through the system class * classes. This method locates the resource through the system class
* loader (see {@link #getSystemClassLoader()}). </p> * loader (see {@link #getSystemClassLoader()}).
* *
* @param name * @param name
* The resource name * The resource name
...@@ -1292,7 +1293,7 @@ public abstract class ClassLoader { ...@@ -1292,7 +1293,7 @@ public abstract class ClassLoader {
/** /**
* Open for reading, a resource of the specified name from the search path * Open for reading, a resource of the specified name from the search path
* used to load classes. This method locates the resource through the * used to load classes. This method locates the resource through the
* system class loader (see {@link #getSystemClassLoader()}). </p> * system class loader (see {@link #getSystemClassLoader()}).
* *
* @param name * @param name
* The resource name * The resource name
...@@ -1515,7 +1516,7 @@ public abstract class ClassLoader { ...@@ -1515,7 +1516,7 @@ public abstract class ClassLoader {
* class loaders to define the packages for their classes. Packages must * class loaders to define the packages for their classes. Packages must
* be created before the class is defined, and package names must be * be created before the class is defined, and package names must be
* unique within a class loader and cannot be redefined or changed once * unique within a class loader and cannot be redefined or changed once
* created. </p> * created.
* *
* @param name * @param name
* The package name * The package name
...@@ -1572,7 +1573,7 @@ public abstract class ClassLoader { ...@@ -1572,7 +1573,7 @@ public abstract class ClassLoader {
/** /**
* Returns a <tt>Package</tt> that has been defined by this class loader * Returns a <tt>Package</tt> that has been defined by this class loader
* or any of its ancestors. </p> * or any of its ancestors.
* *
* @param name * @param name
* The package name * The package name
...@@ -1609,7 +1610,7 @@ public abstract class ClassLoader { ...@@ -1609,7 +1610,7 @@ public abstract class ClassLoader {
/** /**
* Returns all of the <tt>Packages</tt> defined by this class loader and * Returns all of the <tt>Packages</tt> defined by this class loader and
* its ancestors. </p> * its ancestors.
* *
* @return The array of <tt>Package</tt> objects defined by this * @return The array of <tt>Package</tt> objects defined by this
* <tt>ClassLoader</tt> * <tt>ClassLoader</tt>
...@@ -1646,7 +1647,7 @@ public abstract class ClassLoader { ...@@ -1646,7 +1647,7 @@ public abstract class ClassLoader {
* method to locate the native libraries that belong to classes loaded with * method to locate the native libraries that belong to classes loaded with
* this class loader. If this method returns <tt>null</tt>, the VM * this class loader. If this method returns <tt>null</tt>, the VM
* searches the library along the path specified as the * searches the library along the path specified as the
* "<tt>java.library.path</tt>" property. </p> * "<tt>java.library.path</tt>" property.
* *
* @param libname * @param libname
* The library name * The library name
...@@ -1966,7 +1967,7 @@ public abstract class ClassLoader { ...@@ -1966,7 +1967,7 @@ public abstract class ClassLoader {
* in the future will have assertions enabled or disabled by default. * in the future will have assertions enabled or disabled by default.
* This setting may be overridden on a per-package or per-class basis by * This setting may be overridden on a per-package or per-class basis by
* invoking {@link #setPackageAssertionStatus(String, boolean)} or {@link * invoking {@link #setPackageAssertionStatus(String, boolean)} or {@link
* #setClassAssertionStatus(String, boolean)}. </p> * #setClassAssertionStatus(String, boolean)}.
* *
* @param enabled * @param enabled
* <tt>true</tt> if classes loaded by this class loader will * <tt>true</tt> if classes loaded by this class loader will
...@@ -2068,7 +2069,6 @@ public abstract class ClassLoader { ...@@ -2068,7 +2069,6 @@ public abstract class ClassLoader {
* status settings associated with the class loader. This method is * status settings associated with the class loader. This method is
* provided so that class loaders can be made to ignore any command line or * provided so that class loaders can be made to ignore any command line or
* persistent assertion status settings and "start with a clean slate." * persistent assertion status settings and "start with a clean slate."
* </p>
* *
* @since 1.4 * @since 1.4
*/ */
......
...@@ -256,7 +256,7 @@ public final class Double extends Number implements Comparable<Double> { ...@@ -256,7 +256,7 @@ public final class Double extends Number implements Comparable<Double> {
* </ul> * </ul>
* *
* <table border> * <table border>
* <caption><h3>Examples</h3></caption> * <caption>Examples</caption>
* <tr><th>Floating-point Value</th><th>Hexadecimal String</th> * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
* <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td> * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
* <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td> * <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td>
......
...@@ -258,7 +258,7 @@ public final class Float extends Number implements Comparable<Float> { ...@@ -258,7 +258,7 @@ public final class Float extends Number implements Comparable<Float> {
* </ul> * </ul>
* *
* <table border> * <table border>
* <caption><h3>Examples</h3></caption> * <caption>Examples</caption>
* <tr><th>Floating-point Value</th><th>Hexadecimal String</th> * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
* <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td> * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
* <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td> * <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td>
......
...@@ -65,7 +65,7 @@ import java.util.Map; ...@@ -65,7 +65,7 @@ import java.util.Map;
* working directory of the current process, usually the directory * working directory of the current process, usually the directory
* named by the system property {@code user.dir}. * named by the system property {@code user.dir}.
* *
* <li><a name="redirect-input">a source of <i>standard input</i>. * <li><a name="redirect-input">a source of <i>standard input</i></a>.
* By default, the subprocess reads input from a pipe. Java code * By default, the subprocess reads input from a pipe. Java code
* can access this pipe via the output stream returned by * can access this pipe via the output stream returned by
* {@link Process#getOutputStream()}. However, standard input may * {@link Process#getOutputStream()}. However, standard input may
...@@ -81,7 +81,7 @@ import java.util.Map; ...@@ -81,7 +81,7 @@ import java.util.Map;
* </ul> * </ul>
* *
* <li><a name="redirect-output">a destination for <i>standard output</i> * <li><a name="redirect-output">a destination for <i>standard output</i>
* and <i>standard error</i>. By default, the subprocess writes standard * and <i>standard error</i></a>. By default, the subprocess writes standard
* output and standard error to pipes. Java code can access these pipes * output and standard error to pipes. Java code can access these pipes
* via the input streams returned by {@link Process#getInputStream()} and * via the input streams returned by {@link Process#getInputStream()} and
* {@link Process#getErrorStream()}. However, standard output and * {@link Process#getErrorStream()}. However, standard output and
...@@ -554,6 +554,7 @@ public final class ProcessBuilder ...@@ -554,6 +554,7 @@ public final class ProcessBuilder
* Redirect.from(file).type() == Redirect.Type.READ * Redirect.from(file).type() == Redirect.Type.READ
* }</pre> * }</pre>
* *
* @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null * @throws NullPointerException if the specified file is null
* @return a redirect to read from the specified file * @return a redirect to read from the specified file
*/ */
...@@ -580,6 +581,7 @@ public final class ProcessBuilder ...@@ -580,6 +581,7 @@ public final class ProcessBuilder
* Redirect.to(file).type() == Redirect.Type.WRITE * Redirect.to(file).type() == Redirect.Type.WRITE
* }</pre> * }</pre>
* *
* @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null * @throws NullPointerException if the specified file is null
* @return a redirect to write to the specified file * @return a redirect to write to the specified file
*/ */
...@@ -610,6 +612,7 @@ public final class ProcessBuilder ...@@ -610,6 +612,7 @@ public final class ProcessBuilder
* Redirect.appendTo(file).type() == Redirect.Type.APPEND * Redirect.appendTo(file).type() == Redirect.Type.APPEND
* }</pre> * }</pre>
* *
* @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null * @throws NullPointerException if the specified file is null
* @return a redirect to append to the specified file * @return a redirect to append to the specified file
*/ */
......
...@@ -661,7 +661,7 @@ public class Runtime { ...@@ -661,7 +661,7 @@ public class Runtime {
/** /**
* Returns the maximum amount of memory that the Java virtual machine will * Returns the maximum amount of memory that the Java virtual machine will
* attempt to use. If there is no inherent limit then the value {@link * attempt to use. If there is no inherent limit then the value {@link
* java.lang.Long#MAX_VALUE} will be returned. </p> * java.lang.Long#MAX_VALUE} will be returned.
* *
* @return the maximum amount of memory that the virtual machine will * @return the maximum amount of memory that the virtual machine will
* attempt to use, measured in bytes * attempt to use, measured in bytes
......
...@@ -865,8 +865,8 @@ class Thread implements Runnable { ...@@ -865,8 +865,8 @@ class Thread implements Runnable {
* will receive an {@link InterruptedException}. * will receive an {@link InterruptedException}.
* *
* <p> If this thread is blocked in an I/O operation upon an {@link * <p> If this thread is blocked in an I/O operation upon an {@link
* java.nio.channels.InterruptibleChannel </code>interruptible * java.nio.channels.InterruptibleChannel InterruptibleChannel}
* channel<code>} then the channel will be closed, the thread's interrupt * then the channel will be closed, the thread's interrupt
* status will be set, and the thread will receive a {@link * status will be set, and the thread will receive a {@link
* java.nio.channels.ClosedByInterruptException}. * java.nio.channels.ClosedByInterruptException}.
* *
...@@ -1883,6 +1883,7 @@ class Thread implements Runnable { ...@@ -1883,6 +1883,7 @@ class Thread implements Runnable {
* there is no default. * there is no default.
* @since 1.5 * @since 1.5
* @see #setDefaultUncaughtExceptionHandler * @see #setDefaultUncaughtExceptionHandler
* @return the default uncaught exception handler for all threads
*/ */
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){ public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
return defaultUncaughtExceptionHandler; return defaultUncaughtExceptionHandler;
...@@ -1895,6 +1896,7 @@ class Thread implements Runnable { ...@@ -1895,6 +1896,7 @@ class Thread implements Runnable {
* <tt>ThreadGroup</tt> object is returned, unless this thread * <tt>ThreadGroup</tt> object is returned, unless this thread
* has terminated, in which case <tt>null</tt> is returned. * has terminated, in which case <tt>null</tt> is returned.
* @since 1.5 * @since 1.5
* @return the uncaught exception handler for this thread
*/ */
public UncaughtExceptionHandler getUncaughtExceptionHandler() { public UncaughtExceptionHandler getUncaughtExceptionHandler() {
return uncaughtExceptionHandler != null ? return uncaughtExceptionHandler != null ?
......
...@@ -131,12 +131,13 @@ public class ThreadLocal<T> { ...@@ -131,12 +131,13 @@ public class ThreadLocal<T> {
* Creates a thread local variable. The initial value of the variable is * Creates a thread local variable. The initial value of the variable is
* determined by invoking the {@code get} method on the {@code Supplier}. * determined by invoking the {@code get} method on the {@code Supplier}.
* *
* @param <S> the type of the thread local's value
* @param supplier the supplier to be used to determine the initial value * @param supplier the supplier to be used to determine the initial value
* @return a new thread local variable * @return a new thread local variable
* @throws NullPointerException if the specified supplier is null * @throws NullPointerException if the specified supplier is null
* @since 1.8 * @since 1.8
*/ */
public static <T> ThreadLocal<T> withInitial(Supplier<? extends T> supplier) { public static <S> ThreadLocal<S> withInitial(Supplier<? extends S> supplier) {
return new SuppliedThreadLocal<>(supplier); return new SuppliedThreadLocal<>(supplier);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册