ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: AW: strange logging error
Date Wed, 24 Aug 2005 06:23:05 GMT
The ProjectHelper2 [1] tries setting a reference to the project instance at line 925. But only
for the placeholder UnkownElement. In line 951 that is replaced by the wrapper [2].

Conor had writte an article [3] about that whole scenario.

Just an idea - implement:
    Project project;
    public void setProject(Project p) { project = p; }
    public void getProject() { return project; }
    public void log(String msg) { getProject().log(msg); }
If I remember right, the reflection stuff during the initialization would set the reference
then and
you could log directly via the project instance.

Jan


[1] http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java?view=annotate

[2] http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java?view=annotate
[3] http://codefeed.com/tutorial/ant_config.html

>-----Urspr├╝ngliche Nachricht-----
>Von: Kev Jackson [mailto:kevin.jackson@it.fts-vn.com] 
>Gesendet: Mittwoch, 24. August 2005 05:07
>An: Ant Developers List
>Betreff: Re: AW: strange logging error
>
>Jan.Materne@rzf.fin-nrw.de wrote:
>
>>Maybe the project is not set correctly.
>>What does "getProject()" refer?
>>
>>If you inherit from DispatchUtils, you dont have a real task 
>(class inherited from oata.Task).
>>You┬┤re using a task wrapper instead.
>>
>>
>>Jan
>>
>>  
>>
>I know, but I was inheriting from Task (just indirectly).  As 
>soon as I directly inherited from Task, the log worked.  So:
>
>Task -> AbstractDarcs -> Initialize.execute (null pointer 
>exception) Task -> Initialize.execute (no problems)
>
>is this the correct behaviour for Ant?  Should my initial 
>version have been using DispatchUtils?  As I've programmed 
>round it and solved the problem I was having, it's not a 
>biggy, but I'm interested in why this is so.
>
>Kev
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For 
>additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Mime
View raw message