Buggy code:
public class ExecuteOn extends ExecTask { protected Vector filesets = new Vector ( ) ; private boolean parallel = false ; protected String type = "file" ; protected Marker srcFilePos = null ; private boolean skipEmpty = false ; protected Marker targetFilePos = null ; protected Mapper mapperElement = null ; protected FileNameMapper mapper = null ; protected File destDir = null ; protected boolean srcIsFirst = true ; public void addFileset ( FileSet set ) { } public void setParallel ( boolean parallel ) { } public void setType ( ExecuteOn . FileDirBoth type ) { } public void setSkipEmptyFilesets ( boolean skip ) { } public void setDest ( File destDir ) { } public Marker createSrcfile ( ) { } public Marker createTargetfile ( ) { } public Mapper createMapper ( ) throws BuildException { } protected void checkConfiguration ( ) { } protected void runExec ( Execute exe ) throws BuildException { try { Vector fileNames = new Vector ( ) ; Vector baseDirs = new Vector ( ) ; for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; File base = fs . getDir ( project ) ; DirectoryScanner ds = fs . getDirectoryScanner ( project ) ; if ( ! ( "dir" . equals ( type ) ) ) { String [ ] s = getFiles ( base , ds ) ; for ( int j = 0 ; j < ( s . length ) ; j ++ ) { fileNames . addElement ( s [ j ] ) ; baseDirs . addElement ( base ) ; } } if ( ! ( "file" . equals ( type ) ) ) { String [ ] s = getDirs ( base , ds ) ; for ( int j = 0 ; j < ( s . length ) ; j ++ ) { fileNames . addElement ( s [ j ] ) ; baseDirs . addElement ( base ) ; } } if ( ( ( fileNames . size ( ) ) == 0 ) && ( skipEmpty ) ) { log ( ( ( "Skipping<seq2seq4repair_space>fileset<seq2seq4repair_space>for<seq2seq4repair_space>directory<seq2seq4repair_space>" + base ) + ".<seq2seq4repair_space>It<seq2seq4repair_space>is<seq2seq4repair_space>empty." ) , MSG_INFO ) ; continue ; } if ( ! ( parallel ) ) { String [ ] s = new String [ fileNames . size ( ) ] ; fileNames . copyInto ( s ) ; for ( int j = 0 ; j < ( s . length ) ; j ++ ) { String [ ] command = getCommandline ( s [ j ] , base ) ; log ( ( "Executing<seq2seq4repair_space>" + ( Commandline . toString ( command ) ) ) , MSG_VERBOSE ) ; exe . setCommandline ( command ) ; runExecute ( exe ) ; } fileNames . removeAllElements ( ) ; baseDirs . removeAllElements ( ) ; } } <START_BUG> if ( parallel ) { <END_BUG> String [ ] s = new String [ fileNames . size ( ) ] ; fileNames . copyInto ( s ) ; File [ ] b = new File [ baseDirs . size ( ) ] ; baseDirs . copyInto ( b ) ; String [ ] command = getCommandline ( s , b ) ; log ( ( "Executing<seq2seq4repair_space>" + ( Commandline . toString ( command ) ) ) , MSG_VERBOSE ) ; exe . setCommandline ( command ) ; runExecute ( exe ) ; } } catch ( IOException e ) { throw new BuildException ( ( "Execute<seq2seq4repair_space>failed:<seq2seq4repair_space>" + e ) , e , location ) ; } finally { logFlush ( ) ; } } protected String [ ] getCommandline ( String [ ] srcFiles , File [ ] baseDirs ) { } protected String [ ] getCommandline ( String srcFile , File baseDir ) { } protected String [ ] getFiles ( File baseDir , DirectoryScanner ds ) { } protected String [ ] getDirs ( File baseDir , DirectoryScanner ds ) { } public static class FileDirBoth extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
if ( ( parallel ) && ( ( ( fileNames . size ( ) ) > 0 ) || ( ! ( skipEmpty ) ) ) ) {