8199420: Update javadoc tags in java.lang.System and related

Reviewed-by: lancea, bpb
This commit is contained in:
Roger Riggs 2018-03-12 10:04:12 -04:00
parent 54b1510aa7
commit f0cd136c74
7 changed files with 368 additions and 383 deletions

View file

@ -325,7 +325,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param index the index to the {@code char} values
* @return the code point value of the character at the
* {@code index}
* @exception IndexOutOfBoundsException if the {@code index}
* @throws IndexOutOfBoundsException if the {@code index}
* argument is negative or not less than the length of this
* sequence.
*/
@ -356,7 +356,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
*
* @param index the index following the code point that should be returned
* @return the Unicode code point value before the given index.
* @exception IndexOutOfBoundsException if the {@code index}
* @throws IndexOutOfBoundsException if the {@code index}
* argument is less than 1 or greater than the length
* of this sequence.
*/
@ -386,7 +386,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* the text range.
* @return the number of Unicode code points in the specified text
* range
* @exception IndexOutOfBoundsException if the
* @throws IndexOutOfBoundsException if the
* {@code beginIndex} is negative, or {@code endIndex}
* is larger than the length of this sequence, or
* {@code beginIndex} is larger than {@code endIndex}.
@ -411,7 +411,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param index the index to be offset
* @param codePointOffset the offset in code points
* @return the index within this sequence
* @exception IndexOutOfBoundsException if {@code index}
* @throws IndexOutOfBoundsException if {@code index}
* is negative or larger then the length of this sequence,
* or if {@code codePointOffset} is positive and the subsequence
* starting with {@code index} has fewer than
@ -882,7 +882,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
*
* @param codePoint a Unicode code point
* @return a reference to this object.
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} isn't a valid Unicode code point
*/
public AbstractStringBuilder appendCodePoint(int codePoint) {

View file

@ -620,7 +620,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* Constructs a new {@code Subset} instance.
*
* @param name The name of this subset
* @exception NullPointerException if name is {@code null}
* @throws NullPointerException if name is {@code null}
*/
protected Subset(String name) {
if (name == null) {
@ -3583,7 +3583,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* Unicode block of which this character is a member, or
* {@code null} if the character is not a member of any
* Unicode block
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is an invalid Unicode code point.
* @see Character#isValidCodePoint(int)
* @since 1.5
@ -7387,7 +7387,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @return The {@code UnicodeScript} constant representing the
* Unicode script of which this character is assigned to.
*
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is an invalid Unicode code point.
* @see Character#isValidCodePoint(int)
*
@ -7588,7 +7588,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
*
* @param codePoint the {@code codePoint} to be converted
* @return the string representation of the specified {@code codePoint}
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is not a {@linkplain #isValidCodePoint
* valid Unicode code point}.
* @since 11
@ -7803,8 +7803,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param index the index to the {@code char} values (Unicode
* code units) in {@code seq} to be converted
* @return the Unicode code point at the given index
* @exception NullPointerException if {@code seq} is null.
* @exception IndexOutOfBoundsException if the value
* @throws NullPointerException if {@code seq} is null.
* @throws IndexOutOfBoundsException if the value
* {@code index} is negative or not less than
* {@link CharSequence#length() seq.length()}.
* @since 1.5
@ -7835,8 +7835,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param index the index to the {@code char} values (Unicode
* code units) in the {@code char} array to be converted
* @return the Unicode code point at the given index
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException if the value
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException if the value
* {@code index} is negative or not less than
* the length of the {@code char} array.
* @since 1.5
@ -7863,8 +7863,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param limit the index after the last array element that
* can be used in the {@code char} array
* @return the Unicode code point at the given index
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException if the {@code index}
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException if the {@code index}
* argument is negative or not less than the {@code limit}
* argument, or if the {@code limit} argument is negative or
* greater than the length of the {@code char} array.
@ -7904,8 +7904,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param seq the {@code CharSequence} instance
* @param index the index following the code point that should be returned
* @return the Unicode code point value before the given index.
* @exception NullPointerException if {@code seq} is null.
* @exception IndexOutOfBoundsException if the {@code index}
* @throws NullPointerException if {@code seq} is null.
* @throws IndexOutOfBoundsException if the {@code index}
* argument is less than 1 or greater than {@link
* CharSequence#length() seq.length()}.
* @since 1.5
@ -7936,8 +7936,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param a the {@code char} array
* @param index the index following the code point that should be returned
* @return the Unicode code point value before the given index.
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException if the {@code index}
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException if the {@code index}
* argument is less than 1 or greater than the length of the
* {@code char} array
* @since 1.5
@ -7965,8 +7965,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param start the index of the first array element in the
* {@code char} array
* @return the Unicode code point value before the given index.
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException if the {@code index}
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException if the {@code index}
* argument is not greater than the {@code start} argument or
* is greater than the length of the {@code char} array, or
* if the {@code start} argument is negative or not less than
@ -8066,10 +8066,10 @@ class Character implements java.io.Serializable, Comparable<Character> {
* array where the converted value is stored.
* @return 1 if the code point is a BMP code point, 2 if the
* code point is a supplementary code point.
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is not a valid Unicode code point.
* @exception NullPointerException if the specified {@code dst} is null.
* @exception IndexOutOfBoundsException if {@code dstIndex}
* @throws NullPointerException if the specified {@code dst} is null.
* @throws IndexOutOfBoundsException if {@code dstIndex}
* is negative or not less than {@code dst.length}, or if
* {@code dst} at {@code dstIndex} doesn't have enough
* array element(s) to store the resulting {@code char}
@ -8104,7 +8104,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param codePoint a Unicode code point
* @return a {@code char} array having
* {@code codePoint}'s UTF-16 representation.
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is not a valid Unicode code point.
* @since 1.5
*/
@ -8142,8 +8142,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* the text range.
* @return the number of Unicode code points in the specified text
* range
* @exception NullPointerException if {@code seq} is null.
* @exception IndexOutOfBoundsException if the
* @throws NullPointerException if {@code seq} is null.
* @throws IndexOutOfBoundsException if the
* {@code beginIndex} is negative, or {@code endIndex}
* is larger than the length of the given sequence, or
* {@code beginIndex} is larger than {@code endIndex}.
@ -8178,8 +8178,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* given {@code char} array
* @param count the length of the subarray in {@code char}s
* @return the number of Unicode code points in the specified subarray
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException if {@code offset} or
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException if {@code offset} or
* {@code count} is negative, or if {@code offset +
* count} is larger than the length of the given array.
* @since 1.5
@ -8215,8 +8215,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param index the index to be offset
* @param codePointOffset the offset in code points
* @return the index within the char sequence
* @exception NullPointerException if {@code seq} is null.
* @exception IndexOutOfBoundsException if {@code index}
* @throws NullPointerException if {@code seq} is null.
* @throws IndexOutOfBoundsException if {@code index}
* is negative or larger then the length of the char sequence,
* or if {@code codePointOffset} is positive and the
* subsequence starting with {@code index} has fewer than
@ -8276,8 +8276,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @param index the index to be offset
* @param codePointOffset the offset in code points
* @return the index within the subarray
* @exception NullPointerException if {@code a} is null.
* @exception IndexOutOfBoundsException
* @throws NullPointerException if {@code a} is null.
* @throws IndexOutOfBoundsException
* if {@code start} or {@code count} is negative,
* or if {@code start + count} is larger than the length of
* the given array,
@ -8874,19 +8874,19 @@ class Character implements java.io.Serializable, Comparable<Character> {
* provided by {@link Character#getType(int) getType(codePoint)}, is any of
* the following:
* <ul>
* <li> <code>UPPERCASE_LETTER</code>
* <li> <code>LOWERCASE_LETTER</code>
* <li> <code>TITLECASE_LETTER</code>
* <li> <code>MODIFIER_LETTER</code>
* <li> <code>OTHER_LETTER</code>
* <li> <code>LETTER_NUMBER</code>
* <li> {@code UPPERCASE_LETTER}
* <li> {@code LOWERCASE_LETTER}
* <li> {@code TITLECASE_LETTER}
* <li> {@code MODIFIER_LETTER}
* <li> {@code OTHER_LETTER}
* <li> {@code LETTER_NUMBER}
* </ul>
* or it has contributory property Other_Alphabetic as defined by the
* Unicode Standard.
*
* @param codePoint the character (Unicode code point) to be tested.
* @return <code>true</code> if the character is a Unicode alphabet
* character, <code>false</code> otherwise.
* @return {@code true} if the character is a Unicode alphabet
* character, {@code false} otherwise.
* @since 1.7
*/
public static boolean isAlphabetic(int codePoint) {
@ -8905,8 +8905,8 @@ class Character implements java.io.Serializable, Comparable<Character> {
* the Unicode Standard.
*
* @param codePoint the character (Unicode code point) to be tested.
* @return <code>true</code> if the character is a Unicode ideograph
* character, <code>false</code> otherwise.
* @return {@code true} if the character is a Unicode ideograph
* character, {@code false} otherwise.
* @since 1.7
*/
public static boolean isIdeographic(int codePoint) {
@ -10170,7 +10170,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* @return the Unicode name of the specified character, or null if
* the code point is unassigned.
*
* @exception IllegalArgumentException if the specified
* @throws IllegalArgumentException if the specified
* {@code codePoint} is not a valid Unicode
* code point.
*

View file

@ -737,14 +737,14 @@ public class Runtime {
* convenient means of invoking this method.
*
* @param filename the file to load.
* @exception SecurityException if a security manager exists and its
* @throws SecurityException if a security manager exists and its
* {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the filename is not an
* @throws UnsatisfiedLinkError if either the filename is not an
* absolute path name, the native library is not statically
* linked with the VM, or the library cannot be mapped to
* a native library image by the host system.
* @exception NullPointerException if {@code filename} is
* @throws NullPointerException if {@code filename} is
* {@code null}
* @see java.lang.Runtime#getRuntime()
* @see java.lang.SecurityException
@ -800,14 +800,14 @@ public class Runtime {
* name, the second and subsequent calls are ignored.
*
* @param libname the name of the library.
* @exception SecurityException if a security manager exists and its
* @throws SecurityException if a security manager exists and its
* {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the libname argument
* @throws UnsatisfiedLinkError if either the libname argument
* contains a file path, the native library is not statically
* linked with the VM, or the library cannot be mapped to a
* native library image by the host system.
* @exception NullPointerException if {@code libname} is
* @throws NullPointerException if {@code libname} is
* {@code null}
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkLink(java.lang.String)

View file

@ -131,8 +131,8 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* the specified initial capacity.
*
* @param capacity the initial capacity.
* @exception NegativeArraySizeException if the {@code capacity}
* argument is less than {@code 0}.
* @throws NegativeArraySizeException if the {@code capacity}
* argument is less than {@code 0}.
*/
@HotSpotIntrinsicCandidate
public StringBuffer(int capacity) {

View file

@ -74,20 +74,19 @@ import sun.nio.ch.Interruptible;
import sun.security.util.SecurityConstants;
/**
* The <code>System</code> class contains several useful class fields
* The {@code System} class contains several useful class fields
* and methods. It cannot be instantiated.
*
* <p>Among the facilities provided by the <code>System</code> class
* Among the facilities provided by the {@code System} class
* are standard input, standard output, and error output streams;
* access to externally defined properties and environment
* variables; a means of loading files and libraries; and a utility
* method for quickly copying a portion of an array.
*
* @author unascribed
* @since 1.0
*/
public final class System {
/* register the natives via the static initializer.
/* Register the natives via the static initializer.
*
* VM will invoke the initializeSystemClass method to complete
* the initialization for this class separated from clinit.
@ -123,7 +122,7 @@ public final class System {
* System.out.println(data)
* </pre></blockquote>
* <p>
* See the <code>println</code> methods in class <code>PrintStream</code>.
* See the {@code println} methods in class {@code PrintStream}.
*
* @see java.io.PrintStream#println()
* @see java.io.PrintStream#println(boolean)
@ -147,7 +146,7 @@ public final class System {
* convention, this output stream is used to display error messages
* or other information that should come to the immediate attention
* of a user even if the principal output stream, the value of the
* variable <code>out</code>, has been redirected to a file or other
* variable {@code out}, has been redirected to a file or other
* destination that is typically not continuously monitored.
*/
public static final PrintStream err = null;
@ -159,15 +158,15 @@ public final class System {
/**
* Reassigns the "standard" input stream.
*
* <p>First, if there is a security manager, its <code>checkPermission</code>
* method is called with a <code>RuntimePermission("setIO")</code> permission
* First, if there is a security manager, its {@code checkPermission}
* method is called with a {@code RuntimePermission("setIO")} permission
* to see if it's ok to reassign the "standard" input stream.
*
* @param in the new standard input stream.
*
* @throws SecurityException
* if a security manager exists and its
* <code>checkPermission</code> method doesn't allow
* {@code checkPermission} method doesn't allow
* reassigning of the standard input stream.
*
* @see SecurityManager#checkPermission
@ -183,15 +182,15 @@ public final class System {
/**
* Reassigns the "standard" output stream.
*
* <p>First, if there is a security manager, its <code>checkPermission</code>
* method is called with a <code>RuntimePermission("setIO")</code> permission
* First, if there is a security manager, its {@code checkPermission}
* method is called with a {@code RuntimePermission("setIO")} permission
* to see if it's ok to reassign the "standard" output stream.
*
* @param out the new standard output stream
*
* @throws SecurityException
* if a security manager exists and its
* <code>checkPermission</code> method doesn't allow
* {@code checkPermission} method doesn't allow
* reassigning of the standard output stream.
*
* @see SecurityManager#checkPermission
@ -207,15 +206,15 @@ public final class System {
/**
* Reassigns the "standard" error output stream.
*
* <p>First, if there is a security manager, its <code>checkPermission</code>
* method is called with a <code>RuntimePermission("setIO")</code> permission
* First, if there is a security manager, its {@code checkPermission}
* method is called with a {@code RuntimePermission("setIO")} permission
* to see if it's ok to reassign the "standard" error output stream.
*
* @param err the new standard error output stream.
*
* @throws SecurityException
* if a security manager exists and its
* <code>checkPermission</code> method doesn't allow
* {@code checkPermission} method doesn't allow
* reassigning of the standard error output stream.
*
* @see SecurityManager#checkPermission
@ -253,10 +252,10 @@ public final class System {
* Returns the channel inherited from the entity that created this
* Java virtual machine.
*
* <p> This method returns the channel obtained by invoking the
* This method returns the channel obtained by invoking the
* {@link java.nio.channels.spi.SelectorProvider#inheritedChannel
* inheritedChannel} method of the system-wide default
* {@link java.nio.channels.spi.SelectorProvider} object. </p>
* {@link java.nio.channels.spi.SelectorProvider} object.
*
* <p> In addition to the network-oriented channels described in
* {@link java.nio.channels.spi.SelectorProvider#inheritedChannel
@ -292,21 +291,21 @@ public final class System {
/**
* Sets the System security.
*
* <p> If there is a security manager already installed, this method first
* calls the security manager's <code>checkPermission</code> method
* with a <code>RuntimePermission("setSecurityManager")</code>
* If there is a security manager already installed, this method first
* calls the security manager's {@code checkPermission} method
* with a {@code RuntimePermission("setSecurityManager")}
* permission to ensure it's ok to replace the existing
* security manager.
* This may result in throwing a <code>SecurityException</code>.
* This may result in throwing a {@code SecurityException}.
*
* <p> Otherwise, the argument is established as the current
* security manager. If the argument is <code>null</code> and no
* security manager. If the argument is {@code null} and no
* security manager has been established, then no action is taken and
* the method simply returns.
*
* @param s the security manager.
* @exception SecurityException if the security manager has already
* been set and its <code>checkPermission</code> method
* @throws SecurityException if the security manager has already
* been set and its {@code checkPermission} method
* doesn't allow it to be replaced.
* @see #getSecurityManager
* @see SecurityManager#checkPermission
@ -363,7 +362,7 @@ public final class System {
*
* @return if a security manager has already been established for the
* current application, then that security manager is returned;
* otherwise, <code>null</code> is returned.
* otherwise, {@code null} is returned.
* @see #setSecurityManager
*/
public static SecurityManager getSecurityManager() {
@ -378,7 +377,7 @@ public final class System {
* operating systems measure time in units of tens of
* milliseconds.
*
* <p> See the description of the class <code>Date</code> for
* <p> See the description of the class {@code Date} for
* a discussion of slight discrepancies that may arise between
* "computer time" and coordinated universal time (UTC).
*
@ -393,7 +392,7 @@ public final class System {
* Returns the current value of the running Java Virtual Machine's
* high-resolution time source, in nanoseconds.
*
* <p>This method can only be used to measure elapsed time and is
* This method can only be used to measure elapsed time and is
* not related to any other notion of system or wall-clock time.
* The value returned represents nanoseconds since some fixed but
* arbitrary <i>origin</i> time (perhaps in the future, so values
@ -437,76 +436,76 @@ public final class System {
* Copies an array from the specified source array, beginning at the
* specified position, to the specified position of the destination array.
* A subsequence of array components are copied from the source
* array referenced by <code>src</code> to the destination array
* referenced by <code>dest</code>. The number of components copied is
* equal to the <code>length</code> argument. The components at
* positions <code>srcPos</code> through
* <code>srcPos+length-1</code> in the source array are copied into
* positions <code>destPos</code> through
* <code>destPos+length-1</code>, respectively, of the destination
* array referenced by {@code src} to the destination array
* referenced by {@code dest}. The number of components copied is
* equal to the {@code length} argument. The components at
* positions {@code srcPos} through
* {@code srcPos+length-1} in the source array are copied into
* positions {@code destPos} through
* {@code destPos+length-1}, respectively, of the destination
* array.
* <p>
* If the <code>src</code> and <code>dest</code> arguments refer to the
* If the {@code src} and {@code dest} arguments refer to the
* same array object, then the copying is performed as if the
* components at positions <code>srcPos</code> through
* <code>srcPos+length-1</code> were first copied to a temporary
* array with <code>length</code> components and then the contents of
* components at positions {@code srcPos} through
* {@code srcPos+length-1} were first copied to a temporary
* array with {@code length} components and then the contents of
* the temporary array were copied into positions
* <code>destPos</code> through <code>destPos+length-1</code> of the
* {@code destPos} through {@code destPos+length-1} of the
* destination array.
* <p>
* If <code>dest</code> is <code>null</code>, then a
* <code>NullPointerException</code> is thrown.
* If {@code dest} is {@code null}, then a
* {@code NullPointerException} is thrown.
* <p>
* If <code>src</code> is <code>null</code>, then a
* <code>NullPointerException</code> is thrown and the destination
* If {@code src} is {@code null}, then a
* {@code NullPointerException} is thrown and the destination
* array is not modified.
* <p>
* Otherwise, if any of the following is true, an
* <code>ArrayStoreException</code> is thrown and the destination is
* {@code ArrayStoreException} is thrown and the destination is
* not modified:
* <ul>
* <li>The <code>src</code> argument refers to an object that is not an
* <li>The {@code src} argument refers to an object that is not an
* array.
* <li>The <code>dest</code> argument refers to an object that is not an
* <li>The {@code dest} argument refers to an object that is not an
* array.
* <li>The <code>src</code> argument and <code>dest</code> argument refer
* <li>The {@code src} argument and {@code dest} argument refer
* to arrays whose component types are different primitive types.
* <li>The <code>src</code> argument refers to an array with a primitive
* component type and the <code>dest</code> argument refers to an array
* <li>The {@code src} argument refers to an array with a primitive
* component type and the {@code dest} argument refers to an array
* with a reference component type.
* <li>The <code>src</code> argument refers to an array with a reference
* component type and the <code>dest</code> argument refers to an array
* <li>The {@code src} argument refers to an array with a reference
* component type and the {@code dest} argument refers to an array
* with a primitive component type.
* </ul>
* <p>
* Otherwise, if any of the following is true, an
* <code>IndexOutOfBoundsException</code> is
* {@code IndexOutOfBoundsException} is
* thrown and the destination is not modified:
* <ul>
* <li>The <code>srcPos</code> argument is negative.
* <li>The <code>destPos</code> argument is negative.
* <li>The <code>length</code> argument is negative.
* <li><code>srcPos+length</code> is greater than
* <code>src.length</code>, the length of the source array.
* <li><code>destPos+length</code> is greater than
* <code>dest.length</code>, the length of the destination array.
* <li>The {@code srcPos} argument is negative.
* <li>The {@code destPos} argument is negative.
* <li>The {@code length} argument is negative.
* <li>{@code srcPos+length} is greater than
* {@code src.length}, the length of the source array.
* <li>{@code destPos+length} is greater than
* {@code dest.length}, the length of the destination array.
* </ul>
* <p>
* Otherwise, if any actual component of the source array from
* position <code>srcPos</code> through
* <code>srcPos+length-1</code> cannot be converted to the component
* position {@code srcPos} through
* {@code srcPos+length-1} cannot be converted to the component
* type of the destination array by assignment conversion, an
* <code>ArrayStoreException</code> is thrown. In this case, let
* {@code ArrayStoreException} is thrown. In this case, let
* <b><i>k</i></b> be the smallest nonnegative integer less than
* length such that <code>src[srcPos+</code><i>k</i><code>]</code>
* length such that {@code src[srcPos+}<i>k</i>{@code ]}
* cannot be converted to the component type of the destination
* array; when the exception is thrown, source array components from
* positions <code>srcPos</code> through
* <code>srcPos+</code><i>k</i><code>-1</code>
* positions {@code srcPos} through
* {@code srcPos+}<i>k</i>{@code -1}
* will already have been copied to destination array positions
* <code>destPos</code> through
* <code>destPos+</code><i>k</I><code>-1</code> and no other
* {@code destPos} through
* {@code destPos+}<i>k</I>{@code -1} and no other
* positions of the destination array will have been modified.
* (Because of the restrictions already itemized, this
* paragraph effectively applies only to the situation where both
@ -517,13 +516,13 @@ public final class System {
* @param dest the destination array.
* @param destPos starting position in the destination data.
* @param length the number of array elements to be copied.
* @exception IndexOutOfBoundsException if copying would cause
* access of data outside array bounds.
* @exception ArrayStoreException if an element in the <code>src</code>
* array could not be stored into the <code>dest</code> array
* because of a type mismatch.
* @exception NullPointerException if either <code>src</code> or
* <code>dest</code> is <code>null</code>.
* @throws IndexOutOfBoundsException if copying would cause
* access of data outside array bounds.
* @throws ArrayStoreException if an element in the {@code src}
* array could not be stored into the {@code dest} array
* because of a type mismatch.
* @throws NullPointerException if either {@code src} or
* {@code dest} is {@code null}.
*/
@HotSpotIntrinsicCandidate
public static native void arraycopy(Object src, int srcPos,
@ -574,14 +573,14 @@ public final class System {
/**
* Determines the current system properties.
* <p>
*
* First, if there is a security manager, its
* <code>checkPropertiesAccess</code> method is called with no
* {@code checkPropertiesAccess} method is called with no
* arguments. This may result in a security exception.
* <p>
* The current set of system properties for use by the
* {@link #getProperty(String)} method is returned as a
* <code>Properties</code> object. If there is no current set of
* {@code Properties} object. If there is no current set of
* system properties, a set of system properties is first created and
* initialized. This set of system properties always includes values
* for the following keys:
@ -592,70 +591,70 @@ public final class System {
* <th scope="col">Description of Associated Value</th></tr>
* </thead>
* <tbody>
* <tr><th scope="row"><code>java.version</code></th>
* <tr><th scope="row">{@code java.version}</th>
* <td>Java Runtime Environment version, which may be interpreted
* as a {@link Runtime.Version}</td></tr>
* <tr><th scope="row"><code>java.version.date</code></th>
* <tr><th scope="row">{@code java.version.date}</th>
* <td>Java Runtime Environment version date, in ISO-8601 YYYY-MM-DD
* format, which may be interpreted as a {@link
* java.time.LocalDate}</td></tr>
* <tr><th scope="row"><code>java.vendor</code></th>
* <tr><th scope="row">{@code java.vendor}</th>
* <td>Java Runtime Environment vendor</td></tr>
* <tr><th scope="row"><code>java.vendor.url</code></th>
* <tr><th scope="row">{@code java.vendor.url}</th>
* <td>Java vendor URL</td></tr>
* <tr><th scope="row"><code>java.vendor.version</code></th>
* <tr><th scope="row">{@code java.vendor.version}</th>
* <td>Java vendor version</td></tr>
* <tr><th scope="row"><code>java.home</code></th>
* <tr><th scope="row">{@code java.home}</th>
* <td>Java installation directory</td></tr>
* <tr><th scope="row"><code>java.vm.specification.version</code></th>
* <tr><th scope="row">{@code java.vm.specification.version}</th>
* <td>Java Virtual Machine specification version which may be
* interpreted as a {@link Runtime.Version}</td></tr>
* <tr><th scope="row"><code>java.vm.specification.vendor</code></th>
* <tr><th scope="row">{@code java.vm.specification.vendor}</th>
* <td>Java Virtual Machine specification vendor</td></tr>
* <tr><th scope="row"><code>java.vm.specification.name</code></th>
* <tr><th scope="row">{@code java.vm.specification.name}</th>
* <td>Java Virtual Machine specification name</td></tr>
* <tr><th scope="row"><code>java.vm.version</code></th>
* <tr><th scope="row">{@code java.vm.version}</th>
* <td>Java Virtual Machine implementation version which may be
* interpreted as a {@link Runtime.Version}</td></tr>
* <tr><th scope="row"><code>java.vm.vendor</code></th>
* <tr><th scope="row">{@code java.vm.vendor}</th>
* <td>Java Virtual Machine implementation vendor</td></tr>
* <tr><th scope="row"><code>java.vm.name</code></th>
* <tr><th scope="row">{@code java.vm.name}</th>
* <td>Java Virtual Machine implementation name</td></tr>
* <tr><th scope="row"><code>java.specification.version</code></th>
* <tr><th scope="row">{@code java.specification.version}</th>
* <td>Java Runtime Environment specification version which may be
* interpreted as a {@link Runtime.Version}</td></tr>
* <tr><th scope="row"><code>java.specification.vendor</code></th>
* <tr><th scope="row">{@code java.specification.vendor}</th>
* <td>Java Runtime Environment specification vendor</td></tr>
* <tr><th scope="row"><code>java.specification.name</code></th>
* <tr><th scope="row">{@code java.specification.name}</th>
* <td>Java Runtime Environment specification name</td></tr>
* <tr><th scope="row"><code>java.class.version</code></th>
* <tr><th scope="row">{@code java.class.version}</th>
* <td>Java class format version number</td></tr>
* <tr><th scope="row"><code>java.class.path</code></th>
* <tr><th scope="row">{@code java.class.path}</th>
* <td>Java class path (refer to
* {@link ClassLoader#getSystemClassLoader()} for details)</td></tr>
* <tr><th scope="row"><code>java.library.path</code></th>
* <tr><th scope="row">{@code java.library.path}</th>
* <td>List of paths to search when loading libraries</td></tr>
* <tr><th scope="row"><code>java.io.tmpdir</code></th>
* <tr><th scope="row">{@code java.io.tmpdir}</th>
* <td>Default temp file path</td></tr>
* <tr><th scope="row"><code>java.compiler</code></th>
* <tr><th scope="row">{@code java.compiler}</th>
* <td>Name of JIT compiler to use</td></tr>
* <tr><th scope="row"><code>os.name</code></th>
* <tr><th scope="row">{@code os.name}</th>
* <td>Operating system name</td></tr>
* <tr><th scope="row"><code>os.arch</code></th>
* <tr><th scope="row">{@code os.arch}</th>
* <td>Operating system architecture</td></tr>
* <tr><th scope="row"><code>os.version</code></th>
* <tr><th scope="row">{@code os.version}</th>
* <td>Operating system version</td></tr>
* <tr><th scope="row"><code>file.separator</code></th>
* <tr><th scope="row">{@code file.separator}</th>
* <td>File separator ("/" on UNIX)</td></tr>
* <tr><th scope="row"><code>path.separator</code></th>
* <tr><th scope="row">{@code path.separator}</th>
* <td>Path separator (":" on UNIX)</td></tr>
* <tr><th scope="row"><code>line.separator</code></th>
* <tr><th scope="row">{@code line.separator}</th>
* <td>Line separator ("\n" on UNIX)</td></tr>
* <tr><th scope="row"><code>user.name</code></th>
* <tr><th scope="row">{@code user.name}</th>
* <td>User's account name</td></tr>
* <tr><th scope="row"><code>user.home</code></th>
* <tr><th scope="row">{@code user.home}</th>
* <td>User's home directory</td></tr>
* <tr><th scope="row"><code>user.dir</code></th>
* <tr><th scope="row">{@code user.dir}</th>
* <td>User's current working directory</td></tr>
* </tbody>
* </table>
@ -664,7 +663,7 @@ public final class System {
* separator character of the platform.
* <p>
* Note that even if the security manager does not permit the
* <code>getProperties</code> operation, it may choose to permit the
* {@code getProperties} operation, it may choose to permit the
* {@link #getProperty(String)} operation.
*
* @implNote In addition to the standard system properties, the system
@ -688,9 +687,9 @@ public final class System {
* </table>
*
* @return the system properties
* @exception SecurityException if a security manager exists and its
* <code>checkPropertiesAccess</code> method doesn't allow access
* to the system properties.
* @throws SecurityException if a security manager exists and its
* {@code checkPropertiesAccess} method doesn't allow access
* to the system properties.
* @see #setProperties
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkPropertiesAccess()
@ -723,22 +722,21 @@ public final class System {
private static String lineSeparator;
/**
* Sets the system properties to the <code>Properties</code>
* argument.
* <p>
* Sets the system properties to the {@code Properties} argument.
*
* First, if there is a security manager, its
* <code>checkPropertiesAccess</code> method is called with no
* {@code checkPropertiesAccess} method is called with no
* arguments. This may result in a security exception.
* <p>
* The argument becomes the current set of system properties for use
* by the {@link #getProperty(String)} method. If the argument is
* <code>null</code>, then the current set of system properties is
* {@code null}, then the current set of system properties is
* forgotten.
*
* @param props the new system properties.
* @exception SecurityException if a security manager exists and its
* <code>checkPropertiesAccess</code> method doesn't allow access
* to the system properties.
* @throws SecurityException if a security manager exists and its
* {@code checkPropertiesAccess} method doesn't allow access
* to the system properties.
* @see #getProperties
* @see java.util.Properties
* @see java.lang.SecurityException
@ -758,25 +756,24 @@ public final class System {
/**
* Gets the system property indicated by the specified key.
* <p>
*
* First, if there is a security manager, its
* <code>checkPropertyAccess</code> method is called with the key as
* {@code checkPropertyAccess} method is called with the key as
* its argument. This may result in a SecurityException.
* <p>
* If there is no current set of system properties, a set of system
* properties is first created and initialized in the same manner as
* for the <code>getProperties</code> method.
* for the {@code getProperties} method.
*
* @param key the name of the system property.
* @return the string value of the system property,
* or <code>null</code> if there is no property with that key.
* or {@code null} if there is no property with that key.
*
* @exception SecurityException if a security manager exists and its
* <code>checkPropertyAccess</code> method doesn't allow
* access to the specified system property.
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @throws SecurityException if a security manager exists and its
* {@code checkPropertyAccess} method doesn't allow
* access to the specified system property.
* @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if {@code key} is empty.
* @see #setProperty
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
@ -794,26 +791,25 @@ public final class System {
/**
* Gets the system property indicated by the specified key.
* <p>
*
* First, if there is a security manager, its
* <code>checkPropertyAccess</code> method is called with the
* <code>key</code> as its argument.
* {@code checkPropertyAccess} method is called with the
* {@code key} as its argument.
* <p>
* If there is no current set of system properties, a set of system
* properties is first created and initialized in the same manner as
* for the <code>getProperties</code> method.
* for the {@code getProperties} method.
*
* @param key the name of the system property.
* @param def a default value.
* @return the string value of the system property,
* or the default value if there is no property with that key.
*
* @exception SecurityException if a security manager exists and its
* <code>checkPropertyAccess</code> method doesn't allow
* @throws SecurityException if a security manager exists and its
* {@code checkPropertyAccess} method doesn't allow
* access to the specified system property.
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if {@code key} is empty.
* @see #setProperty
* @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
* @see java.lang.System#getProperties()
@ -830,10 +826,10 @@ public final class System {
/**
* Sets the system property indicated by the specified key.
* <p>
*
* First, if a security manager exists, its
* <code>SecurityManager.checkPermission</code> method
* is called with a <code>PropertyPermission(key, "write")</code>
* {@code SecurityManager.checkPermission} method
* is called with a {@code PropertyPermission(key, "write")}
* permission. This may result in a SecurityException being thrown.
* If no exception is thrown, the specified property is set to the given
* value.
@ -841,14 +837,14 @@ public final class System {
* @param key the name of the system property.
* @param value the value of the system property.
* @return the previous value of the system property,
* or <code>null</code> if it did not have one.
* or {@code null} if it did not have one.
*
* @exception SecurityException if a security manager exists and its
* <code>checkPermission</code> method doesn't allow
* @throws SecurityException if a security manager exists and its
* {@code checkPermission} method doesn't allow
* setting of the specified property.
* @exception NullPointerException if <code>key</code> or
* <code>value</code> is <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @throws NullPointerException if {@code key} or
* {@code value} is {@code null}.
* @throws IllegalArgumentException if {@code key} is empty.
* @see #getProperty
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
@ -869,23 +865,22 @@ public final class System {
/**
* Removes the system property indicated by the specified key.
* <p>
*
* First, if a security manager exists, its
* <code>SecurityManager.checkPermission</code> method
* is called with a <code>PropertyPermission(key, "write")</code>
* {@code SecurityManager.checkPermission} method
* is called with a {@code PropertyPermission(key, "write")}
* permission. This may result in a SecurityException being thrown.
* If no exception is thrown, the specified property is removed.
*
* @param key the name of the system property to be removed.
* @return the previous string value of the system property,
* or <code>null</code> if there was no property with that key.
* or {@code null} if there was no property with that key.
*
* @exception SecurityException if a security manager exists and its
* <code>checkPropertyAccess</code> method doesn't allow
* @throws SecurityException if a security manager exists and its
* {@code checkPropertyAccess} method doesn't allow
* access to the specified system property.
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if {@code key} is empty.
* @see #getProperty
* @see #setProperty
* @see java.util.Properties
@ -920,10 +915,10 @@ public final class System {
* <p>If a security manager exists, its
* {@link SecurityManager#checkPermission checkPermission}
* method is called with a
* <code>{@link RuntimePermission}("getenv."+name)</code>
* {@code {@link RuntimePermission}("getenv."+name)}
* permission. This may result in a {@link SecurityException}
* being thrown. If no exception is thrown the value of the
* variable <code>name</code> is returned.
* variable {@code name} is returned.
*
* <p><a id="EnvironmentVSSystemProperties"><i>System
* properties</i> and <i>environment variables</i></a> are both
@ -938,23 +933,23 @@ public final class System {
* unintended side effects. It is best to use system properties
* where possible. Environment variables should be used when a
* global effect is desired, or when an external system interface
* requires an environment variable (such as <code>PATH</code>).
* requires an environment variable (such as {@code PATH}).
*
* <p>On UNIX systems the alphabetic case of <code>name</code> is
* <p>On UNIX systems the alphabetic case of {@code name} is
* typically significant, while on Microsoft Windows systems it is
* typically not. For example, the expression
* <code>System.getenv("FOO").equals(System.getenv("foo"))</code>
* {@code System.getenv("FOO").equals(System.getenv("foo"))}
* is likely to be true on Microsoft Windows.
*
* @param name the name of the environment variable
* @return the string value of the variable, or <code>null</code>
* @return the string value of the variable, or {@code null}
* if the variable is not defined in the system environment
* @throws NullPointerException if <code>name</code> is <code>null</code>
* @throws NullPointerException if {@code name} is {@code null}
* @throws SecurityException
* if a security manager exists and its
* {@link SecurityManager#checkPermission checkPermission}
* method doesn't allow access to the environment variable
* <code>name</code>
* {@code name}
* @see #getenv()
* @see ProcessBuilder#environment()
*/
@ -991,9 +986,8 @@ public final class System {
* <p>If a security manager exists, its
* {@link SecurityManager#checkPermission checkPermission}
* method is called with a
* <code>{@link RuntimePermission}("getenv.*")</code>
* permission. This may result in a {@link SecurityException} being
* thrown.
* {@code {@link RuntimePermission}("getenv.*")} permission.
* This may result in a {@link SecurityException} being thrown.
*
* <p>When passing information to a Java subprocess,
* <a href=#EnvironmentVSSystemProperties>system properties</a>
@ -1021,7 +1015,7 @@ public final class System {
* {@code System.Logger} instances log messages that will be
* routed to the underlying logging framework the {@link System.LoggerFinder
* LoggerFinder} uses.
* <p>
*
* {@code System.Logger} instances are typically obtained from
* the {@link java.lang.System System} class, by calling
* {@link java.lang.System#getLogger(java.lang.String) System.getLogger(loggerName)}
@ -1033,13 +1027,12 @@ public final class System {
* @see java.lang.System.LoggerFinder
*
* @since 9
*
*/
public interface Logger {
/**
* System {@linkplain Logger loggers} levels.
* <p>
*
* A level has a {@linkplain #getName() name} and {@linkplain
* #getSeverity() severity}.
* Level values are {@link #ALL}, {@link #TRACE}, {@link #DEBUG},
@ -1199,7 +1192,7 @@ public final class System {
/**
* Logs a lazily supplied message.
* <p>
*
* If the logger is currently enabled for the given log message level
* then a message is logged that is the result produced by the
* given supplier function. Otherwise, the supplier is not operated on.
@ -1223,7 +1216,7 @@ public final class System {
/**
* Logs a message produced from the given object.
* <p>
*
* If the logger is currently enabled for the given log message level then
* a message is logged that, by default, is the result produced from
* calling toString on the given object.
@ -1269,7 +1262,7 @@ public final class System {
/**
* Logs a lazily supplied message associated with a given throwable.
* <p>
*
* If the logger is currently enabled for the given log message level
* then a message is logged that is the result produced by the
* given supplier function. Otherwise, the supplier is not operated on.
@ -1318,7 +1311,7 @@ public final class System {
/**
* Logs a localized message associated with a given throwable.
* <p>
*
* If the given resource bundle is non-{@code null}, the {@code msg}
* string is localized using the given resource bundle.
* Otherwise the {@code msg} string is not localized.
@ -1339,7 +1332,7 @@ public final class System {
/**
* Logs a message with resource bundle and an optional list of
* parameters.
* <p>
*
* If the given resource bundle is non-{@code null}, the {@code format}
* string is localized using the given resource bundle.
* Otherwise the {@code format} string is not localized.
@ -1357,14 +1350,12 @@ public final class System {
*/
public void log(Level level, ResourceBundle bundle, String format,
Object... params);
}
/**
* The {@code LoggerFinder} service is responsible for creating, managing,
* and configuring loggers to the underlying framework it uses.
* <p>
*
* A logger finder is a concrete implementation of this class that has a
* zero-argument constructor and implements the abstract methods defined
* by this class.
@ -1516,9 +1507,9 @@ public final class System {
* take a {@link ResourceBundle} as parameter are redirected to one
* which does - passing the given {@code bundle} for
* localization. So for instance, a call to {@link
* Logger#log(Level, String) Logger.log(Level.INFO, msg)}
* Logger#log(Logger.Level, String) Logger.log(Level.INFO, msg)}
* will end up as a call to {@link
* Logger#log(Level, ResourceBundle, String, Object...)
* Logger#log(Logger.Level, ResourceBundle, String, Object...)
* Logger.log(Level.INFO, bundle, msg, (Object[])null)} on the wrapped
* logger instance.
* Note however that by default, string messages returned by {@link
@ -1702,10 +1693,10 @@ public final class System {
* argument serves as a status code; by convention, a nonzero status
* code indicates abnormal termination.
* <p>
* This method calls the <code>exit</code> method in class
* <code>Runtime</code>. This method never returns normally.
* This method calls the {@code exit} method in class
* {@code Runtime}. This method never returns normally.
* <p>
* The call <code>System.exit(n)</code> is effectively equivalent to
* The call {@code System.exit(n)} is effectively equivalent to
* the call:
* <blockquote><pre>
* Runtime.getRuntime().exit(n)
@ -1713,7 +1704,7 @@ public final class System {
*
* @param status exit status.
* @throws SecurityException
* if a security manager exists and its <code>checkExit</code>
* if a security manager exists and its {@code checkExit}
* method doesn't allow exit with the specified status.
* @see java.lang.Runtime#exit(int)
*/
@ -1723,15 +1714,15 @@ public final class System {
/**
* Runs the garbage collector.
* <p>
* Calling the <code>gc</code> method suggests that the Java Virtual
*
* Calling the {@code gc} method suggests that the Java Virtual
* Machine expend effort toward recycling unused objects in order to
* make the memory they currently occupy available for quick reuse.
* When control returns from the method call, the Java Virtual
* Machine has made a best effort to reclaim space from all discarded
* objects.
* <p>
* The call <code>System.gc()</code> is effectively equivalent to the
* The call {@code System.gc()} is effectively equivalent to the
* call:
* <blockquote><pre>
* Runtime.getRuntime().gc()
@ -1745,15 +1736,15 @@ public final class System {
/**
* Runs the finalization methods of any objects pending finalization.
* <p>
*
* Calling this method suggests that the Java Virtual Machine expend
* effort toward running the <code>finalize</code> methods of objects
* that have been found to be discarded but whose <code>finalize</code>
* effort toward running the {@code finalize} methods of objects
* that have been found to be discarded but whose {@code finalize}
* methods have not yet been run. When control returns from the
* method call, the Java Virtual Machine has made a best effort to
* complete all outstanding finalizations.
* <p>
* The call <code>System.runFinalization()</code> is effectively
* The call {@code System.runFinalization()} is effectively
* equivalent to the call:
* <blockquote><pre>
* Runtime.getRuntime().runFinalization()
@ -1783,22 +1774,21 @@ public final class System {
* an implementation-dependent manner.
*
* <p>
* The call <code>System.load(name)</code> is effectively equivalent
* The call {@code System.load(name)} is effectively equivalent
* to the call:
* <blockquote><pre>
* Runtime.getRuntime().load(name)
* </pre></blockquote>
*
* @param filename the file to load.
* @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow
* @throws SecurityException if a security manager exists and its
* {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the filename is not an
* @throws UnsatisfiedLinkError if either the filename is not an
* absolute path name, the native library is not statically
* linked with the VM, or the library cannot be mapped to
* a native library image by the host system.
* @exception NullPointerException if <code>filename</code> is
* <code>null</code>
* @throws NullPointerException if {@code filename} is {@code null}
* @see java.lang.Runtime#load(java.lang.String)
* @see java.lang.SecurityManager#checkLink(java.lang.String)
*/
@ -1808,11 +1798,11 @@ public final class System {
}
/**
* Loads the native library specified by the <code>libname</code>
* argument. The <code>libname</code> argument must not contain any platform
* Loads the native library specified by the {@code libname}
* argument. The {@code libname} argument must not contain any platform
* specific prefix, file extension or path. If a native library
* called <code>libname</code> is statically linked with the VM, then the
* JNI_OnLoad_<code>libname</code> function exported by the library is invoked.
* called {@code libname} is statically linked with the VM, then the
* JNI_OnLoad_{@code libname} function exported by the library is invoked.
* See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
* for more details.
*
@ -1820,22 +1810,21 @@ public final class System {
* location and mapped to a native library image in an implementation-
* dependent manner.
* <p>
* The call <code>System.loadLibrary(name)</code> is effectively
* The call {@code System.loadLibrary(name)} is effectively
* equivalent to the call
* <blockquote><pre>
* Runtime.getRuntime().loadLibrary(name)
* </pre></blockquote>
*
* @param libname the name of the library.
* @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow
* @throws SecurityException if a security manager exists and its
* {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the libname argument
* @throws UnsatisfiedLinkError if either the libname argument
* contains a file path, the native library is not statically
* linked with the VM, or the library cannot be mapped to a
* native library image by the host system.
* @exception NullPointerException if <code>libname</code> is
* <code>null</code>
* @throws NullPointerException if {@code libname} is {@code null}
* @see java.lang.Runtime#loadLibrary(java.lang.String)
* @see java.lang.SecurityManager#checkLink(java.lang.String)
*/
@ -1850,8 +1839,7 @@ public final class System {
*
* @param libname the name of the library.
* @return a platform-dependent native library name.
* @exception NullPointerException if <code>libname</code> is
* <code>null</code>
* @throws NullPointerException if {@code libname} is {@code null}
* @see java.lang.System#loadLibrary(java.lang.String)
* @see java.lang.ClassLoader#findLibrary(java.lang.String)
* @since 1.2

View file

@ -50,30 +50,30 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* Every thread has a priority. Threads with higher priority are
* executed in preference to threads with lower priority. Each thread
* may or may not also be marked as a daemon. When code running in
* some thread creates a new <code>Thread</code> object, the new
* some thread creates a new {@code Thread} object, the new
* thread has its priority initially set equal to the priority of the
* creating thread, and is a daemon thread if and only if the
* creating thread is a daemon.
* <p>
* When a Java Virtual Machine starts up, there is usually a single
* non-daemon thread (which typically calls the method named
* <code>main</code> of some designated class). The Java Virtual
* {@code main} of some designated class). The Java Virtual
* Machine continues to execute threads until either of the following
* occurs:
* <ul>
* <li>The <code>exit</code> method of class <code>Runtime</code> has been
* <li>The {@code exit} method of class {@code Runtime} has been
* called and the security manager has permitted the exit operation
* to take place.
* <li>All threads that are not daemon threads have died, either by
* returning from the call to the <code>run</code> method or by
* throwing an exception that propagates beyond the <code>run</code>
* returning from the call to the {@code run} method or by
* throwing an exception that propagates beyond the {@code run}
* method.
* </ul>
* <p>
* There are two ways to create a new thread of execution. One is to
* declare a class to be a subclass of <code>Thread</code>. This
* subclass should override the <code>run</code> method of class
* <code>Thread</code>. An instance of the subclass can then be
* declare a class to be a subclass of {@code Thread}. This
* subclass should override the {@code run} method of class
* {@code Thread}. An instance of the subclass can then be
* allocated and started. For example, a thread that computes primes
* larger than a stated value could be written as follows:
* <hr><blockquote><pre>
@ -97,10 +97,10 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* </pre></blockquote>
* <p>
* The other way to create a thread is to declare a class that
* implements the <code>Runnable</code> interface. That class then
* implements the <code>run</code> method. An instance of the class can
* implements the {@code Runnable} interface. That class then
* implements the {@code run} method. An instance of the class can
* then be allocated, passed as an argument when creating
* <code>Thread</code>, and started. The same example in this other
* {@code Thread}, and started. The same example in this other
* style looks like the following:
* <hr><blockquote><pre>
* class PrimeRun implements Runnable {
@ -774,19 +774,18 @@ class Thread implements Runnable {
/**
* Causes this thread to begin execution; the Java Virtual Machine
* calls the <code>run</code> method of this thread.
* calls the {@code run} method of this thread.
* <p>
* The result is that two threads are running concurrently: the
* current thread (which returns from the call to the
* <code>start</code> method) and the other thread (which executes its
* <code>run</code> method).
* {@code start} method) and the other thread (which executes its
* {@code run} method).
* <p>
* It is never legal to start a thread more than once.
* In particular, a thread may not be restarted once it has completed
* execution.
*
* @exception IllegalThreadStateException if the thread was already
* started.
* @throws IllegalThreadStateException if the thread was already started.
* @see #run()
* @see #stop()
*/
@ -826,11 +825,11 @@ class Thread implements Runnable {
/**
* If this thread was constructed using a separate
* <code>Runnable</code> run object, then that
* <code>Runnable</code> object's <code>run</code> method is called;
* {@code Runnable} run object, then that
* {@code Runnable} object's {@code run} method is called;
* otherwise, this method does nothing and returns.
* <p>
* Subclasses of <code>Thread</code> should override this method.
* Subclasses of {@code Thread} should override this method.
*
* @see #start()
* @see #stop()
@ -865,42 +864,42 @@ class Thread implements Runnable {
/**
* Forces the thread to stop executing.
* <p>
* If there is a security manager installed, its <code>checkAccess</code>
* method is called with <code>this</code>
* If there is a security manager installed, its {@code checkAccess}
* method is called with {@code this}
* as its argument. This may result in a
* <code>SecurityException</code> being raised (in the current thread).
* {@code SecurityException} being raised (in the current thread).
* <p>
* If this thread is different from the current thread (that is, the current
* thread is trying to stop a thread other than itself), the
* security manager's <code>checkPermission</code> method (with a
* <code>RuntimePermission("stopThread")</code> argument) is called in
* security manager's {@code checkPermission} method (with a
* {@code RuntimePermission("stopThread")} argument) is called in
* addition.
* Again, this may result in throwing a
* <code>SecurityException</code> (in the current thread).
* {@code SecurityException} (in the current thread).
* <p>
* The thread represented by this thread is forced to stop whatever
* it is doing abnormally and to throw a newly created
* <code>ThreadDeath</code> object as an exception.
* {@code ThreadDeath} object as an exception.
* <p>
* It is permitted to stop a thread that has not yet been started.
* If the thread is eventually started, it immediately terminates.
* <p>
* An application should not normally try to catch
* <code>ThreadDeath</code> unless it must do some extraordinary
* {@code ThreadDeath} unless it must do some extraordinary
* cleanup operation (note that the throwing of
* <code>ThreadDeath</code> causes <code>finally</code> clauses of
* <code>try</code> statements to be executed before the thread
* officially dies). If a <code>catch</code> clause catches a
* <code>ThreadDeath</code> object, it is important to rethrow the
* {@code ThreadDeath} causes {@code finally} clauses of
* {@code try} statements to be executed before the thread
* officially dies). If a {@code catch} clause catches a
* {@code ThreadDeath} object, it is important to rethrow the
* object so that the thread actually dies.
* <p>
* The top-level error handler that reacts to otherwise uncaught
* exceptions does not print out a message or otherwise notify the
* application if the uncaught exception is an instance of
* <code>ThreadDeath</code>.
* {@code ThreadDeath}.
*
* @exception SecurityException if the current thread cannot
* modify this thread.
* @throws SecurityException if the current thread cannot
* modify this thread.
* @see #interrupt()
* @see #checkAccess()
* @see #run()
@ -912,17 +911,17 @@ class Thread implements Runnable {
* @deprecated This method is inherently unsafe. Stopping a thread with
* Thread.stop causes it to unlock all of the monitors that it
* has locked (as a natural consequence of the unchecked
* <code>ThreadDeath</code> exception propagating up the stack). If
* {@code ThreadDeath} exception propagating up the stack). If
* any of the objects previously protected by these monitors were in
* an inconsistent state, the damaged objects become visible to
* other threads, potentially resulting in arbitrary behavior. Many
* uses of <code>stop</code> should be replaced by code that simply
* uses of {@code stop} should be replaced by code that simply
* modifies some variable to indicate that the target thread should
* stop running. The target thread should check this variable
* regularly, and return from its run method in an orderly fashion
* if the variable indicates that it is to stop running. If the
* target thread waits for long periods (on a condition variable,
* for example), the <code>interrupt</code> method should be used to
* for example), the {@code interrupt} method should be used to
* interrupt the wait.
* For more information, see
* <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
@ -1037,8 +1036,8 @@ class Thread implements Runnable {
* at the time of the interrupt will be reflected by this method
* returning false.
*
* @return <code>true</code> if the current thread has been interrupted;
* <code>false</code> otherwise.
* @return {@code true} if the current thread has been interrupted;
* {@code false} otherwise.
* @see #isInterrupted()
* @revised 6.0
*/
@ -1054,8 +1053,8 @@ class Thread implements Runnable {
* at the time of the interrupt will be reflected by this method
* returning false.
*
* @return <code>true</code> if this thread has been interrupted;
* <code>false</code> otherwise.
* @return {@code true} if this thread has been interrupted;
* {@code false} otherwise.
* @see #interrupted()
* @revised 6.0
*/
@ -1098,30 +1097,30 @@ class Thread implements Runnable {
* Tests if this thread is alive. A thread is alive if it has
* been started and has not yet died.
*
* @return <code>true</code> if this thread is alive;
* <code>false</code> otherwise.
* @return {@code true} if this thread is alive;
* {@code false} otherwise.
*/
public final native boolean isAlive();
/**
* Suspends this thread.
* <p>
* First, the <code>checkAccess</code> method of this thread is called
* First, the {@code checkAccess} method of this thread is called
* with no arguments. This may result in throwing a
* <code>SecurityException </code>(in the current thread).
* {@code SecurityException }(in the current thread).
* <p>
* If the thread is alive, it is suspended and makes no further
* progress unless and until it is resumed.
*
* @exception SecurityException if the current thread cannot modify
* this thread.
* @throws SecurityException if the current thread cannot modify
* this thread.
* @see #checkAccess
* @deprecated This method has been deprecated, as it is
* inherently deadlock-prone. If the target thread holds a lock on the
* monitor protecting a critical system resource when it is suspended, no
* thread can access this resource until the target thread is resumed. If
* the thread that would resume the target thread attempts to lock this
* monitor prior to calling <code>resume</code>, deadlock results. Such
* monitor prior to calling {@code resume}, deadlock results. Such
* deadlocks typically manifest themselves as "frozen" processes.
* For more information, see
* <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
@ -1136,15 +1135,15 @@ class Thread implements Runnable {
/**
* Resumes a suspended thread.
* <p>
* First, the <code>checkAccess</code> method of this thread is called
* First, the {@code checkAccess} method of this thread is called
* with no arguments. This may result in throwing a
* <code>SecurityException</code> (in the current thread).
* {@code SecurityException} (in the current thread).
* <p>
* If the thread is alive but suspended, it is resumed and is
* permitted to make progress in its execution.
*
* @exception SecurityException if the current thread cannot modify this
* thread.
* @throws SecurityException if the current thread cannot modify this
* thread.
* @see #checkAccess
* @see #suspend()
* @deprecated This method exists solely for use with {@link #suspend},
@ -1162,19 +1161,18 @@ class Thread implements Runnable {
/**
* Changes the priority of this thread.
* <p>
* First the <code>checkAccess</code> method of this thread is called
* with no arguments. This may result in throwing a
* <code>SecurityException</code>.
* First the {@code checkAccess} method of this thread is called
* with no arguments. This may result in throwing a {@code SecurityException}.
* <p>
* Otherwise, the priority of this thread is set to the smaller of
* the specified <code>newPriority</code> and the maximum permitted
* the specified {@code newPriority} and the maximum permitted
* priority of the thread's thread group.
*
* @param newPriority priority to set this thread to
* @exception IllegalArgumentException If the priority is not in the
* range <code>MIN_PRIORITY</code> to
* <code>MAX_PRIORITY</code>.
* @exception SecurityException if the current thread cannot modify
* @throws IllegalArgumentException If the priority is not in the
* range {@code MIN_PRIORITY} to
* {@code MAX_PRIORITY}.
* @throws SecurityException if the current thread cannot modify
* this thread.
* @see #getPriority
* @see #checkAccess()
@ -1208,16 +1206,15 @@ class Thread implements Runnable {
}
/**
* Changes the name of this thread to be equal to the argument
* <code>name</code>.
* Changes the name of this thread to be equal to the argument {@code name}.
* <p>
* First the <code>checkAccess</code> method of this thread is called
* First the {@code checkAccess} method of this thread is called
* with no arguments. This may result in throwing a
* <code>SecurityException</code>.
* {@code SecurityException}.
*
* @param name the new name for this thread.
* @exception SecurityException if the current thread cannot modify this
* thread.
* @throws SecurityException if the current thread cannot modify this
* thread.
* @see #getName
* @see #checkAccess()
*/
@ -1309,7 +1306,7 @@ class Thread implements Runnable {
* be suspended.
*
* @return the number of stack frames in this thread.
* @exception IllegalThreadStateException if this thread is not
* @throws IllegalThreadStateException if this thread is not
* suspended.
* @deprecated The definition of this call depends on {@link #suspend},
* which is deprecated. Further, the results of this call
@ -1465,8 +1462,8 @@ class Thread implements Runnable {
/**
* Tests if this thread is a daemon thread.
*
* @return <code>true</code> if this thread is a daemon thread;
* <code>false</code> otherwise.
* @return {@code true} if this thread is a daemon thread;
* {@code false} otherwise.
* @see #setDaemon(boolean)
*/
public final boolean isDaemon() {
@ -1477,12 +1474,12 @@ class Thread implements Runnable {
* Determines if the currently running thread has permission to
* modify this thread.
* <p>
* If there is a security manager, its <code>checkAccess</code> method
* If there is a security manager, its {@code checkAccess} method
* is called with this thread as its argument. This may result in
* throwing a <code>SecurityException</code>.
* throwing a {@code SecurityException}.
*
* @exception SecurityException if the current thread is not allowed to
* access this thread.
* @throws SecurityException if the current thread is not allowed to
* access this thread.
* @see SecurityManager#checkAccess(Thread)
*/
public final void checkAccess() {

View file

@ -82,11 +82,11 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* Constructs a new thread group. The parent of this new group is
* the thread group of the currently running thread.
* <p>
* The <code>checkAccess</code> method of the parent thread group is
* The {@code checkAccess} method of the parent thread group is
* called with no arguments; this may result in a security exception.
*
* @param name the name of the new thread group.
* @exception SecurityException if the current thread cannot create a
* @throws SecurityException if the current thread cannot create a
* thread in the specified thread group.
* @see java.lang.ThreadGroup#checkAccess()
* @since 1.0
@ -99,14 +99,14 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* Creates a new thread group. The parent of this new group is the
* specified thread group.
* <p>
* The <code>checkAccess</code> method of the parent thread group is
* The {@code checkAccess} method of the parent thread group is
* called with no arguments; this may result in a security exception.
*
* @param parent the parent thread group.
* @param name the name of the new thread group.
* @exception NullPointerException if the thread group argument is
* <code>null</code>.
* @exception SecurityException if the current thread cannot create a
* @throws NullPointerException if the thread group argument is
* {@code null}.
* @throws SecurityException if the current thread cannot create a
* thread in the specified thread group.
* @see java.lang.SecurityException
* @see java.lang.ThreadGroup#checkAccess()
@ -147,13 +147,13 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Returns the parent of this thread group.
* <p>
* First, if the parent is not <code>null</code>, the
* <code>checkAccess</code> method of the parent thread group is
* First, if the parent is not {@code null}, the
* {@code checkAccess} method of the parent thread group is
* called with no arguments; this may result in a security exception.
*
* @return the parent of this thread group. The top-level thread group
* is the only thread group whose parent is <code>null</code>.
* @exception SecurityException if the current thread cannot modify
* is the only thread group whose parent is {@code null}.
* @throws SecurityException if the current thread cannot modify
* this thread group.
* @see java.lang.ThreadGroup#checkAccess()
* @see java.lang.SecurityException
@ -185,8 +185,8 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* daemon thread group is automatically destroyed when its last
* thread is stopped or its last thread group is destroyed.
*
* @return <code>true</code> if this thread group is a daemon thread group;
* <code>false</code> otherwise.
* @return {@code true} if this thread group is a daemon thread group;
* {@code false} otherwise.
* @since 1.0
*/
public final boolean isDaemon() {
@ -206,16 +206,16 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Changes the daemon status of this thread group.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* A daemon thread group is automatically destroyed when its last
* thread is stopped or its last thread group is destroyed.
*
* @param daemon if <code>true</code>, marks this thread group as
* @param daemon if {@code true}, marks this thread group as
* a daemon thread group; otherwise, marks this
* thread group as normal.
* @exception SecurityException if the current thread cannot modify
* @throws SecurityException if the current thread cannot modify
* this thread group.
* @see java.lang.SecurityException
* @see java.lang.ThreadGroup#checkAccess()
@ -230,24 +230,24 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* Sets the maximum priority of the group. Threads in the thread
* group that already have a higher priority are not affected.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* If the <code>pri</code> argument is less than
* If the {@code pri} argument is less than
* {@link Thread#MIN_PRIORITY} or greater than
* {@link Thread#MAX_PRIORITY}, the maximum priority of the group
* remains unchanged.
* <p>
* Otherwise, the priority of this ThreadGroup object is set to the
* smaller of the specified <code>pri</code> and the maximum permitted
* smaller of the specified {@code pri} and the maximum permitted
* priority of the parent of this thread group. (If this thread group
* is the system thread group, which has no parent, then its maximum
* priority is simply set to <code>pri</code>.) Then this method is
* called recursively, with <code>pri</code> as its argument, for
* priority is simply set to {@code pri}.) Then this method is
* called recursively, with {@code pri} as its argument, for
* every thread group that belongs to this thread group.
*
* @param pri the new priority of the thread group.
* @exception SecurityException if the current thread cannot modify
* @throws SecurityException if the current thread cannot modify
* this thread group.
* @see #getMaxPriority
* @see java.lang.SecurityException
@ -280,9 +280,9 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* argument or one of its ancestor thread groups.
*
* @param g a thread group.
* @return <code>true</code> if this thread group is the thread group
* @return {@code true} if this thread group is the thread group
* argument or one of its ancestor thread groups;
* <code>false</code> otherwise.
* {@code false} otherwise.
* @since 1.0
*/
public final boolean parentOf(ThreadGroup g) {
@ -298,11 +298,11 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* Determines if the currently running thread has permission to
* modify this thread group.
* <p>
* If there is a security manager, its <code>checkAccess</code> method
* If there is a security manager, its {@code checkAccess} method
* is called with this thread group as its argument. This may result
* in throwing a <code>SecurityException</code>.
* in throwing a {@code SecurityException}.
*
* @exception SecurityException if the current thread is not allowed to
* @throws SecurityException if the current thread is not allowed to
* access this thread group.
* @see java.lang.SecurityManager#checkAccess(java.lang.ThreadGroup)
* @since 1.0
@ -589,13 +589,13 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Stops all threads in this thread group.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* This method then calls the <code>stop</code> method on all the
* This method then calls the {@code stop} method on all the
* threads in this thread group and in all of its subgroups.
*
* @exception SecurityException if the current thread is not allowed
* @throws SecurityException if the current thread is not allowed
* to access this thread group or any of the threads in
* the thread group.
* @see java.lang.SecurityException
@ -614,13 +614,13 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Interrupts all threads in this thread group.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* This method then calls the <code>interrupt</code> method on all the
* This method then calls the {@code interrupt} method on all the
* threads in this thread group and in all of its subgroups.
*
* @exception SecurityException if the current thread is not allowed
* @throws SecurityException if the current thread is not allowed
* to access this thread group or any of the threads in
* the thread group.
* @see java.lang.Thread#interrupt()
@ -651,13 +651,13 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Suspends all threads in this thread group.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* This method then calls the <code>suspend</code> method on all the
* This method then calls the {@code suspend} method on all the
* threads in this thread group and in all of its subgroups.
*
* @exception SecurityException if the current thread is not allowed
* @throws SecurityException if the current thread is not allowed
* to access this thread group or any of the threads in
* the thread group.
* @see java.lang.Thread#suspend()
@ -712,13 +712,13 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Resumes all threads in this thread group.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
* <p>
* This method then calls the <code>resume</code> method on all the
* This method then calls the {@code resume} method on all the
* threads in this thread group and in all of its sub groups.
*
* @exception SecurityException if the current thread is not allowed to
* @throws SecurityException if the current thread is not allowed to
* access this thread group or any of the threads in the
* thread group.
* @see java.lang.SecurityException
@ -757,12 +757,12 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* group must be empty, indicating that all threads that had been in
* this thread group have since stopped.
* <p>
* First, the <code>checkAccess</code> method of this thread group is
* First, the {@code checkAccess} method of this thread group is
* called with no arguments; this may result in a security exception.
*
* @exception IllegalThreadStateException if the thread group is not
* @throws IllegalThreadStateException if the thread group is not
* empty or if the thread group has already been destroyed.
* @exception SecurityException if the current thread cannot modify this
* @throws SecurityException if the current thread cannot modify this
* thread group.
* @see java.lang.ThreadGroup#checkAccess()
* @since 1.0
@ -800,7 +800,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
/**
* Adds the specified Thread group to this group.
* @param g the specified Thread group to be added
* @exception IllegalThreadStateException If the Thread group has been destroyed.
* @throws IllegalThreadStateException If the Thread group has been destroyed.
*/
private final void add(ThreadGroup g){
synchronized (this) {
@ -878,7 +878,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* @param t
* the Thread to be added
*
* @throws IllegalThreadStateException
* @throws IllegalThreadStateException
* if the Thread group has been destroyed
*/
void add(Thread t) {
@ -1016,29 +1016,29 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* does not have a specific {@link Thread.UncaughtExceptionHandler}
* installed.
* <p>
* The <code>uncaughtException</code> method of
* <code>ThreadGroup</code> does the following:
* The {@code uncaughtException} method of
* {@code ThreadGroup} does the following:
* <ul>
* <li>If this thread group has a parent thread group, the
* <code>uncaughtException</code> method of that parent is called
* {@code uncaughtException} method of that parent is called
* with the same two arguments.
* <li>Otherwise, this method checks to see if there is a
* {@linkplain Thread#getDefaultUncaughtExceptionHandler default
* uncaught exception handler} installed, and if so, its
* <code>uncaughtException</code> method is called with the same
* {@code uncaughtException} method is called with the same
* two arguments.
* <li>Otherwise, this method determines if the <code>Throwable</code>
* <li>Otherwise, this method determines if the {@code Throwable}
* argument is an instance of {@link ThreadDeath}. If so, nothing
* special is done. Otherwise, a message containing the
* thread's name, as returned from the thread's {@link
* Thread#getName getName} method, and a stack backtrace,
* using the <code>Throwable</code>'s {@link
* using the {@code Throwable}'s {@link
* Throwable#printStackTrace printStackTrace} method, is
* printed to the {@linkplain System#err standard error stream}.
* </ul>
* <p>
* Applications can override this method in subclasses of
* <code>ThreadGroup</code> to provide alternative handling of
* {@code ThreadGroup} to provide alternative handling of
* uncaught exceptions.
*
* @param t the thread that is about to exit.