Buggy code:
public class Checksum extends MatchingTask implements Condition { private File file = null ; private String algorithm = "MD5" ; private String provider = null ; private String fileext ; private String property ; private boolean forceOverwrite ; private String verifyProperty ; private Vector filesets = new Vector ( ) ; private Hashtable includeFileMap = new Hashtable ( ) ; private MessageDigest messageDigest ; private boolean isCondition ; public void setFile ( File file ) { } public void setAlgorithm ( String algorithm ) { } public void setProvider ( String provider ) { } public void setFileext ( String fileext ) { } public void setProperty ( String property ) { } public void setVerifyproperty ( String verifyProperty ) { } public void setForceOverwrite ( boolean forceOverwrite ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { } public boolean eval ( ) throws BuildException { } private boolean validateAndExecute ( ) throws BuildException { if ( ( ( file ) == null ) && ( ( filesets . size ( ) ) == 0 ) ) { throw new BuildException ( "Specify<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>source<seq2seq4repair_space>-<seq2seq4repair_space>a<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>fileset." ) ; } if ( ( ( ( file ) != null ) && ( file . exists ( ) ) ) && ( file . isDirectory ( ) ) ) { throw new BuildException ( "Checksum<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>generated<seq2seq4repair_space>for<seq2seq4repair_space>directories" ) ; } if ( ( ( property ) != null ) && ( ( fileext ) != null ) ) { throw new BuildException ( "Property<seq2seq4repair_space>and<seq2seq4repair_space>FileExt<seq2seq4repair_space>cannot<seq2seq4repair_space>co-exist." ) ; } if ( ( property ) != null ) { if ( forceOverwrite ) { throw new BuildException ( "ForceOverwrite<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>when<seq2seq4repair_space>Property<seq2seq4repair_space>is<seq2seq4repair_space>specified" ) ; } if ( ( file ) != null ) { if ( ( filesets . size ( ) ) > 0 ) { throw new BuildException ( "Multiple<seq2seq4repair_space>files<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>when<seq2seq4repair_space>Property<seq2seq4repair_space>is<seq2seq4repair_space>specified" ) ; } } else { if ( ( filesets . size ( ) ) > 1 ) { throw new BuildException ( "Multiple<seq2seq4repair_space>files<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>when<seq2seq4repair_space>Property<seq2seq4repair_space>is<seq2seq4repair_space>specified" ) ; } } } if ( ( verifyProperty ) != null ) { isCondition = true ; } if ( ( ( verifyProperty ) != null ) && ( forceOverwrite ) ) { throw new BuildException ( "VerifyProperty<seq2seq4repair_space>and<seq2seq4repair_space>ForceOverwrite<seq2seq4repair_space>cannot<seq2seq4repair_space>co-exist." ) ; } if ( ( isCondition ) && ( forceOverwrite ) ) { throw new BuildException ( "ForceOverwrite<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>when<seq2seq4repair_space>conditions<seq2seq4repair_space>are<seq2seq4repair_space>being<seq2seq4repair_space>used." ) ; } if ( ( fileext ) == null ) { fileext = "." + ( algorithm ) ; } else if ( ( fileext . trim ( ) . length ( ) ) == 0 ) { throw new BuildException ( "File<seq2seq4repair_space>extension<seq2seq4repair_space>when<seq2seq4repair_space>specified<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>empty<seq2seq4repair_space>string" ) ; } messageDigest = null ; if ( ( provider ) != null ) { try { messageDigest = MessageDigest . getInstance ( algorithm , provider ) ; } catch ( NoSuchAlgorithmException noalgo ) { throw new BuildException ( noalgo , location ) ; } catch ( NoSuchProviderException noprovider ) { throw new BuildException ( noprovider , location ) ; } } else { try { messageDigest = MessageDigest . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException noalgo ) { throw new BuildException ( noalgo , location ) ; } } if ( ( messageDigest ) == null ) { throw new BuildException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>Message<seq2seq4repair_space>Digest" , location ) ; } addToIncludeFileMap ( file ) ; int sizeofFileSet = filesets . size ( ) ; for ( int i = 0 ; i < sizeofFileSet ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; DirectoryScanner ds = fs . getDirectoryScanner ( project ) ; String [ ] srcFiles = ds . getIncludedFiles ( ) ; for ( int j = 0 ; j < ( srcFiles . length ) ; j ++ ) { <START_BUG> File src = new File ( srcFiles [ j ] ) ; <END_BUG> addToIncludeFileMap ( src ) ; } } return generateChecksums ( ) ; } private void addToIncludeFileMap ( File file ) throws BuildException { } private boolean generateChecksums ( ) throws BuildException { } }

Fix:
File src = new File ( fs . getDir ( project ) , srcFiles [ j ] ) ;