ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.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 16:45:25 GMT
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?

--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


Mime
View raw message