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

javax.imageio.plugins.jpeg.JPEGQTable.toString() produces incorrect description

XMLWordPrintable

    • b56
    • x86
    • windows_xp

      Name: js151677 Date: 06/25/2004


      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      The toString() of the class JPEGQTable in the package javax.imageio.plugins.jpeg seems give a String containing the values of the table, but instead repeats only the first line of the table.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      System.out.println(javax.imageio.plugins.jpeg.K1Luminance.toString());


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The data values of the K.1 Luminance table should be listed to the console.
      ACTUAL -
      The first row of the array is listed as repeated colomns.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class testQTable {
       public static void main(String[] args) {
        System.out.println(javax.imageio.plugins.jpeg.K1Luminance.toString());
       }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
       public String toString() {
               StringBuffer sb = new StringBuffer();
               sb.append("JPEGQTable:\n");
               for (int i = 0; i< 8; i++) {
               sb.append('\t');
               for (int j = 0; j < 8; j++) {
               sb.append(this.getTable()[i*8+j]).append("\t");
               }
               sb.append('\n');
               }
               return sb.toString();
              }
      (Incident Review ID: 281198)
      ======================================================================

            campbell Christopher Campbell (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: