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=4163>.
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=4163
Taskdef does not check class for extending Task
Summary: Taskdef does not check class for extending Task
Product: Ant
Version: 1.4
Platform: PC
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Core
AssignedTo: ant-dev@jakarta.apache.org
ReportedBy: ralf@rw7.de
When saying <taskdef name="somewhat" classname="org.apache.tools.ant.Project" />or
any other existing class, there is no error message, that the class does not extend Task.
I think there should be an immediate fatal error terminating the build process. The same seems
to be valid for definitions in default.properties.Current behaviour is, that when initializing
the task: <somewhat xyz="somewhatelse" />there is some "class org.apache.tools.ant.Project
does not support attribute xyz", which is true but misleading. If one invokes the task without
any attributes, ant terminates with a NoSuchMethodException.Proposed fix: add something like
if(!Task.class.isAssignableFrom(taskClass)) throw new BuildException(taskClass.toString()+"
does not extend org.apache.tools.ant.Task");to Project.addTaskDefinition. It would be nice
to have a proper location information attached pointing at the position of the <taskdef>
in the build.xml (or the position in defaults.properties). I think, this bug is somewhat related
to #3205.Anyway, thanks to all developers here for the great tool.Cheers,Ralf.
|