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

(fmt spec) PrintWriter constructors may throw IOExceptions - clarify class doc

XMLWordPrintable

    • b56
    • x86
    • windows_xp



      Name: rmT116609 Date: 05/24/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Win XP, but irrelevant

      A DESCRIPTION OF THE PROBLEM :
      Javadoc for java.io.PrintWriter says: " Methods in this class never throw I/O exceptions. The client may inquire as to whether any errors have occurred by invoking checkError()."

      That is not correct. Many public methods in PrintWriter throw exceptions,
      including both forms of printf and both forms of append().

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Read the javadoc and the source code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      expect javadoc to be consistent with source
      ACTUAL -
      they are not consistent

      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Incident Review ID: 274810)
      ======================================================================

            iris Iris Clark
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: