Buggy code:
public class ReplaceRegExp extends Task { private boolean byline ; private File file ; private ArrayList filesets ; private String flags ; private RegularExpression regex ; private Substitution subs ; public ReplaceRegExp ( ) { } public void setByLine ( String byline ) { } public void setFile ( File file ) { } public void setFlags ( String flags ) { } public void setMatch ( String match ) throws TaskException { } public void setReplace ( String replace ) throws TaskException { } public void addFileset ( FileSet set ) { } public RegularExpression createRegularExpression ( ) throws TaskException { } public Substitution createSubstitution ( ) throws TaskException { } public void execute ( ) throws TaskException { if ( ( regex ) == null ) throw new TaskException ( "No<seq2seq4repair_space>expression<seq2seq4repair_space>to<seq2seq4repair_space>match." ) ; if ( ( subs ) == null ) throw new TaskException ( "Nothing<seq2seq4repair_space>to<seq2seq4repair_space>replace<seq2seq4repair_space>expression<seq2seq4repair_space>with." ) ; if ( ( ( file ) != null ) && ( ( filesets . size ( ) ) > 0 ) ) throw new TaskException ( "You<seq2seq4repair_space>cannot<seq2seq4repair_space>supply<seq2seq4repair_space>the<seq2seq4repair_space>'file'<seq2seq4repair_space>attribute<seq2seq4repair_space>and<seq2seq4repair_space>filesets<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>time." ) ; int options = 0 ; if ( ( flags . indexOf ( 'g' ) ) != ( - 1 ) ) options |= Regexp . REPLACE_ALL ; if ( ( flags . indexOf ( 'i' ) ) != ( - 1 ) ) options |= Regexp . MATCH_CASE_INSENSITIVE ; if ( ( flags . indexOf ( 'm' ) ) != ( - 1 ) ) options |= Regexp . MATCH_MULTILINE ; if ( ( flags . indexOf ( 's' ) ) != ( - 1 ) ) options |= Regexp . MATCH_SINGLELINE ; if ( ( ( file ) != null ) && ( file . exists ( ) ) ) { try { doReplace ( file , options ) ; } catch ( IOException e ) { final String message = ( ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>processing<seq2seq4repair_space>file:<seq2seq4repair_space>'" + ( file . getAbsolutePath ( ) ) ) + "':<seq2seq4repair_space>" ) + ( e . toString ( ) ) ; getLogger ( ) . error ( message , e ) ; } } else if ( ( file ) != null ) { final String message = ( "The<seq2seq4repair_space>following<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>missing:<seq2seq4repair_space>'" + ( file . getAbsolutePath ( ) ) ) + "'" ; getLogger ( ) . error ( message ) ; } int sz = filesets . size ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . get ( i ) ) ) ; <START_BUG> DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; <END_BUG> String [ ] files = ds . getIncludedFiles ( ) ; for ( int j = 0 ; j < ( files . length ) ; j ++ ) { File f = new File ( files [ j ] ) ; if ( f . exists ( ) ) { try { doReplace ( f , options ) ; } catch ( Exception e ) { final String message = ( ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>processing<seq2seq4repair_space>file:<seq2seq4repair_space>'" + ( f . getAbsolutePath ( ) ) ) + "':<seq2seq4repair_space>" ) + ( e . toString ( ) ) ; getLogger ( ) . error ( message ) ; } } else { final String message = ( "The<seq2seq4repair_space>following<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>missing:<seq2seq4repair_space>'" + ( file . getAbsolutePath ( ) ) ) + "'" ; getLogger ( ) . error ( message ) ; } } } } protected String doReplace ( RegularExpression r , Substitution s , String input , int options ) throws TaskException { } protected void doReplace ( File f , int options ) throws IOException , TaskException { } }

Fix:
DirectoryScanner ds = fs . getDirectoryScanner ( ) ;