As part of the internationalization effort in JDK 1.1, we deprecated many
classes and methods that do not properly convert bytes to characters and vice
versa. We also deprecated a few other things in order to encourage developers
to use the new "i18n-correct" facilities. In particular, we deprecated the
public constructors of the java.io.PrintStream class, though not the class
itself. This class does implement a proper character-to-byte conversion using
the platform's default encoding; it was deprecated merely to encourage the use
of the new java.io.PrintWriter class.
Experience has shown that this was not the best decision. Many developers have
observed that the prominent public fields in java.lang.System for the standard
output and error streams contain PrintStreams, not PrintWriters. The setErr
and setOut methods of java.lang.System take PrintStreams rather than
PrintWriters, thereby forcing any developer who wants to use these methods to
use deprecated constructors (4035546, 12 customer calls). We have considered
adding setErr and setOut methods that take PrintWriters, but it is technically
difficult, and perhaps impossible, to do this while maintaining compatibility
with the current specification.
Given the high visibility of this situation, and the fact that the original
justification for deprecating the PrintStream constructors is, in hindsight,
rather weak, it seems that the best course of action is to un-deprecate the
constructors.
-- mr@eng 5/18/1998
classes and methods that do not properly convert bytes to characters and vice
versa. We also deprecated a few other things in order to encourage developers
to use the new "i18n-correct" facilities. In particular, we deprecated the
public constructors of the java.io.PrintStream class, though not the class
itself. This class does implement a proper character-to-byte conversion using
the platform's default encoding; it was deprecated merely to encourage the use
of the new java.io.PrintWriter class.
Experience has shown that this was not the best decision. Many developers have
observed that the prominent public fields in java.lang.System for the standard
output and error streams contain PrintStreams, not PrintWriters. The setErr
and setOut methods of java.lang.System take PrintStreams rather than
PrintWriters, thereby forcing any developer who wants to use these methods to
use deprecated constructors (4035546, 12 customer calls). We have considered
adding setErr and setOut methods that take PrintWriters, but it is technically
difficult, and perhaps impossible, to do this while maintaining compatibility
with the current specification.
Given the high visibility of this situation, and the fact that the original
justification for deprecating the PrintStream constructors is, in hindsight,
rather weak, it seems that the best course of action is to un-deprecate the
constructors.
-- mr@eng 5/18/1998
- relates to
-
JDK-4035546 java.lang.System.{setErr,setOut} take PrintStream parameter
-
- Closed
-
-
JDK-4267059 Class LogStream is Deprecated with no replacement
-
- Closed
-