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 45294 - System.out.print("abc"); can't output
Summary: System.out.print("abc"); can't output
Status: RESOLVED DUPLICATE of bug 56341
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: ivan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-21 15:33 UTC by cxy007
Modified: 2008-12-22 14:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cxy007 2004-06-21 15:33:56 UTC
I found that use Netbeans to run the program 
like:System.out.print("abc"); won't output 
anything, unless a "\n" is encounted.
Any string begin with "a" will be buffered. Is 
that a bug? Or I don't know something?
Comment 1 Jan Becicka 2004-07-22 11:07:36 UTC
Looks like core issue.
Comment 2 Lukas Hasik 2004-07-22 11:29:41 UTC
cxy007, what means 'current' version ? 3.6 or 4.0 ?

it works for me in build 200407220815
provide more info and reopen, thanks.
Comment 3 cxy007 2004-07-22 13:49:15 UTC
I mean version 3.6
I posted this issue a long time ago. I don't know there is new 
version now.
Comment 4 Lukas Hasik 2004-07-22 14:05:41 UTC
thanks cxy007, then I'll reassign to old terminalemulator because the
output window is totally rewritten for NB 4.0

maybe this can be issue for terminalemulator but nobody maintains it
these days
Comment 5 Marian Mirilovic 2006-09-25 10:50:29 UTC
The core team has not been responsible for terminal emulator for long time, so
reassigne all opened issues to responsible person.
Comment 6 jlaiho 2006-12-28 18:42:17 UTC
This appears to be a more generic issue in the terminal emulator;
output (via System.out stream) is line-buffered (and even flushing
the stream does not help).

Given the code (snippet; wrap into a "main class" to run):
        System.out.println("Go");
        System.out.print("Foo");
        System.out.flush();
        try { Thread.sleep(10000L); } catch (Exception e) {}
        System.out.println();
        System.out.println("Bar");

"Go" will be printed immediately
Then there will be a 10-second delay, after which both
"Foo" and "Bar" will be printed

Excepted result is that "Go" and "Foo" are printed immediately,
with "Bar" being printed after the 10-second delay.

I can reproduce this with NetBeans 5.5, on both Linux and WinXP.

It looks very much like Issue 18508 is actually the same as
this one.
Comment 7 ivan 2006-12-31 21:56:41 UTC
If this is still happening in 5.5 then it can't possibly be the 
terminalemulator. It's likely to be in the newer output2 module.

Even before output2 the problem is not so much in the terminalemulator
component as in the original output module which uses delays and timers 
in several places.



Comment 8 Milos Kleint 2007-01-02 13:15:10 UTC
this is actually ant issue. The current output module (in 6.0, partly also in
5.5) can process partial lines, however the ant script that pushes the content
to the output window, always waits for the newline to arrive.

duplicate of #56341

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