Summary: | same macrodef causes "Trying to override task definition" | ||
---|---|---|---|
Product: | Ant | Reporter: | David Konecny <david.konecny> |
Component: | Core | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | jglick |
Priority: | P3 | ||
Version: | 1.6.2 | ||
Target Milestone: | 1.6.3 | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
zip file with Ant scripts
possible patch of the problem |
Description
David Konecny
2004-09-14 11:05:05 UTC
Created attachment 12727 [details]
zip file with Ant scripts
Created attachment 12728 [details]
possible patch of the problem
First thanks for the clear report! The two myecho2 macros are different - they do have different behaviour when <myecho2/> is used. As you point out, this is due to the different setting of the defaulted attribute. The similar/same issue came for attempting to deal with: <project default="call"> <taskdef name="x" classname="y" classpath="z"/> <target name="call"> <antcall target="callee"/> </target> <target name="callee"> <x/> </target> </project> This is a common use-case, and we do not want to get a message that "x" has been redefined. The second definition is not exactly the same as the first - it may have a different classloader, hence the similar method and the VERBOSE message. If someone did: <project> <taskdef name="x" classname="y"/> <taskdef name="x" classname="anotherclass"/> </project> We want to tell the user that x has been redefined. {Although there are bug reports about this been too noisey}. The same idea carries over to macrodef (and the other *def) functions. The issue with AntTypeDefinition.similarDefinition not checking to see if the classloaders are the same is a bug - thanks. So the question is, should ant report the differences between the two definitions of <myecho2> ? I see a number of solutions: 1) treat differences in default values as "similar" - your patch 2) treat all redefinitions as VERBOSE 3) leave as is As this is important from the point of view of intergration with netbeans, I would be inclined to option 1) or option 2). However, I would like other comments before committing the patch. Thanks for the explanation. Re. "from the point of view of intergration with netbeans" - I just worked around it in NetBeans by filtering these messages out from output which user can see in IDE. Changed summary to reflect the fact that it is the same macrodef definition that causes the problem The ant code now allows macrodefs declared in the same file/line to be treated as similar definitions, and so the log mesage will be VERBOSE. |