Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353197

Summary: Display problem in console when a line reaches 4096 characters
Product: [Eclipse Project] Platform Reporter: captmjc
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse.felipe, pwebster, remy.suen
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description captmjc CLA 2011-07-27 06:47:08 EDT
Build Identifier: 20110218-0911

When there are at least 4096 characters in a single line, all characters become whitespaces. However,when you copy the line into other editors, such as notepad, everything is fine.

The test case:
    StringBuilder sb = new StringBuilder(4096);
    for (int i = 0; i < 1023; i++) {
      sb.append("abcd");
    }
    System.out.println(sb); // OK
    sb.append("abc");
    System.out.println(sb); // OK
    sb.append("d");
    System.out.println(sb); // NG

Reproducible: Always

Steps to Reproduce:
1. Run the test case in the bug details.
2. There are three lines of system output in the console, and the last one seems to be composed of whitespaces.
3. Copy the last line to another text editor, such as notepad. The content is "abcd...." without a single space.
Comment 1 Dani Megert CLA 2011-07-27 06:58:21 EDT
I can reproduce the problem on my Windows 7 box but I had to increase the loop length to see it.

Pasting the invisible stuff to Notepad indeed reveals the characters. Pasting into SWT TextEditor example eats them again.
Comment 2 Remy Suen CLA 2011-07-27 07:43:51 EDT
Likely a duplicate of bug 307979. Which is probably a duplicate of another bug.
Comment 3 captmjc CLA 2011-07-27 08:19:38 EDT
The bug may be related to the character type.
The test case:
    for (int i = 0; i < 1024; i++) {
      System.out.print("abcd");
    }
    System.out.println(); // NG
    for (int i = 0; i < 1024; i++) {
      System.out.print("ABCD");
    }
    System.out.println(); // NG
    for (int i = 0; i < 1024; i++) {
      System.out.print("1234");
    }
    System.out.println(); // NG
    for (int i = 0; i < 1024; i++) {
      System.out.print("ab12");
    }
    System.out.println(); // OK
    for (int i = 0; i < 1024; i++) {
      System.out.print("+-*/");
    }
    System.out.println(); // NG
    for (int i = 0; i < 1024; i++) {
      System.out.print("0-*/");
    }
    System.out.println(); // OK
    // The following lines might need chinese font support
    for (int i = 0; i < 2048; i++) {
      System.out.print("\u4f60\u597d"); // Chinese characters nihao or hello
    }
    System.out.println(); // OK
    for (int i = 0; i < 1024; i++) {
      System.out.print("\u4f60\u597d"); // Chinese characters nihao or hello
      System.out.print("ab");
    }
    System.out.println(); // OK
    for (int i = 0; i < 1024; i++) {
      System.out.print("\u4f60\u597d"); // Chinese characters nihao or hello
      System.out.print("12");
    }
    System.out.println(); // OK
Comment 4 Felipe Heidrich CLA 2011-07-27 11:39:09 EDT
the bug is related to the length of the text is pixels, use a smaller font and you will be able to get more characters in the text before it breaks.

*** This bug has been marked as a duplicate of bug 23406 ***