/** * Create a deep clone of this instance, except for the nested selectors (the list of selectors is * a shallow clone of this instance's list). * * @return a cloned Object. */ public synchronized Object clone() { if (isReference()) { return getRef().clone(); } Files f = (Files) super.clone(); f.defaultPatterns = (PatternSet) defaultPatterns.clone(); f.additionalPatterns = new Vector(additionalPatterns.size()); for (Iterator iter = additionalPatterns.iterator(); iter.hasNext(); ) { PatternSet ps = (PatternSet) iter.next(); f.additionalPatterns.add(ps.clone()); } return f; }
/** * Construct a new <code>Files</code> collection, shallowly cloned from the specified <code>Files * </code>. * * @param f the <code>Files</code> to use as a template. */ protected Files(Files f) { this.defaultPatterns = f.defaultPatterns; this.additionalPatterns = f.additionalPatterns; this.useDefaultExcludes = f.useDefaultExcludes; this.caseSensitive = f.caseSensitive; this.followSymlinks = f.followSymlinks; this.ds = f.ds; setProject(f.getProject()); }