You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/07/14 22:15:39 UTC

DO NOT REPLY [Bug 49594] New: the "apply" task fails when attribute parallel=yes and redirector sub-element present

https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

           Summary: the "apply" task fails when attribute parallel=yes and
                    redirector sub-element present
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: vlad.balan@gmail.com


Hello,

ant 1.8.1.

A) i'm getting 

java.lang.NullPointerException for the apply task when the attribute
parallel="yes" and a "redirector" sub-element is present.
With parallel=no and redirector present it works fine.

B) what is the exepcted behaviour of a nested outputmapper in the redirector
sub-element ( i.e. a per file output for the command) when parallel=yes (i.e.
the command would be executed one time with the concatenated list of files at
the end of the command)
The doc does not specifies this.
This is why i'm using a "constant" redirector by the means of the "input"
attribute of the redirector element, rather than nesting any "outputmapper".


This is my file with "cmd_files" target:



<?xml version="1.0" encoding="UTF-8"?>

<project>

    <patternset id="slash">
        <include name="test/" />
    </patternset>


    <fileset id="filmeFiles" dir="d:/kits">
        <patternset refid="slash" />
    </fileset>

    <target name="echo">
        <echo>Content of filmeFiles: ${toString:filmeFiles}</echo>
    </target>

    <target name="cmd_files" depends="echo">
        <apply dir="d:/kits" dest="d:/kits" executable="cmd" parallel="yes"
addsourcefile="yes">
            <arg value="/c">
            </arg>
            <arg value="echo">
            </arg>
            <targetfile />
            <fileset refid="filmeFiles">
            </fileset>
            <globmapper from="*.txt" to="*_alfa.txt" handledirsep="yes" />
            <redirector output="d:\kits\test\output\all_out.txt" append="yes"
/>
        </apply>
    </target>

</project>

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-08-05 15:45:37 EDT ---
when using parallel mode the redirector is instantiated once per "batch" of
files
that get processed and null is passed in as a source file.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

vlad.balan@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vlad.balan@gmail.com
            Version|unspecified                 |1.8.1
           Severity|critical                    |blocker

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2010-08-05 16:34:42 EDT ---
It is a bug and I've fixed it locally - just running the full test suite right
now.

Passing in null as source file is not a bug, that was my answer to your
question B.

You can work around the bug by setting maxparallel to a value > 0.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

--- Comment #2 from vlad.balan@gmail.com 2010-08-05 15:51:38 EDT ---
hello, thanks for the reply but what are you suggesting in fact?
you agree it is a bug?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.2

--- Comment #4 from Stefan Bodewig <bo...@apache.org> 2010-08-05 16:46:02 EDT ---
behavior documented, bug fixed in svn revision 982773

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

--- Comment #5 from vlad.balan@gmail.com 2010-08-05 16:49:58 EDT ---
So A) is a bug but for B) i still don't understand how your replies relate to
B).
The question B) is about the extepcted behaviour of a nested outputmapper in
redirector when parallel=true. What would happen. Pls.put it another way for me
to understand :)

(by the way pls. what is the link to the freshly added doc)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49594] the "apply" task fails when attribute parallel=yes and redirector sub-element present

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49594

--- Comment #6 from Stefan Bodewig <bo...@apache.org> 2010-08-05 23:55:22 EDT ---
(In reply to comment #5)

> The question B) is about the extepcted behaviour of a nested outputmapper in
> redirector when parallel=true. What would happen.

it depends on the mapper, just like it does for exec in general.  The manual
page for exec says

| Any file mapping is done using a null sourcefile; therefore not
| all Mapper types will return results. When no results are
| returned, redirection specifications will fall back to the task
| level attributes.

and the same is true for apply when parallel is true.

> (by the way pls. what is the link to the freshly added doc)

follow the subversion revision link and you can see the changes.
I haven't updated the online manual, the full page would
be
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/Tasks/apply.html?revision=982773&view=co&pathrev=982773

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.