Program: 100701
Project: 100701
Buggy source:
/** 
 * Write result files.
 * @throws DITAOTException if writing result files failed
 */
private void outputResult() throws DITAOTException {
  if (!job.tempDir.exists()) {
    job.tempDir.mkdirs();
  }
  final File relativeRootFile=getRelativePath(new File(baseInputDir,"String_Node_Str"),rootFile);
  job.setProperty(INPUT_DIR,baseInputDir.getAbsolutePath());
  job.setProperty(INPUT_DITAMAP,relativeRootFile.toString());
  job.setProperty(INPUT_DITAMAP_LIST_FILE_LIST,USER_INPUT_FILE_LIST_FILE);
  final File inputfile=new File(job.tempDir,USER_INPUT_FILE_LIST_FILE);
  Writer bufferedWriter=null;
  try {
    bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)));
    bufferedWriter.write(relativeRootFile.toString());
    bufferedWriter.flush();
  }
 catch (  final FileNotFoundException e) {
    logger.error(e.getMessage(),e);
  }
catch (  final IOException e) {
    logger.error(e.getMessage(),e);
  }
 finally {
    if (bufferedWriter != null) {
      try {
        bufferedWriter.close();
      }
 catch (      final IOException e) {
        logger.error(e.getMessage(),e);
      }
    }
  }
  job.setProperty("String_Node_Str",escapeRegExp(prefix));
  job.setProperty("String_Node_Str",getLevelsPath());
  for (  final URI file : addFilePrefix(outDitaFilesSet)) {
    job.getOrCreateFileInfo(file).isOutDita=true;
  }
  for (  final URI file : addFilePrefix(fullTopicSet)) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format=ATTR_FORMAT_VALUE_DITA;
  }
  for (  final URI file : addFilePrefix(fullMapSet)) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format=ATTR_FORMAT_VALUE_DITAMAP;
  }
  for (  final URI file : addFilePrefix(hrefTopicSet)) {
    job.getOrCreateFileInfo(file).hasLink=true;
  }
  for (  final URI file : addFilePrefix(conrefSet)) {
    job.getOrCreateFileInfo(file).hasConref=true;
  }
  for (  final URI file : addFilePrefix(imageSet)) {
    job.getOrCreateFileInfo(file).format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(flagImageSet)) {
    final FileInfo f=job.getOrCreateFileInfo(file);
    f.isFlagImage=true;
    f.format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(htmlSet)) {
    job.getOrCreateFileInfo(file).format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(hrefTargetSet)) {
    job.getOrCreateFileInfo(file).isTarget=true;
  }
  for (  final URI file : addFilePrefix(hrefWithIDSet)) {
    job.getOrCreateFileInfo(file).isNonConrefTarget=true;
  }
  for (  final URI file : addFilePrefix(chunkTopicSet)) {
    job.getOrCreateFileInfo(file).isSkipChunk=true;
  }
  for (  final URI file : addFilePrefix(schemeSet)) {
    job.getOrCreateFileInfo(file).isSubjectScheme=true;
  }
  for (  final URI file : addFilePrefix(conrefTargetSet)) {
    job.getOrCreateFileInfo(file).isConrefTarget=true;
  }
  for (  final URI file : addFilePrefix(copytoSourceSet)) {
    job.getOrCreateFileInfo(file).isCopyToSource=true;
  }
  for (  final URI file : addFilePrefix(subsidiarySet)) {
    job.getOrCreateFileInfo(file).isSubtarget=true;
  }
  for (  final URI file : addFilePrefix(conrefpushSet)) {
    job.getOrCreateFileInfo(file).isConrefPush=true;
  }
  for (  final URI file : addFilePrefix(keyrefSet)) {
    job.getOrCreateFileInfo(file).hasKeyref=true;
  }
  for (  final URI file : addFilePrefix(coderefSet)) {
    job.getOrCreateFileInfo(file).hasCoderef=true;
  }
  for (  final URI file : addFilePrefix(resourceOnlySet)) {
    job.getOrCreateFileInfo(file).isResourceOnly=true;
  }
  addFlagImagesSetToProperties(job,relFlagImagesSet);
  job.setCopytoMap(addFilePrefix(copytoMap));
  addKeyDefSetToProperties(job,keysDefMap);
  try {
    logger.info("String_Node_Str");
    job.write();
  }
 catch (  final IOException e) {
    throw new DITAOTException("String_Node_Str" + e.getMessage(),e);
  }
  try {
    SubjectSchemeReader.writeMapToXML(addMapFilePrefix(listFilter.getRelationshipGrap()),new File(job.tempDir,FILE_NAME_SUBJECT_RELATION));
    SubjectSchemeReader.writeMapToXML(addMapFilePrefix(schemeDictionary),new File(job.tempDir,FILE_NAME_SUBJECT_DICTIONARY));
  }
 catch (  final IOException e) {
    throw new DITAOTException(e);
  }
  writeExportAnchors();
  KeyDef.writeKeydef(new File(job.tempDir,SUBJECT_SCHEME_KEYDEF_LIST_FILE),addFilePrefix(schemekeydefMap.values()));
}

