--- old/src/java.base/share/classes/java/lang/Runtime.java 2015-04-28 17:43:11.807600376 +0400 +++ new/src/java.base/share/classes/java/lang/Runtime.java 2015-04-28 17:43:11.403600376 +0400 @@ -32,9 +32,9 @@ /** * 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 @@ /** * 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() { @@ -82,7 +82,7 @@ * 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 +90,8 @@ * 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 +118,11 @@ *

@@ -134,17 +134,16 @@ * run all uninvoked finalizers if finalization-on-exit has been enabled. * Finally, the virtual machine will halt. Note that daemon threads will * continue to run during the shutdown sequence, as will non-daemon threads - * if shutdown was initiated by invoking the {@link #exit exit} - * method. + * if shutdown was initiated by invoking the {@link #exit exit} method. * *

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 +155,7 @@ * 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 +164,17 @@ * 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 +182,7 @@ * 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 +195,7 @@ * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #removeShutdownHook * @see #halt(int) @@ -212,11 +211,11 @@ } /** - * 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 +224,7 @@ * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #addShutdownHook * @see #exit(int) @@ -244,7 +243,7 @@ * 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 @@ -252,14 +251,14 @@ * * @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 + * 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 + * If a security manager is present and its {@link + * SecurityManager#checkExit checkExit} method does not permit * an exit with the specified status * * @see #exit @@ -282,7 +281,7 @@ * 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 +292,7 @@ * 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 +317,9 @@ * 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 +334,10 @@ * 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 +351,16 @@ * 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 +374,11 @@ * 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 +392,29 @@ * 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 +428,11 @@ * 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 +453,9 @@ * 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 +471,12 @@ * 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 +489,9 @@ * 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 +499,7 @@ * @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 +513,13 @@ * 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 +532,17 @@ * 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 +553,14 @@ *

{@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 +585,11 @@ * @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 +606,13 @@ * 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 +642,8 @@ /** * 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. @@ -683,10 +682,10 @@ * 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 +698,15 @@ /** * 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 +719,7 @@ /** * 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 +728,18 @@ * 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 +750,8 @@ * 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 +759,7 @@ * 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 +772,8 @@ * 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 +785,14 @@ * * @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 +815,26 @@ } /** - * 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: *

      * static { System.loadLibrary("LibFile"); }
      * 
@@ -848,14 +847,14 @@ * * @param libname the name of the library. * @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 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 +877,7 @@ /** * 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 +893,7 @@ * @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 +903,8 @@ /** * 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 +914,8 @@ * * @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