ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31215] New: - "Trying to override task definition" logged as MSG_WARN instead of MSG_VERBOSE
Date Tue, 14 Sep 2004 11:05:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31215>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31215

"Trying to override task definition" logged as MSG_WARN instead of MSG_VERBOSE

           Summary: "Trying to override task definition" logged as MSG_WARN
                    instead of MSG_VERBOSE
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: david.konecny@volny.cz


"Trying to override task definition" is logged as MSG_WARN instead of
MSG_VERBOSE in my usage of <macrodef> task. I will attach simple scripts which
demonstrate the issue. There are three files:
* template.xml defines two macros: <myecho> and <myecho2>. The only difference
is that <myecho2> has attribute with default value (important for the case
reproduction)
* subproject.xml imports template.xml and uses both macros
* mainproject.xml imports template.xml and uses both macros and in addition
calls also subproject.xml

If you execute mainproject.xml you will get warning "Trying to override old
definition of task http://www.netbeans.org/ns/myecho/2:myecho2" but I think it
should be logged as MSG_VERBOSE only.

Looking at the source code of ComponentHelper.updateDataTypeDefinition() it
first checks whether AntTypeDefinitions are sameDefinition(). <myecho> is the
same, but <myecho2> is not because its value of default attribute is different -
see the scripts. What follows is that similarDefinition() is called on
AntTypeDefinitions. I know nothing about what is your semantics of "similar",
but common sense told me that they should be similar because it is the same
macro. :-) But this methods returns false too which results in MSG_WARN logging
level to be used.

I played with that a bit more and will attach also possible patch which solved
the issue for me. I changed two things:
* MacroDef.MyAntTypeDefinition.similarDefinition used to be the same as
MacroDef.MyAntTypeDefinition.sameDefinition. Now it is less strict and ignore
default value of macro attributes, but as I said I have no idea what is the
semantics of similarity.
* AntTypeDefinition.similarDefinition was returning false to me because my
classloader is URLClassLoader and not AntClassLoader as expected now. Even less
clear to me what is wrong here.

Btw. it is issue <http://www.netbeans.org/issues/show_bug.cgi?id=43968> for
NetBeans IDE which now uses Ant as native build system. It is not high priority,
just more clutter in output and "a bug" for some of our users.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message