concept Java task in category ant
appears as: Java task, Java tasks, Java tasks

This is an excerpt from Manning's book Ant in Action.
The trouble with this approach is that it assumes that the type of the task <java> will always be that of the Java task, org.apache.tools.ant.tasks.Java. The moment someone uses <presetdef> to redefine the <java> task, (perhaps to give it a new default), its type changes, breaking code inside other tasks. Ant itself had to undergo a major cleanup once this problem was noticed. Current code just creates an instance and then configures it.