You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Vincent Massol <vm...@octo.com> on 2002/04/01 11:38:32 UTC

[Repost][ChangeLogTask] Bugs ...

Peter,

You're usually so fast ... that I think you missed this email ... :-)

Thanks
-Vincent

-----------------------

Ok, after a few hours of struggling, I think there are some bugs in the
changelogtask.

Actually, when I wrote the Cactus changelog task, I took the one from
Alexandria but I spent some time to correct some bugs as I discovered
them (can't remember exactly how many but there were a few) ...

Here is one bug :

When I execute a 'cvs log build.xml' I get :
 

RCS file: /home/cvs/jakarta-cactus/documentation/build.xml,v
Working file: build.xml
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
----------------------------
revision 1.1
date: 2002/03/10 14:10:25;  author: vmassol;  state: Exp;
second part of build process refactoring
========================================================================
=====

Which is fine and understood by the ChangeLogTask.

However, if I execute a 'cvs log "-d >=2002-03-20" build.xml' I get :


RCS file: /home/cvs/jakarta-cactus/documentation/build.xml,v
Working file: build.xml
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 0
description:
========================================================================
=====
 
for which ChangeLogParser.java fails .

This is the reason why I added the following to the Cactus changelog
task :

                case GET_REVISION:
                    if (line.startsWith("revision")) {
                        revision = line.substring(9);
                        status = GET_DATE;
                        debug("Next state = GET_DATE");
                    }
--> add here

                    // If we encounter a "=====" line, it means there is
no
                    // more entries for the current file.
                    else if (line.startsWith("======")) {
                        status = GET_FILE;
                        debug("Next state = GET_FILE");
                    }

--> end addition here

                    break;

 
I also had to add the following few lines after having finished reading
the input stream (for some reason, it was hanging otherwise) :
 
            // Read the error stream so that it does not block !
            // 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)

            while (this.errorInput.ready()) {
                this.errorInput.read();
            }

Where errorInput is defined in :

    public void setProcessErrorStream(InputStream theIs) throws
IOException
    {
        this.errorInput = new InputStreamReader(theIs);
    }

Hope it helps.

Thanks

-Vincent



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Repost][ChangeLogTask] Bugs ...

Posted by Peter Donald <pe...@apache.org>.
On Mon, 1 Apr 2002 19:38, Vincent Massol wrote:
> Peter,
>
> You're usually so fast ... that I think you missed this email ... :-)

Naah - just had to wait till I rebooted into windows ;)

>
> Thanks
> -Vincent
>
> -----------------------
>
> Ok, after a few hours of struggling, I think there are some bugs in the
> changelogtask.
>
> Actually, when I wrote the Cactus changelog task, I took the one from
> Alexandria but I spent some time to correct some bugs as I discovered
> them (can't remember exactly how many but there were a few) ...
>
> Here is one bug :
>
> When I execute a 'cvs log build.xml' I get :
>
>
> RCS file: /home/cvs/jakarta-cactus/documentation/build.xml,v
> Working file: build.xml
> head: 1.1
> branch:
> locks: strict
> access list:
> symbolic names:
> keyword substitution: kv
> total revisions: 1;     selected revisions: 1
> description:
> ----------------------------
> revision 1.1
> date: 2002/03/10 14:10:25;  author: vmassol;  state: Exp;
> second part of build process refactoring
> ========================================================================
> =====
>
> Which is fine and understood by the ChangeLogTask.
>
> However, if I execute a 'cvs log "-d >=2002-03-20" build.xml' I get :
>
>
> RCS file: /home/cvs/jakarta-cactus/documentation/build.xml,v
> Working file: build.xml
> head: 1.1
> branch:
> locks: strict
> access list:
> symbolic names:
> keyword substitution: kv
> total revisions: 1;     selected revisions: 0
> description:
> ========================================================================
> =====
>
> for which ChangeLogParser.java fails .
>
> This is the reason why I added the following to the Cactus changelog
> task :
>
>                 case GET_REVISION:
>                     if (line.startsWith("revision")) {
>                         revision = line.substring(9);
>                         status = GET_DATE;
>                         debug("Next state = GET_DATE");
>                     }
> --> add here
>
>                     // If we encounter a "=====" line, it means there is
> no
>                     // more entries for the current file.
>                     else if (line.startsWith("======")) {
>                         status = GET_FILE;
>                         debug("Next state = GET_FILE");
>                     }
>
> --> end addition here
>
>                     break;
>
>
> I also had to add the following few lines after having finished reading
> the input stream (for some reason, it was hanging otherwise) :
>
>             // Read the error stream so that it does not block !
>             // 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)
>
>             while (this.errorInput.ready()) {
>                 this.errorInput.read();
>             }
>
> Where errorInput is defined in :
>
>     public void setProcessErrorStream(InputStream theIs) throws
> IOException
>     {
>         this.errorInput = new InputStreamReader(theIs);
>     }
>
> Hope it helps.
>
> Thanks
>
> -Vincent

-- 
Cheers,

Pete

----------------------------------------
Whatever you do will be insignificant, 
but it is very important that you do it. 
                              --Gandhi
----------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>