JDK-4123004 : java.io.BufferedReader does not always pass on input
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.5
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1998-03-26
  • Updated: 1998-04-28
  • Resolved: 1998-04-28
Related Reports
Duplicate :  
Description

Name: mf23781			Date: 03/26/98


BufferedReader doesn't always pass on each line on Win 95.
In the example test case if you keep putting in a character to the

-------Start Of Test Case-----------------------
import java.io.*;
import java.lang.*;
public class noflush {

  public static void main(String[] args) {
    BufferedReader askRef =
      new BufferedReader(new InputStreamReader(System.in));
    String ans = null;
    System.out.println("Demo to show that on Win95 there is");
    System.out.println("buffering of input which makes it unusable");
    System.out.println("because multiple lines are batched before");
    System.out.println("being sent to the application in response to");
    System.out.println("the readLine() call");
    for(;;) {
      System.out.print(">");
      try {
        ans = askRef.readLine();
      }
      catch (IOException e) { System.out.println("oops?");
      }
      System.out.println("You said:["+ans+"]");
      if ((ans == null) | (ans.length() == 0)) break;
    }
  }
}
---------End Of Test Case----------------------

---------Output--------------------------------

java noflush

Demo to show that on Win95 there is
buffering of input which makes it unusable
because multiple lines are batched before
being sent to the application in response to
the readLine() call
>f
You said:[f]
>f
f
f
f
f
You said:[f]
>You said:[f]
>You said:[f]
>You said:[f]
>You said:[f]
>f

You said:[f]
>You said:[]

This problem only occurs on Win95 (JDK 1.1.5, 1.1.6, 1.2b2) and 
does not occur on NT probably due to the improved threading.



======================================================================

Comments
EVALUATION Likely a duplicate of similar Win95-specific bugs. -- mr@eng 4/6/1998
06-04-1998