Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 142721 - Input messed up by output
Input messed up by output
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Output Window
6.x
All All
: P4 with 1 vote (vote)
: 7.1
Assigned To: Jaroslav Havlin
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-03 20:43 UTC by rost
Modified: 2011-10-14 15:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rost 2008-08-03 20:43:26 UTC
If you input something into the output window and some output comes in between, your input gets messed up completely.
This really breaks lots of interactive tests when running within NetBeans.

Here is a small test program:
--------------
import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {
        OutputThread outputThread = new OutputThread();
        outputThread.start();
        InputStreamReader streamReader = new InputStreamReader(System.in);
        BufferedReader stdIn = new BufferedReader(streamReader);
        String input = stdIn.readLine();
        outputThread.running = false;
        System.out.println("input=\"" + input + "\"");
        System.exit(0);
    }

    private static class OutputThread extends Thread {

        public boolean running = true;

        public void run() {
            while (running) {
                System.out.println("output");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException ex) {
                }
            }
        }
    }
}
--------------

Start it and type slowly any string you want (with several characters). After pressing Enter take a look how your input
ends up at the program. In most of the cases the input will be reversed or randomized.
Comment 1 rost 2009-07-19 21:27:13 UTC
I just installed NetBeans-6.7 and the bug is still there.
Comment 2 Martin Entlicher 2011-02-01 10:28:32 UTC
System terminals have the same behavior. The Output window was designed this way, it would probably have to have two modes - one terminal-like and one with a separate input field like it had in the past.
Comment 3 Jaroslav Havlin 2011-10-12 08:40:29 UTC
core-main/rev/8e79faf3c5b4

System terminals do mix input and output characters, but input string is not reversed. Fixed.
Comment 4 Quality Engineering 2011-10-14 15:02:23 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/8e79faf3c5b4
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #142721 - Input messed up by output


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo