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

Some MediaName constants do not correspond to the IPP value

XMLWordPrintable

    • 2d
    • generic
    • generic



      Name: vtR10009 Date: 07/24/2001


      The bug is found in jdk1.4.0beta-b65 and disappears in the last JDK builds
      (checked builds b69, b72). This bug is created specially for exclusion tests
      in JCK Merlin-beta, which is based on jdk1.4.0beta-b65.

      I suggest to close this bug as "fixed".

      Values returned by method toString() for some predefined MediaName objects
      do not correspond to standart IPP values.
      Acording to the IPP(RFC2911) :
      " 'iso-a4-white': Specifies the ISO A4 white medium: 210 mm x 297 mm
          'iso-a4-colored': Specifies the ISO A4 colored medium: 210 mm x 297
             mm
          'iso-a4-transparent' Specifies the ISO A4 transparent medium: 210 mm
             x 297 mm".
      Metod toString() for these fields returns invalid values in the API
      implementation(build 1.4.0-beta-b65).

      This bug causes failure of JCK-merlin-beta test:
      api/javax_print/attribute/standard/MediaName/index.html#Fields

      However last API implementation (build 1.4.0-beta-b72) passes these tests
      and bug was filled only for test exclusion from JCK-merlin-beta.
      To reproduce the bug run the following test with JDK 1.4.0-beta-b65 build:
      ------------------------------- test.java --------------------------------
      import javax.print.attribute.standard.MediaName;

      public class test {

          public static void main(String args[]) {

              boolean isFailed = false;
              String errMsg = "";
              String[] ess = {"iso-a4-transparent", "iso-a4-white"};
              String[] esn = {"ISO_A4_TRANSPARENT", "ISO_A4_WHITE"};
              MediaName[] ex = {MediaName.ISO_A4_TRANSPARENT, MediaName.ISO_A4_WHITE};
              for (int i = 0; i < ex.length; ++i){
                  if (ex[i].toString().compareTo(ess[i]) != 0){
                      isFailed = true;
                      errMsg += "MediaName."+esn[i] + ".toString() returns :"
                              + ex[i].toString() + " ";
                  }
              }
              if (isFailed == true){
                  System.out.println(errMsg);
                  return;
              }
              System.out.println("OKAY");
          }
      }
      ---------------------------Logs--------------------------------------
      > $jdk_b65/bin/javac test.java
      > $jdk_b65/bin/java test
      MediaName.ISO_A4_TRANSPARENT.toString() returns :iso-A4-transparent
      MediaName.ISO_A4_WHITE.toString() returns :iso-A4-white
      > $jdk_b65/bin/java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: