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

Regression in MediaSize.findMedia method

XMLWordPrintable

    • 2d
    • b35
    • generic, x86, sparc
    • generic, linux, windows_98
    • Verified



      Name: vtR10009 Date: 12/25/2003


      Java spec states for MediaSizeName.NA_6X9_ENVELOPE field:
      "6x9 North American envelope size."

      But RI (jdk15-b32) does not allow to find this media size
      by invocation of MediaSize.findMedia(6.0f, 9.0f, MediaSize.INCH)
      method and returns MediaSizeName.ISO-C5 instead of
      MediaSizeName.NA_6X9_ENVELOPE.

      This bug causes failure of JCK test:
       
      api/javax_print/attribute/standard/MediaSize/index.html#FindMedia[FindMedia003]

      Note that this bug is not reproducible neither with jdk15-b31 nor jdk1.4.2.
      So this is regression.

      To reproduce the bug run the following test with JDK build jdk15-b32:
      ------------------------------- test.java --------------------------------
      import javax.print.attribute.standard.*;

      public class test {
          static PrintStream log = System.err;
          static PrintStream ref = System.out;
          
          public static void main(String args[]) {
              MediaSizeName mn = MediaSize.findMedia(6.0f, 9.0f, MediaSize.INCH);
              
              System.err.println("MediaSizeName of NA_6X9_ENVELOPE is: " +
      mn.toString());
          }
      } // end of test class
      ---------------------------Logs-------------------------------------------
      MediaSizeName of NA_6X9_ENVELOPE is: iso-c5
      --------------------------------------------------------------------------

      ======================================================================

            jgodinez Jennifer Godinez (Inactive)
            vitcsunw Vitc Vitc (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: