vmassol     02/04/14 09:26:09

  Modified:    anttasks/src/java/org/apache/cactus/ant ChangeLogTask.java
  Log:
  changed by erorr - restoring previous version
  
  Revision  Changes    Path
  1.4       +9 -67     
jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/ChangeLogTask.java
  
  Index: ChangeLogTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/ChangeLogTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChangeLogTask.java        14 Apr 2002 15:56:27 -0000      1.3
  +++ ChangeLogTask.java        14 Apr 2002 16:26:09 -0000      1.4
  @@ -68,7 +68,6 @@
   import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
   import java.io.UnsupportedEncodingException;
  -import java.io.BufferedInputStream;
   import java.net.HttpURLConnection;
   import java.net.MalformedURLException;
   import java.net.URL;
  @@ -98,7 +97,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jeff Martin</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: ChangeLogTask.java,v 1.3 2002/04/14 15:56:27 vmassol Exp $
  + * @version $Id: ChangeLogTask.java,v 1.4 2002/04/14 16:26:09 vmassol Exp $
    */
   public class ChangeLogTask extends Task implements ExecuteStreamHandler
   {
  @@ -135,8 +134,7 @@
       /**
        * Input stream read in from CVS log command
        */
  -    private BufferedInputStream input;
  -//    private InputStream input;
  +    private BufferedReader input;
   
       /**
        * Error Input stream read in from CVS log command
  @@ -418,9 +416,8 @@
   
           // Check if a threshold date has been specified
           if (this.thresholdDate != null) {
  -
  -            toExecute.createArgument().setValue("-d >=" +
  -                OUTPUT_DATE.format(this.thresholdDate));
  +            toExecute.createArgument().setValue("-d\">=" +
  +                OUTPUT_DATE.format(this.thresholdDate) + "\"");
           }
   
           // Check if list of files to check has been specified
  @@ -479,63 +476,16 @@
        */
       public void setProcessOutputStream(InputStream theIs) throws IOException
       {
  -        this.input = new BufferedInputStream(theIs);
  -//        this.input = theIs;
  +        this.input = new BufferedReader(new InputStreamReader(theIs));
       }
   
       /**
  -     * Stop handling of the streams (ie the cvs process).
  +     * Stop handling of the streams (i.e. the cvs process).
        */
       public void stop()
       {
       }
   
  -    private String readLine(InputStream stream) throws IOException
  -    {
  -        debug("ReadLine: begin");
  -
  -        String returnValue = null;
  -        int c;
  -        StringBuffer line = new StringBuffer();
  -
  -        while ((c = stream.read()) != -1) {
  -            debug("ReadLine: available = " + stream.available());
  -            debug("ReadLine: char: [" + c + "]");
  -            if (c == 13) {
  -                c = stream.read();
  -                debug("ReadLine: available = " + stream.available());
  -                debug("ReadLine: char special: [" + c + "]");
  -                if (c == 10) {
  -                    debug("ReadLine: eol");
  -                    break;
  -                } else {
  -                    line.append((char)c);
  -//                    if (stream.available() == 0) {
  -//                        debug("ReadLine: no more chars");
  -//                        break;
  -//                    }
  -                    continue;
  -                }
  -            }
  -            line.append((char)c);
  -//            if (stream.available() == 0) {
  -//                debug("ReadLine: no more chars");
  -//                break;
  -//            }
  -        }
  -
  -        if (c != -1) {
  -//        if (stream.available() != 0) {
  -            returnValue = line.toString();
  -        } else {
  -            debug("ReadLine: assuming end of file");
  -            returnValue = null;
  -        }
  -
  -        debug("ReadLine: end");
  -        return returnValue;
  -    }
  -
       /**
        * Start reading from the cvs log stream.
        */
  @@ -558,10 +508,10 @@
           // RCS entries
           Hashtable entries = new Hashtable();
   
  -        while ((line = readLine(this.input)) != null) {
  +        while ((line = this.input.readLine()) != null) {
   
               // Log to debug file if debug mode is on
  -            debug("Text: [" + line + "]");
  +            debug("Text: [" + line);
   
               switch (status) {
   
  @@ -612,7 +562,7 @@
                           !line.startsWith("------")) {
   
                           comment += line + "\n";
  -                        line = readLine(this.input);
  +                        line = this.input.readLine();
   
                           debug("Text: [" + line);
                       }
  @@ -645,15 +595,9 @@
               // We cannot use a BufferedReader as the ready() method is bugged!
               // (see Bug 4329985, which is supposed to be fixed in JDK 1.4 :
               // http://developer.java.sun.com/developer/bugParade/bugs/4329985.html)
  -
  -            debug("begin reading bytes");
  -
               while (this.errorInput.ready()) {
  -                debug("reading bytes");
                   this.errorInput.read();
               }
  -
  -            debug("end of loop");
           }
   
           debug("Preparing to write changelog file");
  @@ -666,8 +610,6 @@
           this.output.println("</changelog>");
           this.output.flush();
           this.output.close();
  -
  -        debug("End of preparing to write changelog file");
       }
   
       /**
  @@ -782,4 +724,4 @@
           }
       }
   
  -}
  +}
  \ No newline at end of file
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to