I would go for a further change :
in ANTLR.java :
change the signature of
    public void setGlib(String superGrammar) {
to
    public void setGlib(File superGrammar) {
which would have avoided the problem in the first place.
Or do we prefer not to change signatures, even when they are not well
chosen, to maintain API compatibility ?

Antoine

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 8:35 PM
Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional
ANTLR.java


> antoine     2003/06/25 11:35:28
>
>   Modified:    src/main/org/apache/tools/ant/taskdefs/optional ANTLR.java
>   Log:
>   All the tests in ANTLRTest.java involving a super-grammar file were
failing on Windows.
>   This change fixes the problem.
>
>   Revision  Changes    Path
>   1.28      +11 -1
ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
>
>   Index: ANTLR.java
>   ===================================================================
>   RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
>   retrieving revision 1.27
>   retrieving revision 1.28
>   diff -u -r1.27 -r1.28
>   --- ANTLR.java 21 May 2003 13:29:55 -0000 1.27
>   +++ ANTLR.java 25 Jun 2003 18:35:28 -0000 1.28
>   @@ -66,6 +66,7 @@
>    import org.apache.tools.ant.taskdefs.Execute;
>    import org.apache.tools.ant.taskdefs.LogOutputStream;
>    import org.apache.tools.ant.taskdefs.PumpStreamHandler;
>   +import org.apache.tools.ant.taskdefs.condition.Os;
>    import org.apache.tools.ant.types.Commandline;
>    import org.apache.tools.ant.types.CommandlineJava;
>    import org.apache.tools.ant.types.Path;
>   @@ -143,9 +144,18 @@
>
>        /**
>         * Sets an optional super grammar file.
>   +     * @TODO change the semantic from String to File
>         */
>        public void setGlib(String superGrammar) {
>   -        this.superGrammar = superGrammar;
>   +        String sg = null;
>   +        if (Os.isFamily("dos")) {
>   +            sg = superGrammar.replace('\\','/');
>   +        }
>   +        else
>   +        {
>   +            sg = superGrammar;
>   +        }
>   +        this.superGrammar = sg;
>        }
>
>        /**
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to