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

PrintStream does not allow the line separator to be overridden

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      java.io.PrintStream.println(...), unlike java.io.PrintWriter.println(...), does not allow to change the line break sequence it uses.

      This is due to the fact that, contrary to its specification, it does not call print(...) followed by println() but newLine() which is private and therefore cannot be overridden.

      E.g.:
      /**
       * Prints a String and then terminate the line. This method behaves as
       * though it invokes {@link #print(String)} and then
       * {@link #println()}.
       *
       * @param x The {@code String} to be printed.
       */


      This issue might be related to https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8215412


      FREQUENCY : always


            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: