Bug 52854 - Strange entering behaviour in apache-ant 1.8.4 when we type a parameter from console
Summary: Strange entering behaviour in apache-ant 1.8.4 when we type a parameter from ...
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-08 07:19 UTC by Scheiber Erno
Modified: 2012-09-28 00:59 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scheiber Erno 2012-03-08 07:19:03 UTC
Reading / introducing a parameter from console has a strange behaviour: 
the pressed characters (keys) do not appear on the monitor. They are 
visible only after the Enter key is pressed. In apache-ant 1.8.1 it 
was O.K., while in apache-ant 1.8.2 it does not work.

(I use Windows 7 (64), jdk1.7.0_03)

Test example
===================================================
package hello;
import java.util.Scanner;

public class HelloWorld{
  public static void main(String[] args){
    Scanner scanner=new Scanner(System.in);
    System.out.println("Enter your name");
    String name=scanner.next();
    String response=sayHello(name);
    System.out.println(response);
  }

  private static String sayHello(String name){
    return "Hello "+name+" !";
  }  
}
===================================================

<project name="hello" default="Run" basedir=".">
  <property name="build.dir" location="build"/>
  <property name="src" location="src" />

  <path id="myclasspath">
    <pathelement path="${build.dir}" /> 
  </path>  
  
  <target name="init">
    <delete dir="${build.dir}"/>
    <mkdir dir="${build.dir}"/>
  </target>

  <target name="Compile" depends="init" >
    <javac srcdir="${src}" destdir="${build.dir}" 
      includeantruntime="false" classpathref="myclasspath"/>
  </target>

  <target name="Run" depends="Compile"> 
    <java classname="hello.HelloWorld" classpathref="myclasspath" fork="true"/>
  </target>
</project>
===================================================
Comment 1 fsauceda 2012-09-28 00:59:17 UTC
I'm on Mac OS X and tried it with ant 1.8.2. I had a similar problem, after pressing the enter key nothing happens, absolutely nothing, didn't have that problem with ant 1.8.4 though