diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java
index 114f6cb968f..e75fcb439cf 100644
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java
@@ -32,9 +32,9 @@ import sun.reflect.Reflection;
/**
* Every Java application has a single instance of class
- * Runtime
that allows the application to interface with
+ * {@code Runtime} that allows the application to interface with
* the environment in which the application is running. The current
- * runtime can be obtained from the getRuntime
method.
+ * runtime can be obtained from the {@code getRuntime} method.
*
* An application cannot create its own instance of this class.
*
@@ -48,10 +48,10 @@ public class Runtime {
/**
* Returns the runtime object associated with the current Java application.
- * Most of the methods of class Runtime
are instance
+ * Most of the methods of class {@code Runtime} are instance
* methods and must be invoked with respect to the current runtime object.
*
- * @return the Runtime
object associated with the current
+ * @return the {@code Runtime} object associated with the current
* Java application.
*/
public static Runtime getRuntime() {
@@ -72,8 +72,7 @@ public class Runtime {
* if any, are started in some unspecified order and allowed to run
* concurrently until they finish. In the second phase all uninvoked
* finalizers are run if {@link #runFinalizersOnExit finalization-on-exit}
- * has been enabled. Once this is done the virtual machine {@link #halt
- * halts}.
+ * has been enabled. Once this is done the virtual machine {@link #halt halts}.
*
*
If this method is invoked after the virtual machine has begun its * shutdown sequence then if shutdown hooks are being run this method will @@ -82,7 +81,7 @@ public class Runtime { * with the given status code if the status is nonzero; otherwise, it * blocks indefinitely. * - *
The {@link System#exit(int) System.exit} method is the + *
The {@link System#exit(int) System.exit} method is the * conventional and convenient means of invoking this method. * * @param status @@ -90,8 +89,8 @@ public class Runtime { * indicates abnormal termination. * * @throws SecurityException - * If a security manager is present and its {@link - * SecurityManager#checkExit checkExit} method does not permit + * If a security manager is present and its + * {@link SecurityManager#checkExit checkExit} method does not permit * exiting with the specified status * * @see java.lang.SecurityException @@ -118,11 +117,11 @@ public class Runtime { *
Once the shutdown sequence has begun it can be stopped only by - * invoking the {@link #halt halt} method, which forcibly + * invoking the {@link #halt halt} method, which forcibly * terminates the virtual machine. * *
Once the shutdown sequence has begun it is impossible to register a * new shutdown hook or de-register a previously-registered hook. * Attempting either of these operations will cause an - * {@link IllegalStateException} to be thrown. + * {@link IllegalStateException} to be thrown. * *
Shutdown hooks run at a delicate time in the life cycle of a virtual * machine and should therefore be coded defensively. They should, in @@ -156,7 +154,7 @@ public class Runtime { * deadlocks. * *
Shutdown hooks should also finish their work quickly. When a - * program invokes {@link #exit exit} the expectation is + * program invokes {@link #exit exit} the expectation is * that the virtual machine will promptly shut down and exit. When the * virtual machine is terminated due to user logoff or system shutdown the * underlying operating system may only allow a fixed amount of time in @@ -165,17 +163,17 @@ public class Runtime { * hook. * *
Uncaught exceptions are handled in shutdown hooks just as in any - * other thread, by invoking the {@link ThreadGroup#uncaughtException - * uncaughtException} method of the thread's {@link - * ThreadGroup} object. The default implementation of this method - * prints the exception's stack trace to {@link System#err} and + * other thread, by invoking the + * {@link ThreadGroup#uncaughtException uncaughtException} method of the + * thread's {@link ThreadGroup} object. The default implementation of this + * method prints the exception's stack trace to {@link System#err} and * terminates the thread; it does not cause the virtual machine to exit or * halt. * *
In rare circumstances the virtual machine may abort, that is, * stop running without shutting down cleanly. This occurs when the * virtual machine is terminated externally, for example with the - * SIGKILL signal on Unix or the TerminateProcess call on + * {@code SIGKILL} signal on Unix or the {@code TerminateProcess} call on * Microsoft Windows. The virtual machine may also abort if a native * method goes awry by, for example, corrupting internal data structures or * attempting to access nonexistent memory. If the virtual machine aborts @@ -183,7 +181,7 @@ public class Runtime { * will be run. * * @param hook - * An initialized but unstarted {@link Thread} object + * An initialized but unstarted {@link Thread} object * * @throws IllegalArgumentException * If the specified hook has already been registered, @@ -196,7 +194,7 @@ public class Runtime { * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #removeShutdownHook * @see #halt(int) @@ -212,11 +210,11 @@ public class Runtime { } /** - * De-registers a previously-registered virtual-machine shutdown hook.
+ * De-registers a previously-registered virtual-machine shutdown hook. * * @param hook the hook to remove - * @return true if the specified hook had previously been - * registered and was successfully de-registered, false + * @return {@code true} if the specified hook had previously been + * registered and was successfully de-registered, {@code false} * otherwise. * * @throws IllegalStateException @@ -225,7 +223,7 @@ public class Runtime { * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #addShutdownHook * @see #exit(int) @@ -244,23 +242,23 @@ public class Runtime { * method never returns normally. * *
This method should be used with extreme caution. Unlike the - * {@link #exit exit} method, this method does not cause shutdown + * {@link #exit exit} method, this method does not cause shutdown * hooks to be started and does not run uninvoked finalizers if * finalization-on-exit has been enabled. If the shutdown sequence has * already been initiated then this method does not wait for any running * shutdown hooks or finalizers to finish their work. * * @param status - * Termination status. By convention, a nonzero status code - * indicates abnormal termination. If the {@link Runtime#exit - * exit} (equivalently, {@link System#exit(int) - * System.exit}) method has already been invoked then this - * status code will override the status code passed to that method. + * Termination status. By convention, a nonzero status code + * indicates abnormal termination. If the {@link Runtime#exit exit} + * (equivalently, {@link System#exit(int) System.exit}) method + * has already been invoked then this status code + * will override the status code passed to that method. * * @throws SecurityException - * If a security manager is present and its {@link - * SecurityManager#checkExit checkExit} method does not permit - * an exit with the specified status + * If a security manager is present and its + * {@link SecurityManager#checkExit checkExit} method + * does not permit an exit with the specified status * * @see #exit * @see #addShutdownHook @@ -282,7 +280,7 @@ public class Runtime { * By default, finalization on exit is disabled. * *
If there is a security manager,
- * its checkExit
method is first called
+ * its {@code checkExit} method is first called
* with 0 as its argument to ensure the exit is allowed.
* This could result in a SecurityException.
*
@@ -293,7 +291,7 @@ public class Runtime {
* behavior or deadlock.
*
* @throws SecurityException
- * if a security manager exists and its checkExit
+ * if a security manager exists and its {@code checkExit}
* method doesn't allow the exit.
*
* @see java.lang.Runtime#exit(int)
@@ -318,9 +316,9 @@ public class Runtime {
* Executes the specified string command in a separate process.
*
*
This is a convenience method. An invocation of the form
- * exec(command)
+ * {@code exec(command)}
* behaves in exactly the same way as the invocation
- * {@link #exec(String, String[], File) exec}(command, null, null).
+ * {@link #exec(String, String[], File) exec}{@code (command, null, null)}.
*
* @param command a specified system command.
*
@@ -335,10 +333,10 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If command
is null
+ * If {@code command} is {@code null}
*
* @throws IllegalArgumentException
- * If command
is empty
+ * If {@code command} is empty
*
* @see #exec(String[], String[], File)
* @see ProcessBuilder
@@ -352,16 +350,16 @@ public class Runtime {
* specified environment.
*
*
This is a convenience method. An invocation of the form
- * exec(command, envp)
+ * {@code exec(command, envp)}
* behaves in exactly the same way as the invocation
- * {@link #exec(String, String[], File) exec}(command, envp, null).
+ * {@link #exec(String, String[], File) exec}{@code (command, envp, null)}.
*
* @param command a specified system command.
*
* @param envp array of strings, each element of which
* has environment variable settings in the format
* name=value, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the environment of the current process.
*
* @return A new {@link Process} object for managing the subprocess
@@ -375,11 +373,11 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If command
is null
,
- * or one of the elements of envp
is null
+ * If {@code command} is {@code null},
+ * or one of the elements of {@code envp} is {@code null}
*
* @throws IllegalArgumentException
- * If command
is empty
+ * If {@code command} is empty
*
* @see #exec(String[], String[], File)
* @see ProcessBuilder
@@ -393,29 +391,29 @@ public class Runtime {
* specified environment and working directory.
*
*
This is a convenience method. An invocation of the form
- * exec(command, envp, dir)
+ * {@code exec(command, envp, dir)}
* behaves in exactly the same way as the invocation
- * {@link #exec(String[], String[], File) exec}(cmdarray, envp, dir),
- * where cmdarray
is an array of all the tokens in
- * command
.
+ * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, dir)},
+ * where {@code cmdarray} is an array of all the tokens in
+ * {@code command}.
*
- *
More precisely, the command
string is broken
+ *
More precisely, the {@code command} string is broken
* into tokens using a {@link StringTokenizer} created by the call
- * new {@link StringTokenizer}(command)
with no
+ * {@code new {@link StringTokenizer}(command)} with no
* further modification of the character categories. The tokens
* produced by the tokenizer are then placed in the new string
- * array cmdarray
, in the same order.
+ * array {@code cmdarray}, in the same order.
*
* @param command a specified system command.
*
* @param envp array of strings, each element of which
* has environment variable settings in the format
* name=value, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the environment of the current process.
*
* @param dir the working directory of the subprocess, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the working directory of the current process.
*
* @return A new {@link Process} object for managing the subprocess
@@ -429,11 +427,11 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If command
is null
,
- * or one of the elements of envp
is null
+ * If {@code command} is {@code null},
+ * or one of the elements of {@code envp} is {@code null}
*
* @throws IllegalArgumentException
- * If command
is empty
+ * If {@code command} is empty
*
* @see ProcessBuilder
* @since 1.3
@@ -454,9 +452,9 @@ public class Runtime {
* Executes the specified command and arguments in a separate process.
*
*
This is a convenience method. An invocation of the form
- * exec(cmdarray)
+ * {@code exec(cmdarray)}
* behaves in exactly the same way as the invocation
- * {@link #exec(String[], String[], File) exec}(cmdarray, null, null).
+ * {@link #exec(String[], String[], File) exec}{@code (cmdarray, null, null)}.
*
* @param cmdarray array containing the command to call and
* its arguments.
@@ -472,12 +470,12 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If cmdarray
is null
,
- * or one of the elements of cmdarray
is null
+ * If {@code cmdarray} is {@code null},
+ * or one of the elements of {@code cmdarray} is {@code null}
*
* @throws IndexOutOfBoundsException
- * If cmdarray
is an empty array
- * (has length 0
)
+ * If {@code cmdarray} is an empty array
+ * (has length {@code 0})
*
* @see ProcessBuilder
*/
@@ -490,9 +488,9 @@ public class Runtime {
* with the specified environment.
*
*
This is a convenience method. An invocation of the form
- * exec(cmdarray, envp)
+ * {@code exec(cmdarray, envp)}
* behaves in exactly the same way as the invocation
- * {@link #exec(String[], String[], File) exec}(cmdarray, envp, null).
+ * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, null)}.
*
* @param cmdarray array containing the command to call and
* its arguments.
@@ -500,7 +498,7 @@ public class Runtime {
* @param envp array of strings, each element of which
* has environment variable settings in the format
* name=value, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the environment of the current process.
*
* @return A new {@link Process} object for managing the subprocess
@@ -514,13 +512,13 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If cmdarray
is null
,
- * or one of the elements of cmdarray
is null
,
- * or one of the elements of envp
is null
+ * If {@code cmdarray} is {@code null},
+ * or one of the elements of {@code cmdarray} is {@code null},
+ * or one of the elements of {@code envp} is {@code null}
*
* @throws IndexOutOfBoundsException
- * If cmdarray
is an empty array
- * (has length 0
)
+ * If {@code cmdarray} is an empty array
+ * (has length {@code 0})
*
* @see ProcessBuilder
*/
@@ -533,17 +531,17 @@ public class Runtime {
* Executes the specified command and arguments in a separate process with
* the specified environment and working directory.
*
- *
Given an array of strings cmdarray
, representing the
- * tokens of a command line, and an array of strings envp
,
+ *
Given an array of strings {@code cmdarray}, representing the + * tokens of a command line, and an array of strings {@code envp}, * representing "environment" variable settings, this method creates * a new process in which to execute the specified command. * - *
This method checks that cmdarray
is a valid operating
+ *
This method checks that {@code cmdarray} is a valid operating * system command. Which commands are valid is system-dependent, * but at the very least the command must be a non-empty list of * non-null strings. * - *
If envp is null, the subprocess inherits the + *
If {@code envp} is {@code null}, the subprocess inherits the * environment settings of the current process. * *
A minimal set of system dependent environment variables may @@ -554,14 +552,14 @@ public class Runtime { *
{@link ProcessBuilder#start()} is now the preferred way to * start a process with a modified environment. * - *
The working directory of the new subprocess is specified by dir. - * If dir is null, the subprocess inherits the + *
The working directory of the new subprocess is specified by {@code dir}. + * If {@code dir} is {@code null}, the subprocess inherits the * current working directory of the current process. * *
If a security manager exists, its
* {@link SecurityManager#checkExec checkExec}
* method is invoked with the first component of the array
- * cmdarray
as its argument. This may result in a
+ * {@code cmdarray} as its argument. This may result in a
* {@link SecurityException} being thrown.
*
*
Starting an operating system process is highly system-dependent.
@@ -586,11 +584,11 @@ public class Runtime {
* @param envp array of strings, each element of which
* has environment variable settings in the format
* name=value, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the environment of the current process.
*
* @param dir the working directory of the subprocess, or
- * null if the subprocess should inherit
+ * {@code null} if the subprocess should inherit
* the working directory of the current process.
*
* @return A new {@link Process} object for managing the subprocess
@@ -607,13 +605,13 @@ public class Runtime {
* If an I/O error occurs
*
* @throws NullPointerException
- * If cmdarray
is null
,
- * or one of the elements of cmdarray
is null
,
- * or one of the elements of envp
is null
+ * If {@code cmdarray} is {@code null},
+ * or one of the elements of {@code cmdarray} is {@code null},
+ * or one of the elements of {@code envp} is {@code null}
*
* @throws IndexOutOfBoundsException
- * If cmdarray
is an empty array
- * (has length 0
)
+ * If {@code cmdarray} is an empty array
+ * (has length {@code 0})
*
* @see ProcessBuilder
* @since 1.3
@@ -643,8 +641,8 @@ public class Runtime {
/**
* Returns the amount of free memory in the Java Virtual Machine.
* Calling the
- * gc
method may result in increasing the value returned
- * by freeMemory.
+ * {@code gc} method may result in increasing the value returned
+ * by {@code freeMemory.}
*
* @return an approximation to the total amount of memory currently
* available for future allocated objects, measured in bytes.
@@ -665,9 +663,9 @@ public class Runtime {
public native long totalMemory();
/**
- * 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
- * java.lang.Long#MAX_VALUE} will be returned.
+ * 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 java.lang.Long#MAX_VALUE} will be returned.
*
* @return the maximum amount of memory that the virtual machine will
* attempt to use, measured in bytes
@@ -683,10 +681,10 @@ public class Runtime {
* returns from the method call, the virtual machine has made
* its best effort to recycle all discarded objects.
*
- * The name gc
stands for "garbage
+ * The name {@code gc} stands for "garbage
* collector". The virtual machine performs this recycling
* process automatically as needed, in a separate thread, even if the
- * gc
method is not invoked explicitly.
+ * {@code gc} method is not invoked explicitly.
*
* The method {@link System#gc()} is the conventional and convenient
* means of invoking this method.
@@ -699,15 +697,15 @@ public class Runtime {
/**
* Runs the finalization methods of any objects pending finalization.
* Calling this method suggests that the Java virtual machine expend
- * effort toward running the finalize
methods of objects
- * that have been found to be discarded but whose finalize
+ * 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 virtual machine has made a best effort to
* complete all outstanding finalizations.
*
* The virtual machine performs the finalization process
* automatically as needed, in a separate thread, if the
- * runFinalization
method is not invoked explicitly.
+ * {@code runFinalization} method is not invoked explicitly.
*
* The method {@link System#runFinalization()} is the conventional
* and convenient means of invoking this method.
@@ -720,7 +718,7 @@ public class Runtime {
/**
* Enables/Disables tracing of instructions.
- * If the boolean
argument is true
, this
+ * If the {@code boolean} argument is {@code true}, this
* method suggests that the Java virtual machine emit debugging
* information for each instruction in the virtual machine as it
* is executed. The format of this information, and the file or other
@@ -729,18 +727,18 @@ public class Runtime {
* this feature. The destination of the trace output is system
* dependent.
*
- * If the boolean
argument is false
, this
+ * If the {@code boolean} argument is {@code false}, this
* method causes the virtual machine to stop performing the
* detailed instruction trace it is performing.
*
- * @param on true
to enable instruction tracing;
- * false
to disable this feature.
+ * @param on {@code true} to enable instruction tracing;
+ * {@code false} to disable this feature.
*/
public void traceInstructions(boolean on) { }
/**
* Enables/Disables tracing of method calls.
- * If the boolean
argument is true
, this
+ * If the {@code boolean} argument is {@code true}, this
* method suggests that the Java virtual machine emit debugging
* information for each method in the virtual machine as it is
* called. The format of this information, and the file or other output
@@ -751,8 +749,8 @@ public class Runtime {
* Calling this method with argument false suggests that the
* virtual machine cease emitting per-call debugging information.
*
- * @param on true
to enable instruction tracing;
- * false
to disable this feature.
+ * @param on {@code true} to enable instruction tracing;
+ * {@code false} to disable this feature.
*/
public void traceMethodCalls(boolean on) { }
@@ -760,7 +758,7 @@ public class Runtime {
* Loads the native library specified by the filename argument. The filename
* argument must be an absolute path name.
* (for example
- * Runtime.getRuntime().load("/home/avh/lib/libX11.so");
).
+ * {@code Runtime.getRuntime().load("/home/avh/lib/libX11.so");}).
*
* If the filename argument, when stripped of any platform-specific library
* prefix, path, and file extension, indicates a library whose name is,
@@ -773,8 +771,8 @@ public class Runtime {
* Otherwise, the filename argument is mapped to a native library image in
* an implementation-dependent manner.
*
- * First, if there is a security manager, its checkLink
- * method is called with the filename
as its argument.
+ * First, if there is a security manager, its {@code checkLink}
+ * method is called with the {@code filename} as its argument.
* This may result in a security exception.
*
* This is similar to the method {@link #loadLibrary(String)}, but it
@@ -786,14 +784,14 @@ public class Runtime {
*
* @param filename the file to load.
* @exception SecurityException if a security manager exists and its
- * checkLink
method doesn't allow
+ * {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception 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 filename
is
- * null
+ * @exception NullPointerException if {@code filename} is
+ * {@code null}
* @see java.lang.Runtime#getRuntime()
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkLink(java.lang.String)
@@ -816,26 +814,26 @@ public class Runtime {
}
/**
- * Loads the native library specified by the libname
- * argument. The libname
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 libname
is statically linked with the VM, then the
- * JNI_OnLoad_libname
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 JNI Specification for more details.
*
* Otherwise, the libname argument is loaded from a system library
* location and mapped to a native library image in an implementation-
* dependent manner.
*
- * First, if there is a security manager, its checkLink
- * method is called with the libname
as its argument.
+ * First, if there is a security manager, its {@code checkLink}
+ * method is called with the {@code libname} as its argument.
* This may result in a security exception.
*
* The method {@link System#loadLibrary(String)} is the conventional
* and convenient means of invoking this method. If native
* methods are to be used in the implementation of a class, a standard
* strategy is to put the native code in a library file (call it
- * LibFile
) and then to put a static initializer:
+ * {@code LibFile}) and then to put a static initializer:
*
@@ -848,14 +846,14 @@ public class Runtime { * * @param libname the name of the library. * @exception SecurityException if a security manager exists and its - ** static { System.loadLibrary("LibFile"); } *
checkLink
method doesn't allow
+ * {@code checkLink} method doesn't allow
* loading of the specified dynamic library
* @exception 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 libname
is
- * null
+ * @exception NullPointerException if {@code libname} is
+ * {@code null}
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkLink(java.lang.String)
*/
@@ -878,7 +876,7 @@ public class Runtime {
/**
* Creates a localized version of an input stream. This method takes
- * an InputStream
and returns an InputStream
+ * an {@code InputStream} and returns an {@code InputStream}
* equivalent to the argument in all respects except that it is
* localized: as characters in the local character set are read from
* the stream, they are automatically converted from the local
@@ -894,7 +892,7 @@ public class Runtime {
* @see java.io.InputStreamReader#InputStreamReader(java.io.InputStream)
* @deprecated As of JDK 1.1, the preferred way to translate a byte
* stream in the local encoding into a character stream in Unicode is via
- * the InputStreamReader
and BufferedReader
+ * the {@code InputStreamReader} and {@code BufferedReader}
* classes.
*/
@Deprecated
@@ -904,8 +902,8 @@ public class Runtime {
/**
* Creates a localized version of an output stream. This method
- * takes an OutputStream
and returns an
- * OutputStream
equivalent to the argument in all respects
+ * takes an {@code OutputStream} and returns an
+ * {@code OutputStream} equivalent to the argument in all respects
* except that it is localized: as Unicode characters are written to
* the stream, they are automatically converted to the local
* character set.
@@ -915,8 +913,8 @@ public class Runtime {
*
* @deprecated As of JDK 1.1, the preferred way to translate a
* Unicode character stream into a byte stream in the local encoding is via
- * the OutputStreamWriter
, BufferedWriter
, and
- * PrintWriter
classes.
+ * the {@code OutputStreamWriter}, {@code BufferedWriter}, and
+ * {@code PrintWriter} classes.
*
* @param out OutputStream to localize
* @return a localized output stream
diff --git a/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java b/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java
index 27947c31a8c..5849565330e 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java
@@ -45,7 +45,7 @@ public class AtomicMoveNotSupportedException
* @param target
* a string identifying the target file or {@code null} if not known
* @param reason
- * a reason message with additional information
+ * a reason message with additional information or {@code null}
*/
public AtomicMoveNotSupportedException(String source,
String target,
diff --git a/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java b/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java
index c66518a5cc4..844a5a2923c 100644
--- a/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java
+++ b/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java
@@ -53,9 +53,9 @@ import sun.util.calendar.ZoneInfo;
* ------------------------------------------------------
* }
*
- * ERA
value 0 specifies the years before Meiji and
- * the Gregorian year values are used. Unlike {@link
- * GregorianCalendar}, the Julian to Gregorian transition is not
+ *
{@code ERA} value 0 specifies the years before Meiji and + * the Gregorian year values are used. Unlike + * {@link GregorianCalendar}, the Julian to Gregorian transition is not * supported because it doesn't make any sense to the Japanese * calendar systems used before Meiji. To represent the years before * Gregorian year 1, 0 and negative values are used. The Japanese @@ -66,7 +66,7 @@ import sun.util.calendar.ZoneInfo; *
A new era can be specified using property * jdk.calendar.japanese.supplemental.era. The new era is added to the * predefined eras. The syntax of the property is as follows. - *
+ ** {@code name=* where @@ -83,7 +83,7 @@ import sun.util.calendar.ZoneInfo; * ignored. * *,abbr=,since= The following is an example of the property usage. - *
+ ** java -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N,since=253374307200000" ** The property specifies an era change to NewEra at 9999-02-11T00:00:00 local time. @@ -315,7 +315,7 @@ class JapaneseImperialCalendar extends Calendar { private transient int[] originalFields; /** - * Constructs aJapaneseImperialCalendar
based on the current time + * Constructs a {@code JapaneseImperialCalendar} based on the current time * in the given time zone with the given locale. * * @param zone the given time zone. @@ -351,16 +351,16 @@ class JapaneseImperialCalendar extends Calendar { } /** - * Compares thisJapaneseImperialCalendar
to the specified - *Object
. The result istrue
if and - * only if the argument is aJapaneseImperialCalendar
object + * Compares this {@code JapaneseImperialCalendar} to the specified + * {@code Object}. The result is {@code true} if and + * only if the argument is a {@code JapaneseImperialCalendar} object * that represents the same time value (millisecond offset from * the Epoch) under the same - *Calendar
parameters. + * {@code Calendar} parameters. * * @param obj the object to compare with. - * @returntrue
if this object is equal toobj
; - *false
otherwise. + * @return {@code true} if this object is equal to {@code obj}; + * {@code false} otherwise. * @see Calendar#compareTo(Calendar) */ @Override @@ -371,7 +371,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Generates the hash code for this - *JapaneseImperialCalendar
object. + * {@code JapaneseImperialCalendar} object. */ @Override public int hashCode() { @@ -382,27 +382,27 @@ class JapaneseImperialCalendar extends Calendar { * Adds the specified (signed) amount of time to the given calendar field, * based on the calendar's rules. * - *Add rule 1. The value of
field
- * after the call minus the value offield
before the - * call isamount
, modulo any overflow that has occurred in - *field
. Overflow occurs when a field value exceeds its + *Add rule 1. The value of {@code field} + * after the call minus the value of {@code field} before the + * call is {@code amount}, modulo any overflow that has occurred in + * {@code field}. Overflow occurs when a field value exceeds its * range and, as a result, the next larger field is incremented or * decremented and the field value is adjusted back into its range.
* *Add rule 2. If a smaller field is expected to be * invariant, but it is impossible for it to be equal to its * prior value because of changes in its minimum or maximum after - *
* * @param field the calendar field. * @param amount the amount of date or time to be added to the field. - * @exception IllegalArgumentException iffield
is changed, then its value is adjusted to be as close + * {@code field} is changed, then its value is adjusted to be as close * as possible to its expected value. A smaller field represents a - * smaller unit of time.HOUR
is a smaller field than - *DAY_OF_MONTH
. No adjustment is made to smaller fields + * smaller unit of time. {@code HOUR} is a smaller field than + * {@code DAY_OF_MONTH}. No adjustment is made to smaller fields * that are not expected to be invariant. The calendar system * determines what fields are expected to be invariant.field
is - *ZONE_OFFSET
,DST_OFFSET
, or unknown, + * @exception IllegalArgumentException if {@code field} is + * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown, * or if any calendar fields have out-of-range values in * non-lenient mode. */ @@ -548,12 +548,12 @@ class JapaneseImperialCalendar extends Calendar { *This method calls {@link #complete()} before adding the * amount so that all the calendar fields are normalized. If there * is any calendar field having an out-of-range value in non-lenient mode, then an - *
IllegalArgumentException
is thrown. + * {@code IllegalArgumentException} is thrown. * * @param field the calendar field. - * @param amount the signed amount to add tofield
. - * @exception IllegalArgumentException iffield
is - *ZONE_OFFSET
,DST_OFFSET
, or unknown, + * @param amount the signed amount to add to {@code field}. + * @exception IllegalArgumentException if {@code field} is + * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown, * or if any calendar fields have out-of-range values in * non-lenient mode. * @see #roll(int,boolean) @@ -1055,9 +1055,9 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the minimum value for the given calendar field of this - *Calendar
instance. The minimum value is - * defined as the smallest value returned by the {@link - * Calendar#get(int) get} method for any possible time value, + * {@code Calendar} instance. The minimum value is + * defined as the smallest value returned by the + * {@link Calendar#get(int) get} method for any possible time value, * taking into consideration the current values of the * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, @@ -1077,9 +1077,9 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the maximum value for the given calendar field of this - *GregorianCalendar
instance. The maximum value is - * defined as the largest value returned by the {@link - * Calendar#get(int) get} method for any possible time value, + * {@code GregorianCalendar} instance. The maximum value is + * defined as the largest value returned by the + * {@link Calendar#get(int) get} method for any possible time value, * taking into consideration the current values of the * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, @@ -1108,7 +1108,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the highest minimum value for the given calendar field - * of thisGregorianCalendar
instance. The highest + * of this {@code GregorianCalendar} instance. The highest * minimum value is defined as the largest value returned by * {@link #getActualMinimum(int)} for any possible time value, * taking into consideration the current values of the @@ -1130,7 +1130,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the lowest maximum value for the given calendar field - * of thisGregorianCalendar
instance. The lowest + * of this {@code GregorianCalendar} instance. The lowest * maximum value is defined as the smallest value returned by * {@link #getActualMaximum(int)} for any possible time value, * taking into consideration the current values of the @@ -1166,7 +1166,7 @@ class JapaneseImperialCalendar extends Calendar { * * @param field the calendar field * @return the minimum of the given field for the time value of - * thisJapaneseImperialCalendar
+ * this {@code JapaneseImperialCalendar} * @see #getMinimum(int) * @see #getMaximum(int) * @see #getGreatestMinimum(int) @@ -1269,13 +1269,13 @@ class JapaneseImperialCalendar extends Calendar { * and * {@link Calendar#getTimeZone() getTimeZone} methods. * For example, if the date of this instance is Heisei 16February 1, - * the actual maximum value of theDAY_OF_MONTH
field + * the actual maximum value of the {@code DAY_OF_MONTH} field * is 29 because Heisei 16 is a leap year, and if the date of this * instance is Heisei 17 February 1, it's 28. * * @param field the calendar field * @return the maximum of the given field for the time value of - * thisJapaneseImperialCalendar
+ * this {@code JapaneseImperialCalendar} * @see #getMinimum(int) * @see #getMaximum(int) * @see #getGreatestMinimum(int) @@ -1558,7 +1558,7 @@ class JapaneseImperialCalendar extends Calendar { * href="Calendar.html#Epoch">Epoch) to calendar field values. * The time is not * recomputed first; to recompute the time, then the fields, call the - *complete
method. + * {@code complete} method. * * @see Calendar#complete */ diff --git a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java index 01aa1a89653..df740da8488 100644 --- a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java +++ b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java @@ -33,7 +33,7 @@ import java.security.BasicPermission; * name, but no actions list. Callers either possess the permission or not. ** The following targets are defined: - *
+ * *
* *
The description of parameters (options or arguments) of a diagnostic
* command is provided within a Descriptor instance. In this Descriptor,
diff --git a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
index 5546f55d05e..68e88b79544 100644
--- a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
+++ b/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
@@ -41,14 +41,14 @@ import sun.management.GarbageCollectionNotifInfoCompositeData;
* when the Java virtual machine completes a garbage collection action
* The notification emitted will contain the garbage collection notification
* information about the status of the memory:
- *
*
* A {@link CompositeData CompositeData} representing @@ -81,7 +81,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; *
- * GcInfo is a {@link CompositeData CompositeData} + * {@code GcInfo} is a {@link CompositeData CompositeData} * The GC-specific attributes can be obtained via the CompositeData * interface. This is a historical relic, and other classes should * not copy this pattern. Use {@link CompositeDataView} instead. * *
*
** - * @throws IllegalArgumentException if cd does not - * represent a GcInfo object with the attributes + * @throws IllegalArgumentException if {@code cd} does not + * represent a {@code GcInfo} object with the attributes * described above. * - * @return a GcInfo object represented by cd - * if cd is not null; null otherwise. + * @return a {@code GcInfo} object represented by {@code cd} + * if {@code cd} is not {@code null}; {@code null} otherwise. */ public static GcInfo from(CompositeData cd) { if (cd == null) { @@ -272,7 +271,7 @@ public class GcInfo implements CompositeData, CompositeDataView { } /** - **
*@@ -193,33 +192,33 @@ public class GcInfo implements CompositeData, CompositeDataView { * ** *index - *java.lang.Long + *{@code java.lang.Long} ** *startTime - *java.lang.Long + *{@code java.lang.Long} ** *endTime - *java.lang.Long + *{@code java.lang.Long} ** *memoryUsageBeforeGc - *javax.management.openmbean.TabularData + *{@code javax.management.openmbean.TabularData} ** *memoryUsageAfterGc - *javax.management.openmbean.TabularData + *{@code javax.management.openmbean.TabularData} *
Return the {@code CompositeData} representation of this + * Return the {@code CompositeData} representation of this * {@code GcInfo}, including any GC-specific attributes. The * returned value will have at least all the attributes described * in the {@link #from(CompositeData) from} method, plus optionally diff --git a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java b/jdk/src/java.management/share/classes/com/sun/management/VMOption.java index 9c66af1ef5b..b1ba961923d 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/java.management/share/classes/com/sun/management/VMOption.java @@ -42,10 +42,10 @@ import javax.management.openmbean.CompositeData; * be set dynamically via a management interface after * the VM was started. * - * A VMOption contains the value of a VM option - * and the origin of that value at the time this VMOption + * A {@code VMOption} contains the value of a VM option + * and the origin of that value at the time this {@code VMOption} * object was constructed. The value of the VM option - * may be changed after the VMOption object was constructed, + * may be changed after the {@code VMOption} object was constructed, * * @see * Java Virtual Machine @@ -108,15 +108,15 @@ public class VMOption { } /** - * Constructs a VMOption. + * Constructs a {@code VMOption}. * * @param name Name of a VM option. * @param value Value of a VM option. - * @param writeable true if a VM option can be set dynamically, - * or false otherwise. + * @param writeable {@code true} if a VM option can be set dynamically, + * or {@code false} otherwise. * @param origin where the value of a VM option came from. * - * @throws NullPointerException if the name or value is null + * @throws NullPointerException if the name or value is {@code null} */ public VMOption(String name, String value, boolean writeable, Origin origin) { this.name = name; @@ -126,7 +126,7 @@ public class VMOption { } /** - * Constructs a VMOption object from a + * Constructs a {@code VMOption} object from a * {@link CompositeData CompositeData}. */ private VMOption(CompositeData cd) { @@ -150,10 +150,10 @@ public class VMOption { /** * Returns the value of this VM option at the time when - * this VMOption was created. The value could have been changed. + * this {@code VMOption} was created. The value could have been changed. * * @return the value of the VM option at the time when - * this VMOption was created. + * this {@code VMOption} was created. */ public String getValue() { return value; @@ -174,7 +174,7 @@ public class VMOption { * it can be set by the {@link HotSpotDiagnosticMXBean#setVMOption * HotSpotDiagnosticMXBean.setVMOption} method. * - * @return true if this VM option is writeable; false + * @return {@code true} if this VM option is writeable; {@code false} * otherwise. */ public boolean isWriteable() { @@ -189,10 +189,10 @@ public class VMOption { } /** - * Returns a VMOption object represented by the - * given CompositeData. The given CompositeData + * Returns a {@code VMOption} object represented by the + * given {@code CompositeData}. The given {@code CompositeData} * must contain the following attributes: - *
+ * *
** - * @param cd CompositeData representing a VMOption + * @param cd {@code CompositeData} representing a {@code VMOption} * - * @throws IllegalArgumentException if cd does not - * represent a VMOption with the attributes described + * @throws IllegalArgumentException if {@code cd} does not + * represent a {@code VMOption} with the attributes described * above. * - * @return a VMOption object represented by cd - * if cd is not null; - * null otherwise. + * @return a {@code VMOption} object represented by {@code cd} + * if {@code cd} is not {@code null}; + * {@code null} otherwise. */ public static VMOption from(CompositeData cd) { if (cd == null) { diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java index fd3ba69902a..970aa19816d 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,10 +78,9 @@ import java.lang.Double; * under which these calls cannot even enqueue the requested operation for * later processing. Even under these circumstances it is generally better to * simply ignore the invocation and return, rather than throwing an - * exception. Under these circumstances, however, all subsequent invocations - * of flush() and sync should return false, as - * returning true would imply that all previous operations had - * successfully been made permanent. + * exception. Under these circumstances, however, subsequently invoking + * flush() or sync would not imply that all previous + * operations had successfully been made permanent. * **
*@@ -201,32 +201,32 @@ public class VMOption { * ** *name - *java.lang.String + *{@code java.lang.String} ** *value - *java.lang.String + *{@code java.lang.String} ** *origin - *java.lang.String + *{@code java.lang.String} ** *writeable - *java.lang.Boolean + *{@code java.lang.Boolean} *
There is one circumstance under which putSpi, removeSpi and
* childSpi should throw an exception: if the caller lacks
@@ -122,6 +121,13 @@ import java.lang.Double;
* @since 1.4
*/
public abstract class AbstractPreferences extends Preferences {
+ /**
+ * The code point U+0000, assigned to the null control character, is the
+ * only character encoded in Unicode and ISO/IEC 10646 that is always
+ * invalid in any XML 1.0 and 1.1 document.
+ */
+ static final int CODE_POINT_U0000 = '\u0000';
+
/**
* Our name relative to parent.
*/
@@ -234,6 +240,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH or if value.length exceeds
* MAX_VALUE_LENGTH.
+ * @throws IllegalArgumentException if either key or value contain
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -244,6 +252,10 @@ public abstract class AbstractPreferences extends Preferences {
throw new IllegalArgumentException("Key too long: "+key);
if (value.length() > MAX_VALUE_LENGTH)
throw new IllegalArgumentException("Value too long: "+value);
+ if (key.indexOf(CODE_POINT_U0000) != -1)
+ throw new IllegalArgumentException("Key contains code point U+0000");
+ if (value.indexOf(CODE_POINT_U0000) != -1)
+ throw new IllegalArgumentException("Value contains code point U+0000");
synchronized(lock) {
if (removed)
@@ -275,10 +287,14 @@ public abstract class AbstractPreferences extends Preferences {
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null. (A
* null default is permitted.)
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public String get(String key, String def) {
if (key==null)
throw new NullPointerException("Null key");
+ if (key.indexOf(CODE_POINT_U0000) != -1)
+ throw new IllegalArgumentException("Key contains code point U+0000");
synchronized(lock) {
if (removed)
throw new IllegalStateException("Node has been removed.");
@@ -306,10 +322,14 @@ public abstract class AbstractPreferences extends Preferences {
* @param key key whose mapping is to be removed from the preference node.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @throws NullPointerException {@inheritDoc}.
*/
public void remove(String key) {
Objects.requireNonNull(key, "Specified key cannot be null");
+ if (key.indexOf(CODE_POINT_U0000) != -1)
+ throw new IllegalArgumentException("Key contains code point U+0000");
synchronized(lock) {
if (removed)
throw new IllegalStateException("Node has been removed.");
@@ -353,6 +373,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -381,6 +403,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public int getInt(String key, int def) {
int result = def;
@@ -408,6 +432,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -436,6 +462,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public long getLong(String key, long def) {
long result = def;
@@ -463,6 +491,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -494,6 +524,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public boolean getBoolean(String key, boolean def) {
boolean result = def;
@@ -521,6 +553,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -549,6 +583,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public float getFloat(String key, float def) {
float result = def;
@@ -576,6 +612,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalArgumentException if key.length() exceeds
* MAX_KEY_LENGTH.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -604,6 +642,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public double getDouble(String key, double def) {
double result = def;
@@ -627,6 +667,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key or value is null.
* @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH
* or if value.length exceeds MAX_VALUE_LENGTH*3/4.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
*/
@@ -650,6 +692,8 @@ public abstract class AbstractPreferences extends Preferences {
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null. (A
* null value for def is permitted.)
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public byte[] getByteArray(String key, byte[] def) {
byte[] result = def;
diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
index beb0b0fa1a9..9edefc5affb 100644
--- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
+++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
@@ -489,7 +489,7 @@ public abstract class Preferences {
* MAX_VALUE_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
- * @throws IllegalArgumentException if either the key or the value contain
+ * @throws IllegalArgumentException if either key or value contain
* the null control character, code point U+0000.
*/
public abstract void put(String key, String value);
@@ -514,6 +514,8 @@ public abstract class Preferences {
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null. (A
* null value for def is permitted.)
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public abstract String get(String key, String def);
@@ -530,6 +532,8 @@ public abstract class Preferences {
* @throws NullPointerException if key is null.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
*/
public abstract void remove(String key);
@@ -566,6 +570,8 @@ public abstract class Preferences {
* MAX_KEY_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getInt(String,int)
*/
public abstract void putInt(String key, int value);
@@ -597,6 +603,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #putInt(String,int)
* @see #get(String,String)
*/
@@ -616,6 +624,8 @@ public abstract class Preferences {
* MAX_KEY_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getLong(String,long)
*/
public abstract void putLong(String key, long value);
@@ -647,6 +657,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #putLong(String,long)
* @see #get(String,String)
*/
@@ -666,6 +678,8 @@ public abstract class Preferences {
* MAX_KEY_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getBoolean(String,boolean)
* @see #get(String,String)
*/
@@ -702,6 +716,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #get(String,String)
* @see #putBoolean(String,boolean)
*/
@@ -721,6 +737,8 @@ public abstract class Preferences {
* MAX_KEY_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getFloat(String,float)
*/
public abstract void putFloat(String key, float value);
@@ -751,6 +769,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #putFloat(String,float)
* @see #get(String,String)
*/
@@ -770,6 +790,8 @@ public abstract class Preferences {
* MAX_KEY_LENGTH.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getDouble(String,double)
*/
public abstract void putDouble(String key, double value);
@@ -800,6 +822,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null.
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #putDouble(String,double)
* @see #get(String,String)
*/
@@ -825,6 +849,8 @@ public abstract class Preferences {
* or if value.length exceeds MAX_VALUE_LENGTH*3/4.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if key contains
+ * the null control character, code point U+0000.
* @see #getByteArray(String,byte[])
* @see #get(String,String)
*/
@@ -864,6 +890,8 @@ public abstract class Preferences {
* removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is null. (A
* null value for def is permitted.)
+ * @throws IllegalArgumentException if key contains the null control
+ * character, code point U+0000.
* @see #get(String,String)
* @see #putByteArray(String,byte[])
*/
diff --git a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java
index 9d412ed7f67..10188cc98c5 100644
--- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java
+++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,13 +49,6 @@ import sun.util.logging.PlatformLogger;
*/
class FileSystemPreferences extends AbstractPreferences {
- /**
- * The code point U+0000, assigned to the null control character, is the
- * only character encoded in Unicode and ISO/IEC 10646 that is always
- * invalid in any XML 1.0 and 1.1 document.
- */
- private static final String CODE_POINT_U0000 = String.valueOf('\u0000');
-
static {
PrivilegedAction
@since 1.6
@author Andreas Sterbenz
@author JSR 268 Expert Group
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
index b747a73eabe..058b0f0048f 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
@@ -29,15 +29,15 @@ package com.sun.tools.attach;
* The exception thrown when an agent fails to initialize in the target
* Java virtual machine.
*
- * This exception is thrown by {@link
- * com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent},
+ * This exception is thrown by
+ * {@link com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent},
* {@link com.sun.tools.attach.VirtualMachine#loadAgentLibrary
- * VirtualMachine.loadAgentLibrary}, {@link
- * com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath}
+ * VirtualMachine.loadAgentLibrary},
+ * {@link com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath}
* methods if an agent, or agent library, cannot be initialized.
- * When thrown by VirtualMachine.loadAgentLibrary, or
- * VirtualMachine.loadAgentPath then the exception encapsulates
- * the error returned by the agent's An attach provider is a concrete subclass of this class that has a
* zero-argument constructor and implements the abstract methods specified
- * below. An attach provider implementation is typically tied to a Java virtual
* machine implementation, version, or even mode of operation. That is, a specific
@@ -51,7 +51,7 @@ import java.util.ServiceLoader;
* Sun's HotSpot virtual machine. In general, if an environment
* consists of Java virtual machines of different versions and from different
* vendors then there will be an attach provider implementation for each
- * family of implementations or versions. An attach provider is identified by its {@link #name name} and
* {@link #type type}. The name is typically, but not required to
@@ -61,15 +61,15 @@ import java.util.ServiceLoader;
* implementation that uses the Doors inter-process communication mechanism
* might use the type "doors". The purpose of the name and type is to
* identify providers in environments where there are multiple providers
- * installed. AttachProvider implementations are loaded and instantiated at the first
* invocation of the {@link #providers() providers} method. This method
* attempts to load all provider implementations that are installed on the
- * platform. All of the methods in this class are safe for use by multiple
- * concurrent threads. Agent_OnAttach
function.
+ * When thrown by {@code VirtualMachine.loadAgentLibrary}, or
+ * {@code VirtualMachine.loadAgentPath} then the exception encapsulates
+ * the error returned by the agent's {@code Agent_OnAttach} function.
* This error code can be obtained by invoking the {@link #returnValue() returnValue} method.
*/
@jdk.Exported
@@ -49,7 +49,7 @@ public class AgentInitializationException extends Exception {
private int returnValue;
/**
- * Constructs an AgentInitializationException
with
+ * Constructs an {@code AgentInitializationException} with
* no detail message.
*/
public AgentInitializationException() {
@@ -58,7 +58,7 @@ public class AgentInitializationException extends Exception {
}
/**
- * Constructs an AgentInitializationException
with
+ * Constructs an {@code AgentInitializationException} with
* the specified detail message.
*
* @param s the detail message.
@@ -69,9 +69,9 @@ public class AgentInitializationException extends Exception {
}
/**
- * Constructs an AgentInitializationException
with
+ * Constructs an {@code AgentInitializationException} with
* the specified detail message and the return value from the
- * execution of the agent's Agent_OnAttach
function.
+ * execution of the agent's {@code Agent_OnAttach} function.
*
* @param s the detail message.
* @param returnValue the return value
@@ -83,8 +83,8 @@ public class AgentInitializationException extends Exception {
/**
* If the exception was created with the return value from the agent
- * Agent_OnAttach
function then this returns that value,
- * otherwise returns 0
.
A Java virtual machine is identified by an abstract identifier. The * nature of this identifier is platform dependent but in many cases it will be the - * string representation of the process identifier (or pid).
+ * string representation of the process identifier (or pid). * * This method parses the identifier and maps the identifier to a Java
* virtual machine (in an implementation dependent manner). If the identifier
- * cannot be parsed by the provider then an {@link
- * com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException}
+ * cannot be parsed by the provider then an
+ * {@link com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException}
* is thrown. Once parsed this method attempts to attach to the Java virtual machine.
* If the provider detects that the identifier corresponds to a Java virtual machine
* that does not exist, or it corresponds to a Java virtual machine that does not support
* the attach mechanism implemented by this provider, or it detects that the
* Java virtual machine is a version to which this provider cannot attach, then
- * an AttachNotSupportedException
is thrown.
id
is null
+ * If {@code id} is {@code null}
*/
public abstract VirtualMachine attachVirtualMachine(String id)
throws AttachNotSupportedException, IOException;
@@ -155,10 +155,10 @@ public abstract class AttachProvider {
/**
* Attaches to a Java virtual machine.
*
- * A Java virtual machine can be described using a {@link - * com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}. - * This method invokes the descriptor's {@link - * com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method + *
A Java virtual machine can be described using a
+ * {@link com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}.
+ * This method invokes the descriptor's
+ * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method
* to check that it is equal to this provider. It then attempts to attach to the
* Java virtual machine.
*
@@ -170,20 +170,20 @@ public abstract class AttachProvider {
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link com.sun.tools.attach.AttachPermission AttachPermission}
- * ("attachVirtualMachine"), or other permission
+ * ("{@code attachVirtualMachine}"), or other permission
* required by the implementation.
*
* @throws AttachNotSupportedException
- * If the descriptor's {@link
- * com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method
- * returns a provider that is not this provider, or it does not correspond
- * to a Java virtual machine to which this provider can attach.
+ * If the descriptor's
+ * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()}
+ * method returns a provider that is not this provider, or it does not
+ * correspond to a Java virtual machine to which this provider can attach.
*
* @throws IOException
* If some other I/O error occurs
*
* @throws NullPointerException
- * If vmd
is null
+ * If {@code vmd} is {@code null}
*/
public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd)
throws AttachNotSupportedException, IOException
@@ -197,12 +197,13 @@ public abstract class AttachProvider {
/**
* Lists the Java virtual machines known to this provider.
*
- *
This method returns a list of {@link
- * com.sun.tools.attach.VirtualMachineDescriptor} elements. Each
- * VirtualMachineDescriptor
describes a Java virtual machine
+ *
This method returns a list of + * {@link com.sun.tools.attach.VirtualMachineDescriptor} elements. Each + * {@code VirtualMachineDescriptor} describes a Java virtual machine * to which this provider can potentially attach. There isn't any - * guarantee that invoking {@link #attachVirtualMachine(VirtualMachineDescriptor) - * attachVirtualMachine} on each descriptor in the list will succeed. + * guarantee that invoking + * {@link #attachVirtualMachine(VirtualMachineDescriptor) attachVirtualMachine} + * on each descriptor in the list will succeed. * * @return The list of virtual machine descriptors which describe the * Java virtual machines known to this provider (may be empty). @@ -216,31 +217,31 @@ public abstract class AttachProvider { *
An AttachProvider is installed on the platform if: * *
It is installed in a JAR file that is visible to the defining + *
The JAR file contains a provider configuration named - * com.sun.tools.attach.spi.AttachProvider in the resource directory - * META-INF/services.
The provider configuration file lists the full-qualified class - * name of the AttachProvider implementation.
The format of the provider configuration file is one fully-qualified * class name per line. Space and tab characters surrounding each class name, * as well as blank lines are ignored. The comment character is - * '#' (0x23), and on each line all characters following + * {@code '#'} ({@code 0x23}), and on each line all characters following * the first comment character are ignored. The file must be encoded in - * UTF-8.
+ * UTF-8. * *AttachProvider implementations are loaded and instantiated * (using the zero-arg constructor) at the first invocation of this method. * The list returned by the first invocation of this method is the list * of providers. Subsequent invocations of this method return a list of the same - * providers. The list is unmodifable.
+ * providers. The list is unmodifable. * * @return A list of the installed attach providers. */ diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java index e28bdc6299a..ac5d6fe718b 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java @@ -72,7 +72,7 @@ public abstract class Filter { * exchange handler will not be invoked. * @param exchange the HttpExchange * @throws IOException let exceptions pass up the stack - * @throws NullPointerException if exchange isnull
+ * @throws NullPointerException if exchange is {@code null}
*/
public void doFilter (HttpExchange exchange) throws IOException {
if (!iter.hasNext()) {
@@ -86,14 +86,14 @@ public abstract class Filter {
/**
* Asks this filter to pre/post-process the given exchange. The filter
- * can :-
+ * can:
*
- * @param exchange the HttpExchange
to be filtered.
+ * to send back an appropriate response
+ *
+ * @param exchange the {@code HttpExchange} to be filtered.
* @param chain the Chain which allows the next filter to be invoked.
* @throws IOException may be thrown by any filter module, and if
* caught, must be rethrown again.
- * @throws NullPointerException if either exchange or chain are null
+ * @throws NullPointerException if either exchange or chain are {@code null}
*/
public abstract void doFilter (HttpExchange exchange, Chain chain)
throws IOException;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
index 0ca7d39d420..5c0608b84fa 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
@@ -29,18 +29,21 @@ import java.util.*;
/**
* HTTP request and response headers are represented by this class which implements
- * the interface {@link java.util.Map}<
- * {@link java.lang.String},{@link java.util.List}<{@link java.lang.String}>>.
+ * the interface
+ * {@link java.util.Map}{@literal <}{@link java.lang.String}, {@link java.util.List}
+ * {@literal <}{@link java.lang.String}{@literal >>}.
* The keys are case-insensitive Strings representing the header names and
- * the value associated with each key is a {@link List}<{@link String}> with one
+ * the value associated with each key is
+ * a {@link List}{@literal <}{@link String}{@literal >} with one
* element for each occurrence of the header name in the request or response.
*
- * For example, if a response header instance contains one key "HeaderName" with two values "value1 and value2" + * For example, if a response header instance contains + * one key "HeaderName" with two values "value1 and value2" * then this object is output as two header lines: *
+ * ** HeaderName: value1 * HeaderName: value2 - *
* All the normal {@link java.util.Map} methods are provided, but the following * additional convenience methods are most likely to be used: diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 73d7a0e5f5c..757f067451b 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -116,9 +116,9 @@ public abstract class HttpExchange { public abstract HttpContext getHttpContext (); /** - * Ends this exchange by doing the following in sequence:
zero
, then chunked transfer encoding is
+ * If the response length parameter is {@code zero}, then chunked transfer encoding is
* used and an arbitrary amount of data may be sent. The application terminates the
- * response body by closing the OutputStream. If response length has the value -1
+ * response body by closing the OutputStream. If response length has the value {@code -1}
* then no response body is being sent.
*
* If the content-length response header has not already been set then
@@ -192,7 +192,7 @@ public abstract class HttpExchange {
/**
* Returns the response code, if it has already been set
- * @return the response code, if available. -1
if not available yet.
+ * @return the response code, if available. {@code -1} if not available yet.
*/
public abstract int getResponseCode ();
@@ -219,7 +219,7 @@ public abstract class HttpExchange {
* available.
* @param name the name of the attribute to retrieve
* @return the attribute object, or null if it does not exist
- * @throws NullPointerException if name is null
+ * @throws NullPointerException if name is {@code null}
*/
public abstract Object getAttribute (String name) ;
@@ -231,9 +231,9 @@ public abstract class HttpExchange {
* Each Filter class will document the attributes which they make
* available.
* @param name the name to associate with the attribute value
- * @param value the object to store as the attribute value. null
+ * @param value the object to store as the attribute value. {@code null}
* value is permitted.
- * @throws NullPointerException if name is null
+ * @throws NullPointerException if name is {@code null}
*/
public abstract void setAttribute (String name, Object value) ;
@@ -248,9 +248,9 @@ public abstract class HttpExchange {
* required to be) sub-classes of {@link java.io.FilterInputStream}
* and {@link java.io.FilterOutputStream}.
* @param i the filtered input stream to set as this object's inputstream,
- * or null
if no change.
+ * or {@code null} if no change.
* @param o the filtered output stream to set as this object's outputstream,
- * or null
if no change.
+ * or {@code null} if no change.
*/
public abstract void setStreams (InputStream i, OutputStream o);
@@ -259,7 +259,7 @@ public abstract class HttpExchange {
* If an authenticator is set on the HttpContext that owns this exchange,
* then this method will return the {@link HttpPrincipal} that represents
* the authenticated user for this HttpExchange.
- * @return the HttpPrincipal, or null
if no authenticator is set.
+ * @return the HttpPrincipal, or {@code null} if no authenticator is set.
*/
public abstract HttpPrincipal getPrincipal ();
}
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
index 02e9994ea71..f26dc1d65df 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
@@ -58,8 +58,8 @@ import com.sun.net.httpserver.spi.HttpServerProvider;
* whose path is the longest matching prefix of the request URI's path.
* Paths are matched literally, which means that the strings are compared
* case sensitively, and with no conversion to or from any encoded forms.
- * For example. Given a HttpServer with the following HttpContexts configured.
- *
Context | Context path |
ctx1 | "/" |
ctx2 | "/apps/" |
* the following table shows some request URIs and which, if any context they would - * match with.
+ * match with. *
Request URI | Matches context |
"http://foo.com/apps/foo/bar" | ctx3 |