Re: Dynamic Configurator

2003-03-21 Thread Stefan Bodewig
On Thu, 20 Mar 2003, Brett Wooldridge [EMAIL PROTECTED] wrote:

 When I run ant, I see that createDynamicElement() gets
 called twice for the junit element, and further that
 setDynamicAttribute() gets called twice for someattr.

This certainly sounds like a bug.  We don't call the attribute setters
or nested creators/storers twice for normal elements either.

 I put a Thread.dumpStack() inside of my implementations
 of those methods, and can provide the stacks for the two
 calls (they ARE different) if that would help.

I think it would, yes.

Stefan


Dynamic Configurator

2003-03-20 Thread Brett Wooldridge
Hello list,
   I'm trying to use DynamicConfigurator and am having some
difficulty.  I have a class that implements DynamicConfigurator
and is used to wrap around other tasks, like:
 
mywrapper someattr=somevalue
junit ...
yada yada
/junit
/mywrapper
 
Further, mywrapper is being used inside of a parallel task
(it may not matter, but I'm trying to provide all data).
 
When I run ant, I see that createDynamicElement() gets
called twice for the junit element, and further that
setDynamicAttribute() gets called twice for someattr.
 
Now, setDynamicAttribute() getting called twice is mostly
harmless, but it seems that creating two Objects due to
createDynamicElement() being called twice seems like
a bug.  How can I tell I'm getting called a second time
for a first instance of junit or called the first time for a
second instance of junit?
 
I cannot find any usage of DynamicConfigurator within the
1.5.2 ant source tree (ie no implementations) to compare
my code to.
 
I put a Thread.dumpStack() inside of my implementations
of those methods, and can provide the stacks for the two
calls (they ARE different) if that would help.
 
Thanks in advance.
 
Brett Wooldridge
Sr. Software Eng.
IronGrid, Inc.
 


Re: Dynamic Configurator

2003-03-20 Thread Erik Hatcher
On Thursday, March 20, 2003, at 01:45  PM, Brett Wooldridge wrote:
mywrapper someattr=somevalue
junit ...
yada yada
/junit
/mywrapper
Further, mywrapper is being used inside of a parallel task
(it may not matter, but I'm trying to provide all data).
Wow, quite a complex scenario you have there - using real Ant tasks as 
nested elements *and* within parallel... I certainly don't have any 
words of wisdom for this.

I cannot find any usage of DynamicConfigurator within the
1.5.2 ant source tree (ie no implementations) to compare
my code to.
The latest XDoclet code uses it, and I've used it for my Lucene index 
task and other example tasks for the book, but never to the level 
you're trying it.  Perhaps the XDoclet implementation of it can help?

Erik


Re: Dynamic Configurator

2003-03-20 Thread peter reilly
Ant Dev with java gives an example.

I used DynamicConfigurator to implement custom
conditions in bugzilla bug no : 17199
I did not have the problems you describe.

Peter

On Thursday 20 March 2003 18:45, Brett Wooldridge wrote:
 Hello list,
I'm trying to use DynamicConfigurator and am having some
 difficulty.  I have a class that implements DynamicConfigurator
 and is used to wrap around other tasks, like:

 mywrapper someattr=somevalue
 junit ...
 yada yada
 /junit
 /mywrapper

 Further, mywrapper is being used inside of a parallel task
 (it may not matter, but I'm trying to provide all data).

 When I run ant, I see that createDynamicElement() gets
 called twice for the junit element, and further that
 setDynamicAttribute() gets called twice for someattr.

 Now, setDynamicAttribute() getting called twice is mostly
 harmless, but it seems that creating two Objects due to
 createDynamicElement() being called twice seems like
 a bug.  How can I tell I'm getting called a second time
 for a first instance of junit or called the first time for a
 second instance of junit?

 I cannot find any usage of DynamicConfigurator within the
 1.5.2 ant source tree (ie no implementations) to compare
 my code to.

 I put a Thread.dumpStack() inside of my implementations
 of those methods, and can provide the stacks for the two
 calls (they ARE different) if that would help.

 Thanks in advance.

 Brett Wooldridge
 Sr. Software Eng.
 IronGrid, Inc.