Program: 100778
Project: 100778
Buggy source:
private void updateList(final Map<String,String> changeTable,final Hashtable<String,String> conflictTable,final AbstractPipelineInput input){
  final File tempDir=new File(input.getAttribute(ANT_INVOKER_PARAM_TEMPDIR));
  if (!tempDir.isAbsolute()) {
    throw new IllegalArgumentException("String_Node_Str" + tempDir + "String_Node_Str");
  }
  final File xmlDitalist=new File(tempDir,"String_Node_Str");
  Job job=null;
  try {
    job=new Job(tempDir);
  }
 catch (  final IOException ex) {
    logger.logError(ex.getMessage(),ex);
  }
  final Set<String> hrefTopics=job.getSet(HREF_TOPIC_LIST);
  final Set<String> chunkTopics=job.getSet(CHUNK_TOPIC_LIST);
  for (  final String s : chunkTopics) {
    if (!StringUtils.isEmptyString(s) && getFragment(s) == null) {
      final Iterator<String> hrefit=hrefTopics.iterator();
      while (hrefit.hasNext()) {
        final String ent=hrefit.next();
        if (FileUtils.resolveFile(tempDir.getAbsolutePath(),ent).equalsIgnoreCase(FileUtils.resolveFile(tempDir.getAbsolutePath(),s))) {
          hrefit.remove();
        }
      }
    }
 else     if (!StringUtils.isEmptyString(s) && hrefTopics.contains(s)) {
      hrefTopics.remove(s);
    }
  }
  final Set<String> topicList=new LinkedHashSet<String>(INT_128);
  final Set<String> oldTopicList=job.getSet(FULL_DITA_TOPIC_LIST);
  for (  String t : hrefTopics) {
    if (t.lastIndexOf(SHARP) != -1) {
      t=t.substring(0,t.lastIndexOf(SHARP));
    }
    t=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),FileUtils.resolveFile(tempDir.getAbsolutePath(),t));
    topicList.add(t);
    if (oldTopicList.contains(t)) {
      oldTopicList.remove(t);
    }
  }
  final Set<String> chunkedTopicSet=new LinkedHashSet<String>(INT_128);
  final Set<String> chunkedDitamapSet=new LinkedHashSet<String>(INT_128);
  final Set<String> ditamapList=job.getSet(FULL_DITAMAP_LIST);
  for (  final Map.Entry<String,String> entry : changeTable.entrySet()) {
    final String oldFile=entry.getKey();
    if (entry.getValue().equals(oldFile)) {
      String newChunkedFile=entry.getValue();
      newChunkedFile=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),newChunkedFile);
      final String extName=FileUtils.getExtension(newChunkedFile);
      if (extName != null && !extName.equalsIgnoreCase("String_Node_Str")) {
        chunkedTopicSet.add(newChunkedFile);
        if (!topicList.contains(newChunkedFile)) {
          topicList.add(newChunkedFile);
          if (oldTopicList.contains(newChunkedFile)) {
            oldTopicList.remove(newChunkedFile);
          }
        }
      }
 else {
        if (!ditamapList.contains(newChunkedFile)) {
          ditamapList.add(newChunkedFile);
          if (oldTopicList.contains(newChunkedFile)) {
            oldTopicList.remove(newChunkedFile);
          }
        }
        chunkedDitamapSet.add(newChunkedFile);
      }
    }
  }
  for (  final String s : oldTopicList) {
    if (!StringUtils.isEmptyString(s)) {
      final File f=new File(tempDir,s);
      if (f.exists()) {
        f.delete();
      }
    }
  }
  for (  final Map.Entry<String,String> entry : changeTable.entrySet()) {
    final String oldFile=entry.getKey();
    if (entry.getValue().equals(oldFile)) {
      final String targetPath=conflictTable.get(entry.getKey());
      if (targetPath != null) {
        final File target=new File(targetPath);
        if (!FileUtils.fileExists(target.getAbsolutePath())) {
          final File from=new File(entry.getValue());
          String relativePath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),from.getAbsolutePath());
          final String relativeTargetPath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),target.getAbsolutePath());
          if (relativeTargetPath.lastIndexOf(SLASH) != -1) {
            relativePath2fix.put(relativeTargetPath,relativeTargetPath.substring(0,relativeTargetPath.lastIndexOf(SLASH) + 1));
          }
          target.delete();
          from.renameTo(target);
          if (topicList.contains(relativePath)) {
            topicList.remove(relativePath);
          }
          if (chunkedTopicSet.contains(relativePath)) {
            chunkedTopicSet.remove(relativePath);
          }
          relativePath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),target.getAbsolutePath());
          topicList.add(relativePath);
          chunkedTopicSet.add(relativePath);
        }
 else {
          conflictTable.remove(entry.getKey());
        }
      }
    }
  }
  for (  final String file : chunkedTopicSet) {
    job.getOrCreateFileInfo(file).isResourceOnly=false;
  }
  for (  final String file : chunkedDitamapSet) {
    job.getOrCreateFileInfo(file).isResourceOnly=false;
  }
  for (  FileInfo f : job.getFileInfo().values()) {
    if ("String_Node_Str".equals(f.format) || "String_Node_Str".equals(f.format)) {
      f.isActive=false;
    }
  }
  for (  final String file : topicList) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format="String_Node_Str";
    ff.isActive=true;
  }
  for (  final String file : ditamapList) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format="String_Node_Str";
    ff.isActive=true;
  }
  job.setProperty("String_Node_Str",CHUNKED_DITAMAP_LIST_FILE);
  job.setProperty("String_Node_Str",CHUNKED_TOPIC_LIST_FILE);
  job.setProperty("String_Node_Str",RESOURCE_ONLY_LIST_FILE);
  for (  final String file : chunkedDitamapSet) {
    job.getOrCreateFileInfo(file).isChunkedDitaMap=true;
  }
  for (  final String file : chunkedDitamapSet) {
    job.getOrCreateFileInfo(file).isChunked=true;
  }
  try {
    job.write();
  }
 catch (  final IOException ex) {
    logger.logError(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
private void updateList(final Map<String,String> changeTable,final Hashtable<String,String> conflictTable,final AbstractPipelineInput input){
  final File tempDir=new File(input.getAttribute(ANT_INVOKER_PARAM_TEMPDIR));
  if (!tempDir.isAbsolute()) {
    throw new IllegalArgumentException("String_Node_Str" + tempDir + "String_Node_Str");
  }
  final File xmlDitalist=new File(tempDir,"String_Node_Str");
  Job job=null;
  try {
    job=new Job(tempDir);
  }
 catch (  final IOException ex) {
    logger.logError(ex.getMessage(),ex);
  }
  final Set<String> hrefTopics=job.getSet(HREF_TOPIC_LIST);
  final Set<String> chunkTopics=job.getSet(CHUNK_TOPIC_LIST);
  for (  final String s : chunkTopics) {
    if (!StringUtils.isEmptyString(s) && getFragment(s) == null) {
      final Iterator<String> hrefit=hrefTopics.iterator();
      while (hrefit.hasNext()) {
        final String ent=hrefit.next();
        if (FileUtils.resolveFile(tempDir.getAbsolutePath(),ent).equalsIgnoreCase(FileUtils.resolveFile(tempDir.getAbsolutePath(),s))) {
          hrefit.remove();
        }
      }
    }
 else     if (!StringUtils.isEmptyString(s) && hrefTopics.contains(s)) {
      hrefTopics.remove(s);
    }
  }
  final Set<String> topicList=new LinkedHashSet<String>(INT_128);
  final Set<String> oldTopicList=job.getSet(FULL_DITA_TOPIC_LIST);
  for (  String t : hrefTopics) {
    if (t.lastIndexOf(SHARP) != -1) {
      t=t.substring(0,t.lastIndexOf(SHARP));
    }
    t=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),FileUtils.resolveFile(tempDir.getAbsolutePath(),t));
    topicList.add(t);
    if (oldTopicList.contains(t)) {
      oldTopicList.remove(t);
    }
  }
  final Set<String> chunkedTopicSet=new LinkedHashSet<String>(INT_128);
  final Set<String> chunkedDitamapSet=new LinkedHashSet<String>(INT_128);
  final Set<String> ditamapList=job.getSet(FULL_DITAMAP_LIST);
  for (  final Map.Entry<String,String> entry : changeTable.entrySet()) {
    final String oldFile=entry.getKey();
    if (entry.getValue().equals(oldFile)) {
      String newChunkedFile=entry.getValue();
      newChunkedFile=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),newChunkedFile);
      final String extName=FileUtils.getExtension(newChunkedFile);
      if (extName != null && !extName.equalsIgnoreCase("String_Node_Str")) {
        chunkedTopicSet.add(newChunkedFile);
        if (!topicList.contains(newChunkedFile)) {
          topicList.add(newChunkedFile);
          if (oldTopicList.contains(newChunkedFile)) {
            oldTopicList.remove(newChunkedFile);
          }
        }
      }
 else {
        if (!ditamapList.contains(newChunkedFile)) {
          ditamapList.add(newChunkedFile);
          if (oldTopicList.contains(newChunkedFile)) {
            oldTopicList.remove(newChunkedFile);
          }
        }
        chunkedDitamapSet.add(newChunkedFile);
      }
    }
  }
  for (  final String s : oldTopicList) {
    if (!StringUtils.isEmptyString(s)) {
      final File f=new File(tempDir,s);
      if (f.exists()) {
        f.delete();
      }
    }
  }
  for (  final Map.Entry<String,String> entry : changeTable.entrySet()) {
    final String oldFile=entry.getKey();
    if (entry.getValue().equals(oldFile)) {
      final String targetPath=conflictTable.get(entry.getKey());
      if (targetPath != null) {
        final File target=new File(targetPath);
        if (!FileUtils.fileExists(target.getAbsolutePath())) {
          final File from=new File(entry.getValue());
          String relativePath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),from.getAbsolutePath());
          final String relativeTargetPath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),target.getAbsolutePath());
          if (relativeTargetPath.lastIndexOf(SLASH) != -1) {
            relativePath2fix.put(relativeTargetPath,relativeTargetPath.substring(0,relativeTargetPath.lastIndexOf(SLASH) + 1));
          }
          target.delete();
          from.renameTo(target);
          if (topicList.contains(relativePath)) {
            topicList.remove(relativePath);
          }
          if (chunkedTopicSet.contains(relativePath)) {
            chunkedTopicSet.remove(relativePath);
          }
          relativePath=FileUtils.getRelativePath(xmlDitalist.getAbsolutePath(),target.getAbsolutePath());
          topicList.add(relativePath);
          chunkedTopicSet.add(relativePath);
        }
 else {
          conflictTable.remove(entry.getKey());
        }
      }
    }
  }
  for (  final String file : chunkedTopicSet) {
    job.getOrCreateFileInfo(file).isResourceOnly=false;
  }
  for (  final String file : chunkedDitamapSet) {
    job.getOrCreateFileInfo(file).isResourceOnly=false;
  }
  for (  FileInfo f : job.getFileInfo().values()) {
    if ("String_Node_Str".equals(f.format) || "String_Node_Str".equals(f.format)) {
      f.isActive=false;
    }
  }
  for (  final String file : topicList) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format="String_Node_Str";
    ff.isActive=true;
  }
  for (  final String file : ditamapList) {
    final FileInfo ff=job.getOrCreateFileInfo(file);
    ff.format="String_Node_Str";
    ff.isActive=true;
  }
  job.setProperty("String_Node_Str",CHUNKED_DITAMAP_LIST_FILE);
  job.setProperty("String_Node_Str",CHUNKED_TOPIC_LIST_FILE);
  job.setProperty("String_Node_Str",RESOURCE_ONLY_LIST_FILE);
  for (  final String file : chunkedDitamapSet) {
    job.getOrCreateFileInfo(file).isChunkedDitaMap=true;
  }
  for (  final String file : chunkedTopicSet) {
    job.getOrCreateFileInfo(file).isChunked=true;
  }
  try {
    job.write();
  }
 catch (  final IOException ex) {
    logger.logError(ex.getMessage(),ex);
  }
}