ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: svn commit: r469781 - in /ant/core/trunk/src/main/org/apache/tools/ant: types/ types/ types/
Date Wed, 01 Nov 2006 17:02:59 GMT
Hello Dominique,

these Clone methods are shallow anyway.

The only bit which is not shallow is that the Vectors held internally by the patternset are

The vector elements themselves are not cloned.

So you can add a PatternSet.NameEntry to a clone of a PatternSet without changing the original.

But if you change a PatternSet.NameEntry in the clone, which is coming from the original,
this will affect the original.

Do you think this level of detail should be in the javadoc ?


-------- Original-Nachricht --------
Datum: Wed, 1 Nov 2006 09:57:15 -0600
Von: "Dominique Devienne" <>
An: "Ant Developers List" <>
Betreff: Re: svn commit: r469781 - in /ant/core/trunk/src/main/org/apache/tools/ant:
types/ types/ types/

> > I have decided that PatternSet.clone() should return also a reference
> rather than the referenced object if the object is a reference.
> >
> > When the object is used, the different getters will bring the user back
> to the referenced object.
> The only little concern I had with this approach was that if the
> referenced object was changed between the moment the referencer is
> cloned, and the moment it effectively accesses the cloned referencer
> instance (and thus the modified referenced instance), accessing the
> cloned reference may gives a false sense of "security", the user
> thinking the clone is private and won't change, despite the fact that
> it's still "just" a proxy (reference in Ant terms) to another
> instance, that one not cloned.
> Confusing statement, I know ;-) --DD
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message