Buggy code:
public void setPackagenames ( String src ) { } public void setPrivate ( boolean b ) { } public void setProtected ( boolean b ) { } public void setPublic ( boolean b ) { } public void setSerialwarn ( boolean b ) { } public void setSourcefiles ( String src ) throws TaskException { } public void setSourcepath ( Path src ) throws TaskException { } public void setSourcepathRef ( Reference r ) throws TaskException { } public void setSplitindex ( boolean b ) { } public void setStylesheetfile ( File f ) { } public void setUse ( boolean b ) { } public void setUseExternalFile ( boolean b ) { } public void setVerbose ( boolean b ) { } public void setVersion ( boolean src ) { } public void setWindowtitle ( String src ) { } public void addBottom ( Html text ) { } public void addDoctitle ( Html text ) { } public void addExcludePackage ( PackageName pn ) { } public void addFooter ( Html text ) { } public void addHeader ( Html text ) { } public void addPackage ( PackageName pn ) { } public void addSource ( SourceFile sf ) throws TaskException { } public Path createBootclasspath ( ) throws TaskException { } public Path createClasspath ( ) throws TaskException { } public DocletInfo createDoclet ( ) { } public GroupArgument createGroup ( ) { } public LinkArgument createLink ( ) { } public Path createSourcepath ( ) throws TaskException { } public void execute ( ) throws TaskException { } private String getJavadocExecutableName ( ) { } private void add12ArgIfNotEmpty ( String key , String value ) { } private void addArgIf ( boolean b , String arg ) { } private void evaluatePackages ( Commandline toExecute , Path sourcePath , ArrayList packages , ArrayList excludePackages ) throws TaskException { getLogger ( ) . debug ( ( "Source<seq2seq4repair_space>path<seq2seq4repair_space>=<seq2seq4repair_space>" + ( sourcePath . toString ( ) ) ) ) ; StringBuffer msg = new StringBuffer ( "Packages<seq2seq4repair_space>=<seq2seq4repair_space>" ) ; for ( int i = 0 ; i < ( packages . size ( ) ) ; i ++ ) { if ( i > 0 ) { msg . append ( "," ) ; } msg . append ( packages . get ( i ) ) ; } getLogger ( ) . debug ( msg . toString ( ) ) ; msg . setLength ( 0 ) ; msg . append ( "Exclude<seq2seq4repair_space>Packages<seq2seq4repair_space>=<seq2seq4repair_space>" ) ; for ( int i = 0 ; i < ( excludePackages . size ( ) ) ; i ++ ) { if ( i > 0 ) { msg . append ( "," ) ; } msg . append ( excludePackages . get ( i ) ) ; } getLogger ( ) . debug ( msg . toString ( ) ) ; ArrayList addedPackages = new ArrayList ( ) ; String [ ] list = sourcePath . list ( ) ; if ( list == null ) list = new String [ 0 ] ; FileSet fs = new FileSet ( ) ; fs . setDefaultexcludes ( m_useDefaultExcludes ) ; Iterator e = packages . iterator ( ) ; while ( e . hasNext ( ) ) { String pkg = ( ( String ) ( e . next ( ) ) ) ; pkg = pkg . replace ( '.' , '//' ) ; if ( pkg . endsWith ( "*" ) ) { pkg += "*" ; } fs . createInclude ( ) . setName ( pkg ) ; } e = excludePackages . iterator ( ) ; while ( e . hasNext ( ) ) { String pkg = ( ( String ) ( e . next ( ) ) ) ; pkg = pkg . replace ( '.' , '//' ) ; if ( pkg . endsWith ( "*" ) ) { pkg += "*" ; } fs . createExclude ( ) . setName ( pkg ) ; } PrintWriter packageListWriter = null ; try { if ( m_useExternalFile ) { m_tmpList = File . createTempFile ( "javadoc" , "" , getBaseDirectory ( ) ) ; toExecute . createArgument ( ) . setValue ( ( "@" + ( m_tmpList . getAbsolutePath ( ) ) ) ) ; packageListWriter = new PrintWriter ( new FileWriter ( m_tmpList ) ) ; } for ( int j = 0 ; j < ( list . length ) ; j ++ ) { final File source = resolveFile ( list [ j ] ) ; fs . setDir ( source ) ; <START_BUG> final DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; <END_BUG> final String [ ] packageDirs = ds . getIncludedDirectories ( ) ; for ( int i = 0 ; i < ( packageDirs . length ) ; i ++ ) { File pd = new File ( source , packageDirs [ i ] ) ; String [ ] files = pd . list ( new FilenameFilter ( ) { public boolean accept ( File dir1 , String name ) { if ( name . endsWith ( ".java" ) ) { return true ; } return false ; } } ) ; if ( ( files . length ) > 0 ) { String pkgDir = packageDirs [ i ] . replace ( '//' , '.' ) . replace ( '\\' , '.' ) ; if ( ! ( addedPackages . contains ( pkgDir ) ) ) { if ( m_useExternalFile ) { packageListWriter . println ( pkgDir ) ; } else { toExecute . createArgument ( ) . setValue ( pkgDir ) ; } addedPackages . add ( pkgDir ) ; } } } } } catch ( IOException ioex ) { throw new TaskException ( "Error<seq2seq4repair_space>creating<seq2seq4repair_space>temporary<seq2seq4repair_space>file" , ioex ) ; } finally { if ( packageListWriter != null ) { packageListWriter . close ( ) ; } } } }

Fix:
final DirectoryScanner ds = fs . getDirectoryScanner ( ) ;