Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4139481

java.io.PrintStream: Un-deprecate the constructors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.1.6, 1.2.0
    • core-libs
    • None
    • 1.2beta4
    • generic, x86
    • generic, windows_nt
    • Not verified

      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

            mr Mark Reinhold
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: