ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9900] - addConfigured methods called multiple times under TaskContainer
Date Sun, 16 Jun 2002 22:52:59 GMT
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=9900>.
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=9900

addConfigured methods called multiple times under TaskContainer





------- Additional Comments From jeff@socialchange.net.au  2002-06-16 22:52 -------
Good idea. Hmm.. looks like it's because <sequential> and <parallel> call the
task's perform() method, which in turn calls maybeConfigure(). So for each
nested <sequential>, it is reconfigured.

This comment by Jon Skeet, just above Task.java's maybeConfigure() method, looks
relevant:

    // XXX: (Jon Skeet) The comment "if it hasn't been done already" may
    // not be strictly true. wrapper.maybeConfigure() won't configure the same
    // attributes/text more than once, but it may well add the children again,
    // unless I've missed something.

That last bit, "may well add the children again", seems to be what I'm observing.


Here's what the stack looks like on the second addConfigured method call for:
<sequential>
  <print>
    <message text="This is a message"/>
  </print>                                                                     
                             </sequential>

/home/jeff/antbug9900/run.xml:35: java.lang.RuntimeException: Marker exception
thrown because addConfiguredMessage() was called more than once
        at
org.apache.tools.ant.IntrospectionHelper.storeElement(IntrospectionHelper.java:586)
        at org.apache.tools.ant.ProjectHelper.storeChild(ProjectHelper.java:382)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:220)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:253)
        at org.apache.tools.ant.Task.perform(Task.java:312)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)
--- Nested Exception ---
java.lang.RuntimeException: Marker exception thrown because
addConfiguredMessage() was called more than once
        at Print.addConfiguredMessage(Print.java:18)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.tools.ant.IntrospectionHelper$3.store(IntrospectionHelper.java:314)
        at
org.apache.tools.ant.IntrospectionHelper.storeElement(IntrospectionHelper.java:574)
        at org.apache.tools.ant.ProjectHelper.storeChild(ProjectHelper.java:382)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:220)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:253)
        at org.apache.tools.ant.Task.perform(Task.java:312)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)




And here's the stack on the third addConfigured call for:

<sequential> 
  <sequential>
    <print>
       <message text="This is a message"/>
    </print>
  </sequential>
</sequential>


/home/jeff/antbug9900/run.xml:36: java.lang.RuntimeException: Marker exception
thrown because addConfiguredMessage() was called more than once
        at
org.apache.tools.ant.IntrospectionHelper.storeElement(IntrospectionHelper.java:586)
        at org.apache.tools.ant.ProjectHelper.storeChild(ProjectHelper.java:382)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:220)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:253)
        at org.apache.tools.ant.Task.perform(Task.java:312)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)
--- Nested Exception ---
java.lang.RuntimeException: Marker exception thrown because
addConfiguredMessage() was called more than once
        at Print.addConfiguredMessage(Print.java:18)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.tools.ant.IntrospectionHelper$3.store(IntrospectionHelper.java:314)
        at
org.apache.tools.ant.IntrospectionHelper.storeElement(IntrospectionHelper.java:574)
        at org.apache.tools.ant.ProjectHelper.storeChild(ProjectHelper.java:382)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:220)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:253)
        at org.apache.tools.ant.Task.perform(Task.java:312)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:94)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)


--Jeff

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message