JDK-5068322 : javax.imageio.plugins.jpeg.JPEGQTable.toString() produces incorrect description
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-06-25
  • Updated: 2005-10-10
  • Resolved: 2005-10-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b56Fixed
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
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
2004-08-21

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