ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: svn commit: r559096 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/types/Path.java
Date Tue, 24 Jul 2007 18:08:02 GMT

--- Dominique Devienne <ddevienne@gmail.com> wrote:

> Matt, did you test this? You write that derive
> classes can override
> delegateIteratorToList() to return false, but this
> is used to init a
> class member of Path, i.e. the *super* class of the
> one supposed to do
> the overriding...
> 
> Assuming a MyPath extends Path, Path's members and
> Ctors are called
> before MyPath is initialized, so relying on virtual
> dispatch on a
> class that's not been initialized yet is fraught
> with trouble. Perhaps
> it works OK if MyPath.delegateIteratorToList() just
> returns false, but
> why not simply forgo the caching into preserveBC and
> systematically
> call delegateIteratorToList() when needed, at a time
> MyPath is fully
> initialized?
> 

Certainly this could be done, but I was looking to
avoid the expense of multiple reflection-based checks.
 Do you think it would be better to store a Boolean so
that the call could still be made only once (triggered
by the null reference), but deferred until after
initialization?

-Matt

> --DD
> 
> On 7/24/07, mbenson@apache.org <mbenson@apache.org>
> wrote:
> > +    private final boolean preserveBC =
> delegateIteratorToList();
> 
> > +    /**
> > +     * that implements <code>list()</code>; this
> can, of course, be avoided by overriding
> > +     * this method to return <code>false</code>.
> It is not expected that the result of this
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

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


Mime
View raw message