-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
sparc
-
solaris_2.5
Name: dsR10051 Date: 05/17/2000
The methods
public void list(PrintStream out, int indent) and public void list(PrintWriter out, int indent)
works incorrectly. It adds double indent before a string representation of this component.
Here is a minimized test:
import java.awt.*;
import java.io.*;
public class ComponentTest3 {
public static void main (String[] args) {
CharArrayWriter chaw = new CharArrayWriter();
PrintWriter pw = new PrintWriter(chaw);
Component c = new Canvas();
int indent = 5;
String str_indent = " ";
c.list(pw, indent);
pw.flush();
String result = chaw.toString();
System.out.println(result);
pw.close();
if (!result.startsWith(str_indent + c.toString())) {
System.out.println(str_indent + c.toString() + ": EXPECTED");
System.out.println("FAILED");
} else {
System.out.println("OKAY");
}
}
}
Output:
%java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-B)
Java HotSpot(TM) Client VM (build 1.3.0-B, interpreted mode)
%java ComponentTest3
java.awt.Canvas[canvas0,0,0,0x0,invalid]
java.awt.Canvas[canvas0,0,0,0x0,invalid]: EXPECTED
FAILED
======================================================================
- duplicates
-
JDK-4185460 Container list the indentation is 2x the indent param value
-
- Closed
-