Buggy code:
public abstract class AbstractFileSet extends DataType implements Cloneable , SelectorContainer { private PatternSet defaultPatterns = new PatternSet ( ) ; private Vector additionalPatterns = new Vector ( ) ; private Vector selectors = new Vector ( ) ; private File dir ; private boolean useDefaultExcludes = true ; private boolean caseSensitive = true ; private boolean followSymlinks = true ; private DirectoryScanner directoryScanner = null ; public AbstractFileSet ( ) { } protected AbstractFileSet ( AbstractFileSet fileset ) { } public void setRefid ( Reference r ) throws BuildException { } public synchronized void setDir ( File dir ) throws BuildException { } public File getDir ( ) { } public synchronized File getDir ( Project p ) { } public synchronized PatternSet createPatternSet ( ) { } public synchronized NameEntry createInclude ( ) { } public synchronized NameEntry createIncludesFile ( ) { } public synchronized NameEntry createExclude ( ) { } public synchronized NameEntry createExcludesFile ( ) { } public synchronized void setFile ( File file ) { } public synchronized void setIncludes ( String includes ) { } public synchronized void appendIncludes ( String [ ] includes ) { } public synchronized void setExcludes ( String excludes ) { } public synchronized void appendExcludes ( String [ ] excludes ) { } public synchronized void setIncludesfile ( File incl ) throws BuildException { } public synchronized void setExcludesfile ( File excl ) throws BuildException { } public synchronized void setDefaultexcludes ( boolean useDefaultExcludes ) { } public synchronized boolean getDefaultexcludes ( ) { } public synchronized void setCaseSensitive ( boolean caseSensitive ) { } public synchronized boolean isCaseSensitive ( ) { } public synchronized void setFollowSymlinks ( boolean followSymlinks ) { } public synchronized boolean isFollowSymlinks ( ) { } protected String getDataTypeName ( ) { } public DirectoryScanner getDirectoryScanner ( ) { } public DirectoryScanner getDirectoryScanner ( Project p ) { } public void setupDirectoryScanner ( FileScanner ds ) { } public synchronized void setupDirectoryScanner ( FileScanner ds , Project p ) { } protected AbstractFileSet getRef ( Project p ) { } public synchronized boolean hasSelectors ( ) { } public synchronized boolean hasPatterns ( ) { } public synchronized int selectorCount ( ) { } public synchronized FileSelector [ ] getSelectors ( Project p ) { } public synchronized Enumeration selectorElements ( ) { } public synchronized void appendSelector ( FileSelector selector ) { } public void addSelector ( SelectSelector selector ) { } public void addAnd ( AndSelector selector ) { } public void addOr ( OrSelector selector ) { } public void addNot ( NotSelector selector ) { } public void addNone ( NoneSelector selector ) { } public void addMajority ( MajoritySelector selector ) { } public void addDate ( DateSelector selector ) { } public void addSize ( SizeSelector selector ) { } public void addDifferent ( DifferentSelector selector ) { } public void addFilename ( FilenameSelector selector ) { } public void addType ( TypeSelector selector ) { } public void addCustom ( ExtendSelector selector ) { } public void addContains ( ContainsSelector selector ) { } public void addPresent ( PresentSelector selector ) { } public void addDepth ( DepthSelector selector ) { } public void addDepend ( DependSelector selector ) { } public void addContainsRegexp ( ContainsRegexpSelector selector ) { } public void addModified ( ModifiedSelector selector ) { } public void add ( FileSelector selector ) { } public String toString ( ) { } public synchronized Object clone ( ) { if ( isReference ( ) ) { return getRef ( getProject ( ) ) . clone ( ) ; } else { try { AbstractFileSet fs = ( ( AbstractFileSet ) ( super . clone ( ) ) ) ; fs . defaultPatterns = ( ( PatternSet ) ( defaultPatterns . clone ( ) ) ) ; fs . additionalPatterns = new Vector ( additionalPatterns . size ( ) ) ; Enumeration e = additionalPatterns . elements ( ) ; while ( e . hasMoreElements ( ) ) { fs . additionalPatterns . addElement ( ( ( PatternSet ) ( e . nextElement ( ) ) ) . clone ( ) ) ; } <START_BUG> fs . selectors = ( ( Vector ) ( fs . selectors . clone ( ) ) ) ; <END_BUG> return fs ; } catch ( CloneNotSupportedException e ) { throw new BuildException ( e ) ; } } } public String [ ] mergeIncludes ( Project p ) { } public String [ ] mergeExcludes ( Project p ) { } public synchronized PatternSet mergePatterns ( Project p ) { } }

Fix:
fs . selectors = new Vector ( selectors ) ;