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 49384 - BufferedReader.readLine doesn´t blocks to wait for user
Summary: BufferedReader.readLine doesn´t blocks to wait for user
Status: CLOSED DUPLICATE of bug 47708
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-22 01:33 UTC by gersonfaf61
Modified: 2006-03-24 10:15 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 gersonfaf61 2004-09-22 01:33:56 UTC
On NB3.6 BufferedReader.readLine blocks and waits 
normally for user input. So with the standard 
java run-time enviroment (1.5.0). But debugging 
or running inside NB4.0-beta1 I got that 
undesired behaviour. Reproduce with this sample 
code:
import java.io.*;
public class EchoTest
{
 public static void main (String args[])
 {
  BufferedReader in = new BufferedReader(new 
InputStreamReader(System.in));
  String line;
  while(true)
  {
   line="";
   try
   {
                                                  
              //nesta linha ele deveria 
                                                  
             //parar esperando
                                                  
             //o usuario, mas no NB4
                                                  
              //nao para
    line = in.readLine();
   }
   catch (IOException e)
   {
    System.err.println(e.getMessage());
   }
   System.out.println(line);
  }
 }
}
Comment 1 gersonfaf61 2004-09-22 01:34:50 UTC
On NB3.6 BufferedReader.readLine blocks and waits normally for user 
input. So with the standard java run-time enviroment (1.5.0). But 
debugging or running inside NB4.0-beta1 I got that undesired 
behaviour. Reproduce with this sample code:
import java.io.*;
public class EchoTest
{
 public static void main (String args[])
 {
  BufferedReader in = new BufferedReader(new InputStreamReader
(System.in));
  String line;
  while(true)
  {
   line="";
   try
   {
                                                                //nest
a linha ele deveria 
                                                               //parar
 esperando
                                                               //o 
usuario, mas no NB4
                                                                //nao 
para
    line = in.readLine();
   }
   catch (IOException e)
   {
    System.err.println(e.getMessage());
   }
   System.out.println(line);
  }
 }
} 
Comment 2 gersonfaf61 2004-09-22 01:36:10 UTC
On NB3.6 BufferedReader.readLine blocks and waits normally for user 
input. So with the standard java run-time enviroment (1.5.0). But 
debugging or running inside NB4.0-beta1 I got that undesired 
behaviour. Reproduce with this sample code:
import java.io.*;
public class EchoTest
{
 public static void main (String args[])
 {
  BufferedReader in = new BufferedReader(new InputStreamReader
(System.in));
  String line;
  while(true)
  {
   line="";
   try
   {
      line = in.readLine();
   }
   catch (IOException e)
   {
    System.err.println(e.getMessage());
   }
   System.out.println(line);
  }
 }
} 
Comment 3 Petr Nejedly 2004-09-23 10:31:08 UTC
Seems like ant integration doesn't provide working stdio for executed
apps.
Comment 4 Jesse Glick 2004-09-23 18:40:49 UTC
An Ant limitation currently prevents System.in from working for forked
apps.

*** This issue has been marked as a duplicate of 47708 ***
Comment 5 Marian Mirilovic 2005-07-12 10:15:54 UTC
closed