Author: hibou
Date: Tue Jul 26 22:02:37 2011
New Revision: 1151269

URL: http://svn.apache.org/viewvc?rev=1151269&view=rev
Log:
BR 51161:
 - don't close System.in otherwise it won't be readable anymore

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1151269&r1=1151268&r2=1151269&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Jul 26 22:02:37 2011
@@ -63,6 +63,10 @@ Fixed bugs:
    with failonerror=false, so warnings won't get logged 
    Bugzilla Report 48789.
 
+ * System.in was closed and not readable anymore by the DefaultInputHandler 
+   when Ant is used via its Java API.
+   Bugzilla Report 51161
+
 Other changes:
 --------------
 

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java?rev=1151269&r1=1151268&r2=1151269&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java 
Tue Jul 26 22:02:37 2011
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.Enumeration;
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.util.KeepAliveInputStream;
 
 /**
  * Prompts on System.err, reads input from System.in
@@ -118,6 +119,6 @@ public class DefaultInputHandler impleme
      * @return the input stream from which the user input should be read.
      */
     protected InputStream getInputStream() {
-        return System.in;
+        return KeepAliveInputStream.wrapSystemIn();
     }
 }
\ No newline at end of file


Reply via email to