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

Printing to file does not throw a PrinterException if the file cannot be created

    XMLWordPrintable

Details

    • 2d
    • b127
    • x86
    • linux

    Description

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

      java version "1.4.2_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
      Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Redhat Enterprise 3: Linux lin-sron-02 2.4.20-31.9smp #1 SMP Tue Apr 13 17:40:10 EDT 2004 i686 i686 i386 GNU/Linux

      Redhat 8: Linux hscsv2 2.4.20-28.8smp #1 SMP Thu Dec 18 12:25:21 EST 2003 i686 i686 i386 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When a user attempts to print to a file but there is not enough space left on the device for the resulting file (as enforced by a disc quota), no error message is generated but the file is truncated or zero bytes in length.

      This has been noticed when the user has reached his or her disc quota.

      The problem appears to be in the print() method of java.awt.print.PrinterJob. The API states that a PrinterException should be thrown, but this isn't happening and no error is reported.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make sure the user has a disc quota, one which is full.

      The example application linked to from http://java.sun.com/j2se/1.4.2/docs/guide/jps/spec/printing2d.fm1.html can be used to demonstrate the problem.

      Attempt to print to a file. There will be no error or exception, but the resulting file will be zero bytes in length.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect to see java.awt.print.PrinterIOException reported.
      ACTUAL -
      No error or exception.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See http://java.sun.com/j2se/1.4.2/docs/guide/jps/spec/appendix_2DPrinterJob.fm.html#997825
      ---------- END SOURCE ----------
      ###@###.### 2005-1-18 11:10:24 GMT

      Attachments

        Activity

          People

            psadhukhan Prasanta Sadhukhan
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: