Hello Dominique,

the reason for the changes was to make the mergePatterns(Project) method in 
AbstractFileSet work without bugs.

Before, it was only copying the patterns which are valid in respect to their if 
and unless attributes and the properties being set in the project.

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.

You will notice that in DataType.clone, I am only setting the refid field if it 
is not null, otherwise I had some tooManyAttributes exceptions creeping up.

Regards,

Antoine

-------- Original-Nachricht --------
Datum: Wed, 1 Nov 2006 07:43:10 -0600
Von: "Dominique Devienne" <[EMAIL PROTECTED]>
An: "Ant Developers List" <dev@ant.apache.org>
Betreff: Re: svn commit: r469781 - in 
/ant/core/trunk/src/main/org/apache/tools/ant: ProjectComponent.java 
types/AbstractFileSet.java types/DataType.java types/PatternSet.java

> > -public abstract class DataType extends ProjectComponent {
> > +public abstract class DataType extends ProjectComponent implements
> Cloneable {
> > +    public Object clone() throws CloneNotSupportedException {
> > +        DataType dt = (DataType) super.clone();
> > +        dt.setDescription(getDescription());
> > +        if (getRefid() != null) {
> > +           dt.setRefid(getRefid());
> > +       }
> > +        dt.setChecked(isChecked());
> > +        return dt;
> > +    }
> >  }
> >
> > --- ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java
> (original)
> > +++ ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java
> Tue Oct >     public Object clone() {
> > -        if (isReference()) {
> > -            return getRef(getProject()).clone();
> > -        } else {
> > ...
> > +        try {
> > +            PatternSet ps = (PatternSet) super.clone();
> 
> You've removed the isReference check Antoine. Did you really intend to
> clone the reference'r rather than the reference'd? I prefer to ask,
> since I don't understand the reason for these changes (which is not to
> say I context the changes). --DD
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to