ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52854] New: Strange entering behaviour in apache-ant 1.6.3 when we type a parameter from console
Date Thu, 08 Mar 2012 07:19:03 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52854

             Bug #: 52854
           Summary: Strange entering behaviour in apache-ant 1.6.3 when we
                    type a parameter from console
           Product: Ant
           Version: unspecified
          Platform: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: scheiber@unitbv.ro
    Classification: Unclassified


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>
===================================================

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message