• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The task gets instantiated using a no-argument constructor, at parser time

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The task gets instantiated using a no-argument constructor, at parser time. This means even tasks that are never executed get instantiated.

Above is from ant manual.

I tried a sample based on the above explanation.


For each taskdef , I have a System.out.println in its constructor. The problem that I am facing is that the constructor for the task <PrintHello3/> is not getting called(I thought this should have been called at parser time,even though its target is never executed).

It seems that This means even tasks that are never executed get instantiated does not hold true in the above case.

What may be the problem, am I interpreting the statement incorrectly?

Regards,
Joshua
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried it too with ant 1.7, and it didn't get instanciated either.
But guess what. I've also tried with Ant 1.4, and it did get instanciated !
So I guess that the manual is referring to an old version of Ant, and that's it has not been updated.
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Christophe,

You have solved a huge problem of mine. I really appreciate it.
I was not able to find the solution for this for the past 2 days. Thanks once again.

Regards,
Joshua
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic