ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: Name collisions
Date Tue, 05 Mar 2002 00:26:09 GMT
From: "Stefan Bodewig" <bodewig@apache.org>

> On Mon, 4 Mar 2002, Jose Alberto Fernandez <j_a_fernandez@yahoo.com>
> wrote:
> 
> > As far as I can see in the current ANT1 code, there seems to be no
> > provisions on what happens if I define a task and a datatype using
> > the same name. The definer tasks do not check across different
> > namespaces.
> 
> This is true.
> 
> > To make clear what is the situation I am referring to let me
> > formalize it:
> > 
> >     - Given two roles, A & B, triggered by the same container
> >     interface (e.g., task and data-type) and given that a particular
> >     element name, N, is registered in role A, what should be the
> >     correct behaviour when one attempts to register N in B.
> 
> I'm not sure what triggered by the same container interface means
> here.
> 
> In the case of tasks and data-type we only have a disambiguity because
> both can be defined within the same container elements (target for
> example), is this the "triggered by the same container interface" you
> are talking about?
> 

Yes. The same container interface in that case is TaskContainer.

> If you want to generalize this to arbitrary roles, you cannot do
> anything at all, as you cannot know whether there is a context in
> which roles A and B both can be used at the same time, at least not at
> the point where things get registered.  Or can you?
> 

In the most general case that is true. If a container implements the interfaces
for 3 different roles (with different interfaces) there is very little that one can do.
But I would argue that that is not the regular usage escenario. The regular usage
(and the one present right now) is having several roles determine by the same
interface (e.g., TaskContainer) in such a case we know that all the elements in those
roles will always be available at the same time and therefore name clashes are 
a thing to take into account.

So, even without <antlib> what shall we do in ANT1.x with the fact that 
task and typedef declarations do not check accross each other. 
That is a bug, since no warning or error is sent, but the declaration is ignored.

Jose Alberto



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


Mime
View raw message