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 40641] - UnknownElement.maybeConfigure() is really "always configure"
Date Fri, 29 Sep 2006 17:02:19 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=40641>.
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=40641





------- Additional Comments From kgregory@healthmarketscience.com  2006-09-29 10:02 -------
> The example of code that you gave does work for me:

Yes, that code will work. Sorry if I wasn't clear enough: what happens is that
the UnknownElement.perform() calls maybeConfigure(), which will create a new
instance of the real child task, with the result that the parent will be null
when the child is executed. Try this code (apologies if it has a syntax error, I
didn't compile it):

public class MyTask extends Task {

    private Object _parent;

    public void injectParent(Parent p) {
        System.out.println("Parent was injected");
        System.out.println("my identity = " + System.identityHashCode(this));
        _parent = p;
    }

    public void execute() {
       System.out.println("in execute, parent = " + _parent);
       System.out.println("my identity = " + System.identityHashCode(this));
    }
}


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message