jdk/src/share/classes/java/lang/System.java
changeset 6001 8d781af24b23
parent 5506 202f599c92aa
child 6668 bf6309ced0b6
equal deleted inserted replaced
6000:b794e7305478 6001:8d781af24b23
    67      * The "standard" input stream. This stream is already
    67      * The "standard" input stream. This stream is already
    68      * open and ready to supply input data. Typically this stream
    68      * open and ready to supply input data. Typically this stream
    69      * corresponds to keyboard input or another input source specified by
    69      * corresponds to keyboard input or another input source specified by
    70      * the host environment or user.
    70      * the host environment or user.
    71      */
    71      */
    72     public final static InputStream in = nullInputStream();
    72     public final static InputStream in = null;
    73 
    73 
    74     /**
    74     /**
    75      * The "standard" output stream. This stream is already
    75      * The "standard" output stream. This stream is already
    76      * open and ready to accept output data. Typically this stream
    76      * open and ready to accept output data. Typically this stream
    77      * corresponds to display output or another output destination
    77      * corresponds to display output or another output destination
    94      * @see     java.io.PrintStream#println(int)
    94      * @see     java.io.PrintStream#println(int)
    95      * @see     java.io.PrintStream#println(long)
    95      * @see     java.io.PrintStream#println(long)
    96      * @see     java.io.PrintStream#println(java.lang.Object)
    96      * @see     java.io.PrintStream#println(java.lang.Object)
    97      * @see     java.io.PrintStream#println(java.lang.String)
    97      * @see     java.io.PrintStream#println(java.lang.String)
    98      */
    98      */
    99     public final static PrintStream out = nullPrintStream();
    99     public final static PrintStream out = null;
   100 
   100 
   101     /**
   101     /**
   102      * The "standard" error output stream. This stream is already
   102      * The "standard" error output stream. This stream is already
   103      * open and ready to accept output data.
   103      * open and ready to accept output data.
   104      * <p>
   104      * <p>
   108      * or other information that should come to the immediate attention
   108      * or other information that should come to the immediate attention
   109      * of a user even if the principal output stream, the value of the
   109      * of a user even if the principal output stream, the value of the
   110      * variable <code>out</code>, has been redirected to a file or other
   110      * variable <code>out</code>, has been redirected to a file or other
   111      * destination that is typically not continuously monitored.
   111      * destination that is typically not continuously monitored.
   112      */
   112      */
   113     public final static PrintStream err = nullPrintStream();
   113     public final static PrintStream err = null;
   114 
   114 
   115     /* The security manager for the system.
   115     /* The security manager for the system.
   116      */
   116      */
   117     private static volatile SecurityManager security = null;
   117     private static volatile SecurityManager security = null;
   118 
   118 
  1091      * @since      1.2
  1091      * @since      1.2
  1092      */
  1092      */
  1093     public static native String mapLibraryName(String libname);
  1093     public static native String mapLibraryName(String libname);
  1094 
  1094 
  1095     /**
  1095     /**
  1096      * The following two methods exist because in, out, and err must be
       
  1097      * initialized to null.  The compiler, however, cannot be permitted to
       
  1098      * inline access to them, since they are later set to more sensible values
       
  1099      * by initializeSystemClass().
       
  1100      */
       
  1101     private static InputStream nullInputStream() throws NullPointerException {
       
  1102         if (currentTimeMillis() > 0) {
       
  1103             return null;
       
  1104         }
       
  1105         throw new NullPointerException();
       
  1106     }
       
  1107 
       
  1108     private static PrintStream nullPrintStream() throws NullPointerException {
       
  1109         if (currentTimeMillis() > 0) {
       
  1110             return null;
       
  1111         }
       
  1112         throw new NullPointerException();
       
  1113     }
       
  1114 
       
  1115     /**
       
  1116      * Initialize the system class.  Called after thread initialization.
  1096      * Initialize the system class.  Called after thread initialization.
  1117      */
  1097      */
  1118     private static void initializeSystemClass() {
  1098     private static void initializeSystemClass() {
  1119         props = new Properties();
  1099         props = new Properties();
  1120         initProperties(props);
  1100         initProperties(props);