DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14619>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14619

Mapper with type "regexp" takes 'null' for empty sub-RegExp's

           Summary: Mapper with type "regexp" takes 'null' for empty sub-
                    RegExp's
           Product: Ant
           Version: 1.5.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I tried to copy some files and I wanted to change filename and path with the 
same task. The filenames should get an 'IDo'-prefix and all occurences of \src\ 
should be changed to \n_src\.

So I tried a copy task with a fileset and a mapper:

    <copy todir=".">
        <fileset dir=".">
            <include name="**/src/**/*.java"/>
        </fileset>
        <mapper type="regexp" 
                from="^(.*)\\src\\((.*\\)*)([a-zA-Z0-9_\.]+)\.java$$" 
                to="\1\\n_src\\\3IDo\4\.java"/>
    </copy>

And these are the pathnames of some files:

de\tom\src\Google.java
de\tom\src\subProject\Google2.javafile 
de\tom\src\subProject\oneMore\Google3.java

But I got an unexpected result:

de\tom\n_src\nullIDoGoogle.java
de\tom\n_src\subProject\IDoGoogle2.java
de\tom\n_src\subProject\oneMore\IDoGoogle3.java

The problem is the filepath of the first file - nullIDoGoogle.java.
For the first file the RegExpression ((.*\\)*) is empty and creates a "null"-
String. But I think it should be  "".

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

Reply via email to