ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r426172 - /ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java
Date Thu, 27 Jul 2006 18:02:21 GMT
Author: jglick
Date: Thu Jul 27 11:02:20 2006
New Revision: 426172

URL: http://svn.apache.org/viewvc?rev=426172&view=rev
Log:
Correcting use of deprecated API.

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

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=426172&r1=426171&r2=426172&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 Thu Jul 27
11:02:20 2006
@@ -17,12 +17,12 @@
 
 package org.apache.tools.ant.input;
 
-import java.io.DataInputStream;
+import java.io.BufferedReader;
 import java.io.IOException;
 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
@@ -45,15 +45,14 @@
      */
     public void handleInput(InputRequest request) throws BuildException {
         String prompt = getPrompt(request);
-        DataInputStream in = null;
+        BufferedReader r = null;
         try {
-            in =
-                new DataInputStream(new KeepAliveInputStream(getInputStream()));
+            r = new BufferedReader(new InputStreamReader(getInputStream()));
             do {
                 System.err.println(prompt);
                 System.err.flush();
                 try {
-                    String input = in.readLine();
+                    String input = r.readLine();
                     request.setInput(input);
                 } catch (IOException e) {
                     throw new BuildException("Failed to read input from"
@@ -61,9 +60,9 @@
                 }
             } while (!request.isInputValid());
         } finally {
-            if (in != null) {
+            if (r != null) {
                 try {
-                    in.close();
+                    r.close();
                 } catch (IOException e) {
                     throw new BuildException("Failed to close input.", e);
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message