Fixed version (ground truth):
/** 
 * Write result files.
 * @throws DITAOTException if writing result files failed
 */
private void outputResult() throws DITAOTException {
  if (!job.tempDir.exists()) {
    job.tempDir.mkdirs();
  }
  final File relativeRootFile=getRelativePath(new File(baseInputDir,"String_Node_Str"),new File(rootFile));
  job.setProperty(INPUT_DIR,baseInputDir.getAbsolutePath());
  job.setProperty(INPUT_DITAMAP,relativeRootFile.toString());
  job.setProperty(INPUT_DITAMAP_LIST_FILE_LIST,USER_INPUT_FILE_LIST_FILE);
  final File inputfile=new File(job.tempDir,USER_INPUT_FILE_LIST_FILE);
  Writer bufferedWriter=null;
  try {
    bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)));
    bufferedWriter.write(relativeRootFile.toString());
    bufferedWriter.flush();
  }
 catch (  final FileNotFoundException e) {
    logger.error(e.getMessage(),e);
  }
catch (  final IOException e) {
    logger.error(e.getMessage(),e);
  }
 finally {
    if (bufferedWriter != null) {
      try {
        bufferedWriter.close();
      }
 catch (      final IOException e) {
        logger.error(e.getMessage(),e);
      }
    }
  }
  job.setProperty("String_Node_Str",escapeRegExp(prefix));
  job.setProperty("String_Node_Str",getLevelsPath());
  for (  final URI file : addFilePrefix(outDitaFilesSet)) {
    job.getOrCreateFileInfo(file).isOutDita=true;
  }
  for (  final URI file : addFilePrefix(fullTopicSet)) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format=ATTR_FORMAT_VALUE_DITA;
  }
  for (  final URI file : addFilePrefix(fullMapSet)) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format=ATTR_FORMAT_VALUE_DITAMAP;
  }
  for (  final URI file : addFilePrefix(hrefTopicSet)) {
    job.getOrCreateFileInfo(file).hasLink=true;
  }
  for (  final URI file : addFilePrefix(conrefSet)) {
    job.getOrCreateFileInfo(file).hasConref=true;
  }
  for (  final URI file : addFilePrefix(imageSet)) {
    job.getOrCreateFileInfo(file).format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(flagImageSet)) {
    final FileInfo f=job.getOrCreateFileInfo(file);
    f.isFlagImage=true;
    f.format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(htmlSet)) {
    job.getOrCreateFileInfo(file).format="String_Node_Str";
  }
  for (  final URI file : addFilePrefix(hrefTargetSet)) {
    job.getOrCreateFileInfo(file).isTarget=true;
  }
  for (  final URI file : addFilePrefix(hrefWithIDSet)) {
    job.getOrCreateFileInfo(file).isNonConrefTarget=true;
  }
  for (  final URI file : addFilePrefix(chunkTopicSet)) {
    job.getOrCreateFileInfo(file).isSkipChunk=true;
  }
  for (  final URI file : addFilePrefix(schemeSet)) {
    job.getOrCreateFileInfo(file).isSubjectScheme=true;
  }
  for (  final URI file : addFilePrefix(conrefTargetSet)) {
    job.getOrCreateFileInfo(file).isConrefTarget=true;
  }
  for (  final URI file : addFilePrefix(copytoSourceSet)) {
    job.getOrCreateFileInfo(file).isCopyToSource=true;
  }
  for (  final URI file : addFilePrefix(subsidiarySet)) {
    job.getOrCreateFileInfo(file).isSubtarget=true;
  }
  for (  final URI file : addFilePrefix(conrefpushSet)) {
    job.getOrCreateFileInfo(file).isConrefPush=true;
  }
  for (  final URI file : addFilePrefix(keyrefSet)) {
    job.getOrCreateFileInfo(file).hasKeyref=true;
  }
  for (  final URI file : addFilePrefix(coderefSet)) {
    job.getOrCreateFileInfo(file).hasCoderef=true;
  }
  for (  final URI file : addFilePrefix(resourceOnlySet)) {
    job.getOrCreateFileInfo(file).isResourceOnly=true;
  }
  addFlagImagesSetToProperties(job,relFlagImagesSet);
  job.setCopytoMap(addFilePrefix(copytoMap));
  addKeyDefSetToProperties(job,keysDefMap);
  try {
    logger.info("String_Node_Str");
    job.write();
  }
 catch (  final IOException e) {
    throw new DITAOTException("String_Node_Str" + e.getMessage(),e);
  }
  try {
    SubjectSchemeReader.writeMapToXML(addMapFilePrefix(listFilter.getRelationshipGrap()),new File(job.tempDir,FILE_NAME_SUBJECT_RELATION));
    SubjectSchemeReader.writeMapToXML(addMapFilePrefix(schemeDictionary),new File(job.tempDir,FILE_NAME_SUBJECT_DICTIONARY));
  }
 catch (  final IOException e) {
    throw new DITAOTException(e);
  }
  writeExportAnchors();
  KeyDef.writeKeydef(new File(job.tempDir,SUBJECT_SCHEME_KEYDEF_LIST_FILE),addFilePrefix(schemekeydefMap.values()));
}