jdk/src/java.base/share/classes/java/lang/Runtime.java
changeset 38339 65b26013c786
parent 37521 b6e0f285c998
child 37606 e74fdd1e637f
equal deleted inserted replaced
38338:f3909e996a6a 38339:65b26013c786
    25 
    25 
    26 package java.lang;
    26 package java.lang;
    27 
    27 
    28 import java.io.*;
    28 import java.io.*;
    29 import java.util.StringTokenizer;
    29 import java.util.StringTokenizer;
    30 import sun.reflect.CallerSensitive;
    30 import jdk.internal.reflect.CallerSensitive;
    31 import sun.reflect.Reflection;
    31 import jdk.internal.reflect.Reflection;
    32 
    32 
    33 /**
    33 /**
    34  * Every Java application has a single instance of class
    34  * Every Java application has a single instance of class
    35  * {@code Runtime} that allows the application to interface with
    35  * {@code Runtime} that allows the application to interface with
    36  * the environment in which the application is running. The current
    36  * the environment in which the application is running. The current
   287      * @param value true to enable finalization on exit, false to disable
   287      * @param value true to enable finalization on exit, false to disable
   288      * @deprecated  This method is inherently unsafe.  It may result in
   288      * @deprecated  This method is inherently unsafe.  It may result in
   289      *      finalizers being called on live objects while other threads are
   289      *      finalizers being called on live objects while other threads are
   290      *      concurrently manipulating those objects, resulting in erratic
   290      *      concurrently manipulating those objects, resulting in erratic
   291      *      behavior or deadlock.
   291      *      behavior or deadlock.
       
   292      *      This method is subject to removal in a future version of Java SE.
   292      *
   293      *
   293      * @throws  SecurityException
   294      * @throws  SecurityException
   294      *        if a security manager exists and its {@code checkExit}
   295      *        if a security manager exists and its {@code checkExit}
   295      *        method doesn't allow the exit.
   296      *        method doesn't allow the exit.
   296      *
   297      *
   297      * @see     java.lang.Runtime#exit(int)
   298      * @see     java.lang.Runtime#exit(int)
   298      * @see     java.lang.Runtime#gc()
   299      * @see     java.lang.Runtime#gc()
   299      * @see     java.lang.SecurityManager#checkExit(int)
   300      * @see     java.lang.SecurityManager#checkExit(int)
   300      * @since   1.1
   301      * @since   1.1
   301      */
   302      */
   302     @Deprecated
   303     @Deprecated(since="1.2", forRemoval=true)
   303     public static void runFinalizersOnExit(boolean value) {
   304     public static void runFinalizersOnExit(boolean value) {
   304         SecurityManager security = System.getSecurityManager();
   305         SecurityManager security = System.getSecurityManager();
   305         if (security != null) {
   306         if (security != null) {
   306             try {
   307             try {
   307                 security.checkExit(0);
   308                 security.checkExit(0);
   892      * @see        java.io.InputStreamReader#InputStreamReader(java.io.InputStream)
   893      * @see        java.io.InputStreamReader#InputStreamReader(java.io.InputStream)
   893      * @deprecated As of JDK 1.1, the preferred way to translate a byte
   894      * @deprecated As of JDK 1.1, the preferred way to translate a byte
   894      * stream in the local encoding into a character stream in Unicode is via
   895      * stream in the local encoding into a character stream in Unicode is via
   895      * the {@code InputStreamReader} and {@code BufferedReader}
   896      * the {@code InputStreamReader} and {@code BufferedReader}
   896      * classes.
   897      * classes.
   897      */
   898      * This method is subject to removal in a future version of Java SE.
   898     @Deprecated
   899      */
       
   900     @Deprecated(since="1.1", forRemoval=true)
   899     public InputStream getLocalizedInputStream(InputStream in) {
   901     public InputStream getLocalizedInputStream(InputStream in) {
   900         return in;
   902         return in;
   901     }
   903     }
   902 
   904 
   903     /**
   905     /**
   913      *
   915      *
   914      * @deprecated As of JDK 1.1, the preferred way to translate a
   916      * @deprecated As of JDK 1.1, the preferred way to translate a
   915      * Unicode character stream into a byte stream in the local encoding is via
   917      * Unicode character stream into a byte stream in the local encoding is via
   916      * the {@code OutputStreamWriter}, {@code BufferedWriter}, and
   918      * the {@code OutputStreamWriter}, {@code BufferedWriter}, and
   917      * {@code PrintWriter} classes.
   919      * {@code PrintWriter} classes.
       
   920      * This method is subject to removal in a future version of Java SE.
   918      *
   921      *
   919      * @param      out OutputStream to localize
   922      * @param      out OutputStream to localize
   920      * @return     a localized output stream
   923      * @return     a localized output stream
   921      * @see        java.io.OutputStream
   924      * @see        java.io.OutputStream
   922      * @see        java.io.BufferedWriter#BufferedWriter(java.io.Writer)
   925      * @see        java.io.BufferedWriter#BufferedWriter(java.io.Writer)
   923      * @see        java.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream)
   926      * @see        java.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream)
   924      * @see        java.io.PrintWriter#PrintWriter(java.io.OutputStream)
   927      * @see        java.io.PrintWriter#PrintWriter(java.io.OutputStream)
   925      */
   928      */
   926     @Deprecated
   929     @Deprecated(since="1.1", forRemoval=true)
   927     public OutputStream getLocalizedOutputStream(OutputStream out) {
   930     public OutputStream getLocalizedOutputStream(OutputStream out) {
   928         return out;
   931         return out;
   929     }
   932     }
   930 
   933 
   931 }
   934 }