[BLUEJ-176] Using "\r\n" as the delimiter for a Scanner on System.in does not work as expected
Entering a number won't end the following example program. Only the delimiter "\n" will work, even though the Windows one (on which im using BlueJ) is "\r\n". In the sample below you would probably want something like: in.useDelimiter(System.getProperty("line.separator")); but given the above, this won't work.
Using Windows Vista, BlueJ 2.5.3 & Java 6u14
{noformat} import java.util.Scanner;
public class TestClass {
public static void main(String[] args) {
System.out.println("start");
Scanner in = new Scanner(System.in);
in.useDelimiter("\r\n");
in.nextInt();
System.out.println("end");
}
} {noformat}
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 3.0.0