United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5068322 : javax.imageio.plugins.jpeg.JPEGQTable.toString() produces incorrect description

Details
Type:
Bug
Submit Date:
2004-06-25
Status:
Resolved
Updated Date:
2005-10-10
Project Name:
JDK
Resolved Date:
2005-10-10
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.imageio
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
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) 
======================================================================

                                    

Comments
SUGGESTED FIX

 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();
        }

###@###.### 2004-07-22
                                     
2004-07-22
EVALUATION

See suggested fix field.  Easy one line fix.
###@###.### 2004-07-22
                                     
2004-07-22
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-08-21



Hardware and Software, Engineered to Work Together