On 7/17/07, Peter Reilly <[EMAIL PROTECTED]> wrote:
On 7/17/07, Matt Benson <[EMAIL PROTECTED]> wrote: > > --- Peter Reilly <[EMAIL PROTECTED]> wrote: > > > I think that the cloning is not complete. > > Thanks for pointing that out; I certainly need(ed) to > clone the delegates and (*)properties maps. I am > purposely not doing anything with hooks, etc., since > the operative idea is to discard that whole (sub-)API.
Probably a good idea.
Peter
> > > There is a patch in > > > http://issues.apache.org/bugzilla/attachment.cgi?id=18662 > > that tries to get a clone of this horrible class. I > > Horrible class?! With the hook/chain stuff, I can > agree. :) Certainly it's a PITA overall. ;) > > > did not apply it > > at the time as I was scared of the potential bugs. > > Is it possible you can provide a link to the entire > bugrep rather than just the attachment? ;) Opps.... http://issues.apache.org/bugzilla/show_bug.cgi?id=40093 Peter > > -Matt > > > Peter > > > > > > On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > wrote: > > > Author: mbenson > > > Date: Tue Jul 17 11:55:42 2007 > > > New Revision: 557025 > > > > > > URL: > > http://svn.apache.org/viewvc?view=rev&rev=557025 > > > Log: > > > Cloneable; update Delegate order on re-add > > > > > > Modified: > > > > > > ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java > > > > > > Modified: > > > ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java > > > URL: > > > http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java?view=diff&rev=557025&r1=557024&r2=557025 > > > > > > ============================================================================== > > > --- > > > ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java > > (original) > > > +++ > > > ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java > > Tue Jul 17 11:55:42 2007 > > > @@ -57,7 +57,7 @@ > > > * > > > * @since Ant 1.6 > > > */ > > > -public class PropertyHelper { > > > +public class PropertyHelper implements Cloneable > > { > > > > > > /** > > > * Marker interface for a PropertyHelper > > delegate. > > > @@ -198,6 +198,7 @@ > > > * least for non-dynamic properties) > > > * > > > * @param next the next property helper in > > the chain. > > > + * @deprecated > > > */ > > > public void setNext(PropertyHelper next) { > > > this.next = next; > > > @@ -207,6 +208,7 @@ > > > * Get the next property helper in the chain. > > > * > > > * @return the next property helper. > > > + * @deprecated > > > */ > > > public PropertyHelper getNext() { > > > return next; > > > @@ -707,7 +709,6 @@ > > > * the return value is also > > <code>null</code>. > > > * @return the property value, or > > <code>null</code> for no match > > > * or if a <code>null</code> name is > > provided. > > > - * @deprecated namespaces are unnecessary. > > > */ > > > public synchronized Object > > getUserProperty(String name) { > > > if (name == null) { > > > @@ -909,9 +910,10 @@ > > > list = new ArrayList(); > > > delegates.put(key, list); > > > } > > > - if (!list.contains(delegate)) { > > > - list.add(0, delegate); > > > + if (list.contains(delegate)) { > > > + list.remove(delegate); > > > } > > > + list.add(0, delegate); > > > } > > > } > > > > > > @@ -939,6 +941,21 @@ > > > if > > (Delegate.class.isAssignableFrom(c[i]) && > > !Delegate.class.equals(c[i])) { > > > result.add(c[i]); > > > } > > > + } > > > + return result; > > > + } > > > + > > > + /** > > > + * Make a clone of this PropertyHelper. > > > + * @return the cloned PropertyHelper. > > > + * @since Ant 1.8 > > > + */ > > > + public Object clone() { > > > + PropertyHelper result; > > > + try { > > > + result = (PropertyHelper) > > super.clone(); > > > + } catch (CloneNotSupportedException e) { > > > + throw new BuildException(e); > > > } > > > return result; > > > } > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > ____________________________________________________________________________________ > Yahoo! oneSearch: Finally, mobile search > that gives answers, not web links. > http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]