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 58829 - Unable to read from the console when running in the IDE in profile mode.
Summary: Unable to read from the console when running in the IDE in profile mode.
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: iformanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-12 14:50 UTC by ngbrito
Modified: 2006-01-18 02:04 UTC (History)
0 users

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 ngbrito 2005-05-12 14:50:22 UTC
If you try to run the following interactive console application in the IDE
profiler you will not be able to enter your name. In fact, the application will
never terminate as it is waiting for input.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    
    public static void main(String[] args) {
        try {
            System.out.println("What is your name?");
            BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
            String name = r.readLine(); // should wait here for user input
            System.out.println("Hello, " + name);
        } catch (IOException e) {
            System.err.println("Failed to read from console.");
        }
    }
    
}

The output is:

What is your name?

I have NetBeans 4.1RC2 with the Mobility Pack and the Profiler 4.1 M6.

If I run the application normally, i.e. not in profile mode, then it works fine.
Comment 1 Milan Kubec 2005-05-19 09:05:22 UTC
Reassigning for evaluation.
Comment 2 iformanek 2005-06-07 10:29:08 UTC
Accepting
Comment 3 iformanek 2005-06-20 10:33:11 UTC
Will fix for M8
Comment 4 iformanek 2005-07-22 08:56:17 UTC
Thansk for reporting this problem.
I fixed this in M8, the profiler ant task will now behave the same way as 
regular execution - i.e. the standard Ant output window will be used for 
profiler app I/O (and the stdin will work).
Comment 5 ngbrito 2005-10-02 03:10:06 UTC
I verified that it is working in M8.
Comment 6 ngbrito 2006-01-18 02:04:14 UTC
It had been solved in M8.