Buggy code:
public class DriftDetector implements Runnable { private Log log = LogFactory . getLog ( DriftDetector . class ) ; static final String FILE_CHANGESET_FULL = "changeset.txt" ; static final String FILE_CHANGESET_DELTA = "drift-changeset.txt" ; static final String FILE_SNAPSHOT_PINNED = "snapshot.pinned" ; private ScheduleQueue scheduleQueue ; private ChangeSetManager changeSetMgr ; private MessageDigestGenerator digestGenerator = new MessageDigestGenerator ( MessageDigestGenerator . SHA_256 ) ; private DriftClient driftClient ; public void setScheduleQueue ( ScheduleQueue queue ) { } public void setChangeSetManager ( ChangeSetManager changeSetManager ) { } public void setDriftClient ( DriftClient driftClient ) { } @ Override public void run ( ) { } private boolean changesNeedToBeReported ( DriftDetectionSummary detectionSummary ) { } private boolean previousSnapshotExists ( DriftDetectionSchedule schedule ) { } private void generateDriftChangeSet ( DriftDetectionSummary summary ) throws IOException { } private FileEntry getAddedFileEntry ( File basedir , File file ) throws IOException { FileEntry result = null ; try { String sha256 = sha256 ( file ) ; String relativePath = relativePath ( basedir , file ) ; long lastModified = file . lastModified ( ) ; long length = file . length ( ) ; <START_BUG> result = addedFileEntry ( relativePath ( basedir , file ) , sha256 ( file ) , file . lastModified ( ) , file . length ( ) ) ; <END_BUG> } catch ( FileNotFoundException e ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ( ( "Skipping<seq2seq4repair_space>" + ( file . getPath ( ) ) ) + "<seq2seq4repair_space>since<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>missing<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>physically<seq2seq4repair_space>readable<seq2seq4repair_space>file." ) ) ; } } return result ; } private static void safeClear ( Collection < ? > ... collections ) { } private Set < File > getScanDirectories ( final File basedir , List < Filter > includes ) { } private boolean scanSnapshot ( DriftDetectionSchedule schedule , File basedir , ChangeSetReader snapshotReader , Set < File > newFiles , List < FileEntry > unchangedEntries , List < FileEntry > changedEntries , List < FileEntry > removedEntries , List < FileEntry > changedPinnedEntries ) throws IOException { } private boolean isPreviousChangeSetEmpty ( int resourceId , DriftDefinition definition ) throws IOException { } private void updateDeltaSnapshot ( DriftDetectionSummary summary , DriftDetectionSchedule schedule , List < FileEntry > deltaEntries , int newVersion , File oldSnapshot , File newSnapshot ) throws IOException { } private File backupAndDeleteCurrentSnapshot ( File currentSnapshot ) throws IOException { } private File updateCurrentSnapshot ( DriftDetectionSchedule schedule , List < FileEntry > snapshotEntries , int newVersion ) throws IOException { } private File updatePinnedSnapshot ( DriftDetectionSchedule schedule , File pinnedSnapshot , List < FileEntry > snapshotEntries ) throws IOException { } private boolean isSameAsPreviousChangeSet ( List < FileEntry > entries , File currentSnapsotFile ) throws IOException { } private void generateSnapshot ( DriftDetectionSummary summary ) throws IOException { } private void doDirectoryScan ( final DriftDetectionSchedule schedule , DriftDefinition driftDef , final File basedir , final ChangeSetWriter writer ) { } private String relativePath ( File basedir , File file ) { } private String sha256 ( File file ) throws IOException { } private String basedir ( int resourceId , DriftDefinition driftDef ) { } private Headers createHeaders ( DriftDetectionSchedule schedule , DriftChangeSetCategory type , int version ) { } private void revertSnapshot ( DriftDetectionSummary summary ) throws IOException { } private void deleteZipFiles ( File dir ) { } No newline ; at end ; of file ; }

Fix:
result = addedFileEntry ( relativePath , sha256 , lastModified , length ) ;