This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 108961

Summary: Output window ignores flushes on text that doesn't end with a newline
Product: platform Reporter: apb <apb>
Component: Output WindowAssignee: Milos Kleint <mkleint>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P1    
Version: 5.x   
Hardware: All   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description apb 2007-07-05 17:59:44 UTC
Here is a bit of test code:

public class NetbeansOutputTest {
  
  public static void main(String[] args) {
    System.out.println("Starting Test.");
    System.out.println("This should print immediately.");
    System.out.print("This should print immediately too.");
    System.out.flush();
    try {
      Thread.currentThread().sleep(10000);
    } catch (Exception e) {}
    System.out.println("\nThis should print out after 10 seconds.");
    System.out.println("Finished Test.");
  }
}

The desired output (and the behavior one gets when running from the command line is:

Starting Test.
This should print immediately.
This should print immediately too.
< 10 second wait >
This should print out after 10 seconds.
Finished Test.


However, when this code is run in Netbeans the output looks like:


Starting Test.
This should print immediately.
< 10 second wait >
This should print immediately too.
This should print out after 10 seconds.
Finished Test.


It looks as if the output window is refusing to output any text that doesn't end in a newline.
This is extremely bad for a piece of code that I'm writing because it is command-line based
and it has a very long startup so we print out a "." every now and then to let the user know 
the progress is being made, however, the periods don't get printed out until the entire process
is finished (which defeats the point of this pacification text). The code behaves properly in
every other context that I've tried it (ie, not in Netbeans).
Comment 1 Milos Kleint 2007-07-09 07:44:29 UTC
duplicate of #56341, the output window itself is capable of processing non-complete line, it's the ant integration that
is line based.

*** This issue has been marked as a duplicate of 56341 ***