nus-yam/ex-repair huggingface dataset:
Program: 100850
Project: 100850
Buggy source:
/** 
 * Constructor.
 */
public GenListModuleReader(){
  nonConrefCopytoTargets=new HashSet<String>(INT_64);
  hrefTargets=new HashSet<String>(INT_32);
  hrefTopicSet=new HashSet<String>(INT_32);
  chunkTopicSet=new HashSet<String>(INT_32);
  schemeSet=new HashSet<String>(INT_32);
  schemeRefSet=new HashSet<String>(INT_32);
  conrefTargets=new HashSet<String>(INT_32);
  copytoMap=new HashMap<String,String>(INT_16);
  subsidiarySet=new HashSet<String>(INT_16);
  ignoredCopytoSourceSet=new HashSet<String>(INT_16);
  outDitaFilesSet=new HashSet<String>(INT_64);
  keysDefMap=new HashMap<String,String>();
  keysRefMap=new HashMap<String,String>();
  exKeysDefMap=new HashMap<String,String>();
  processRoleLevel=0;
  processRoleStack=new Stack<String>();
  resourceOnlySet=new HashSet<String>(INT_32);
  crossSet=new HashSet<String>(INT_32);
  topicMetaSet=new HashSet<String>(INT_16);
  vaildBranches=new HashMap<String,List<String>>(INT_32);
  level=0;
  topicrefStack=new Stack<String>();
  props=null;
  try {
    reader=StringUtils.getXMLReader();
  }
 catch (  SAXException e) {
    throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
  }
  reader.setContentHandler(this);
  try {
    reader.setProperty(LEXICAL_HANDLER_PROPERTY,this);
  }
 catch (  final SAXNotRecognizedException e1) {
    logger.logException(e1);
  }
catch (  final SAXNotSupportedException e1) {
    logger.logException(e1);
  }
  try {
    Class.forName(RESOLVER_CLASS);
    reader.setEntityResolver(CatalogUtils.getCatalogResolver());
  }
 catch (  final ClassNotFoundException e) {
    reader.setEntityResolver(this);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public GenListModuleReader(){
  nonConrefCopytoTargets=new HashSet<String>(INT_64);
  hrefTargets=new HashSet<String>(INT_32);
  hrefTopicSet=new HashSet<String>(INT_32);
  chunkTopicSet=new HashSet<String>(INT_32);
  schemeSet=new HashSet<String>(INT_32);
  schemeRefSet=new HashSet<String>(INT_32);
  conrefTargets=new HashSet<String>(INT_32);
  copytoMap=new HashMap<String,String>(INT_16);
  subsidiarySet=new HashSet<String>(INT_16);
  ignoredCopytoSourceSet=new HashSet<String>(INT_16);
  outDitaFilesSet=new HashSet<String>(INT_64);
  keysDefMap=new HashMap<String,String>();
  keysRefMap=new HashMap<String,String>();
  exKeysDefMap=new HashMap<String,String>();
  processRoleLevel=0;
  processRoleStack=new Stack<String>();
  resourceOnlySet=new HashSet<String>(INT_32);
  crossSet=new HashSet<String>(INT_32);
  topicMetaSet=new HashSet<String>(INT_16);
  vaildBranches=new HashMap<String,List<String>>(INT_32);
  level=0;
  topicrefStack=new Stack<String>();
  props=null;
  try {
    reader=StringUtils.getXMLReader();
  }
 catch (  SAXException e) {
    throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
  }
  reader.setContentHandler(this);
  try {
    reader.setProperty(LEXICAL_HANDLER_PROPERTY,this);
  }
 catch (  final SAXNotRecognizedException e1) {
    logger.logException(e1);
  }
catch (  final SAXNotSupportedException e1) {
    logger.logException(e1);
  }
}
Program: 100852
Project: 100852
Buggy source:
/** 
 * execution point of this invoker.
 * @throws BuildException Exception
 */
public void execute() throws BuildException {
  pipeline.setLogger(new DITAOTAntLogger(getProject()));
  try {
    pipeline.execute(pipelineInput.getAttribute("String_Node_Str"),pipelineInput);
  }
 catch (  DITAOTException e) {
    throw new BuildException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * execution point of this invoker.
 * @throws BuildException Exception
 */
public void execute() throws BuildException {
  pipeline.setLogger(new DITAOTJavaLogger());
  try {
    pipeline.execute(pipelineInput.getAttribute("String_Node_Str"),pipelineInput);
  }
 catch (  DITAOTException e) {
    throw new BuildException(e.getMessage(),e);
  }
}
Program: 100854
Project: 100854
Buggy source:
/** 
 * Get max value.
 */
public static Integer getMax(Integer fn_depth,Integer list_depth,Integer dlist_depth,Integer table_depth,Integer stable_depth){
  int fnDepth=fn_depth;
  int listDepth=list_depth;
  int dlistDepth=dlist_depth;
  int tableDepth=table_depth;
  int stableDepth=stable_depth;
  int max=fnDepth;
  if (listDepth > max) {
    max=listDepth;
  }
  if (dlistDepth > max) {
    max=dlistDepth;
  }
  if (tableDepth > max) {
    max=tableDepth;
  }
  if (stableDepth > max) {
    max=stableDepth;
  }
  return max;
}

Fixed version (ground truth):
/** 
 * Get max value.
 */
public static Integer getMax(String fn_depth,String list_depth,String dlist_depth,String table_depth,String stable_depth){
  int fnDepth=Integer.parseInt(fn_depth);
  int listDepth=Integer.parseInt(list_depth);
  int dlistDepth=Integer.parseInt(dlist_depth);
  int tableDepth=Integer.parseInt(table_depth);
  int stableDepth=Integer.parseInt(stable_depth);
  int max=fnDepth;
  if (listDepth > max) {
    max=listDepth;
  }
  if (dlistDepth > max) {
    max=dlistDepth;
  }
  if (tableDepth > max) {
    max=tableDepth;
  }
  if (stableDepth > max) {
    max=stableDepth;
  }
  return max;
}
Program: 100855
Project: 100855
Buggy source:
/** 
 * IndexTerm will be equal if they have same name, target and subterms.
 * @param o object to compare with.
 * @return boolean
 */
public boolean equals(Object o){
  IndexTerm it=(IndexTerm)o;
  boolean eqTermName;
  boolean eqTermKey;
  boolean eqTargetList;
  boolean eqSubTerms;
  boolean eqTermPrefix;
  if (o == this) {
    return true;
  }
  if (!(o instanceof IndexTerm)) {
    return false;
  }
  eqTermName=termName == it.getTermName() || termName != null && termName.equals(it.getTermName());
  eqTermPrefix=termPrefix == it.getTermPrefix() || termPrefix != null && termPrefix.equals(it.getTermPrefix());
  eqTermKey=termKey == it.getTermKey() || termKey != null && termKey.equals(it.getTermKey());
  eqTargetList=targetList == it.getTargetList() || targetList != null && targetList.equals(it.getTargetList());
  eqSubTerms=subTerms == it.getSubTerms() || subTerms != null && subTerms.equals(it.getSubTerms());
  return eqTermName && eqTermKey && eqTargetList&& eqSubTerms&& eqTermPrefix;
}

Fixed version (ground truth):
/** 
 * IndexTerm will be equal if they have same name, target and subterms.
 * @param o object to compare with.
 * @return boolean
 */
public boolean equals(Object o){
  if (!(o instanceof IndexTerm)) {
    return false;
  }
 else   if (o == this) {
    return true;
  }
  IndexTerm it=(IndexTerm)o;
  boolean eqTermName;
  boolean eqTermKey;
  boolean eqTargetList;
  boolean eqSubTerms;
  boolean eqTermPrefix;
  eqTermName=termName == it.getTermName() || termName != null && termName.equals(it.getTermName());
  eqTermPrefix=termPrefix == it.getTermPrefix() || termPrefix != null && termPrefix.equals(it.getTermPrefix());
  eqTermKey=termKey == it.getTermKey() || termKey != null && termKey.equals(it.getTermKey());
  eqTargetList=targetList == it.getTargetList() || targetList != null && targetList.equals(it.getTargetList());
  eqSubTerms=subTerms == it.getSubTerms() || subTerms != null && subTerms.equals(it.getSubTerms());
  return eqTermName && eqTermKey && eqTargetList&& eqSubTerms&& eqTermPrefix;
}
Program: 100856
Project: 100856
Buggy source:
/** 
 * The only interface to access IndexTermCollection instance.
 * @return Singleton IndexTermCollection instance
 * @author Marshall
 */
public static IndexTermCollection getInstantce(){
  if (collection == null) {
    collection=new IndexTermCollection();
  }
  return collection;
}

Fixed version (ground truth):
/** 
 * The only interface to access IndexTermCollection instance.
 * @return Singleton IndexTermCollection instance
 * @author Marshall
 */
public static synchronized IndexTermCollection getInstantce(){
  if (collection == null) {
    collection=new IndexTermCollection();
  }
  return collection;
}
Program: 100857
Project: 100857
Buggy source:
/** 
 * Defalut Constructor. Construct pipeline & input instance.
 */
public AntInvoker(){
  super();
  pipeline=new PipelineFacade();
  pipelineInput=new PipelineHashIO();
  javaLogger=new DITAOTJavaLogger();
}

Fixed version (ground truth):
/** 
 * Defalut Constructor. Construct pipeline & input instance.
 */
public AntInvoker(){
  super();
  pipeline=new PipelineFacade();
  pipelineInput=new PipelineHashIO();
}
Program: 100858
Project: 100858
Buggy source:
/** 
 * begin transformation.
 * @param cmd cmd
 * @throws IOException exception
 */
private static void startTransformation(String[] cmd) throws IOException {
  BufferedReader reader=null;
  Process antProcess=Runtime.getRuntime().exec(cmd);
  try {
    reader=new BufferedReader(new InputStreamReader(antProcess.getInputStream()));
    for (String line=reader.readLine(); line != null; line=reader.readLine()) {
      System.out.println(line);
    }
  }
  finally {
    reader.close();
  }
  reader=new BufferedReader(new InputStreamReader(antProcess.getErrorStream()));
  for (String line=reader.readLine(); line != null; line=reader.readLine()) {
    System.err.println(line);
  }
}

Fixed version (ground truth):
/** 
 * begin transformation.
 * @param cmd cmd
 * @throws IOException exception
 */
private static void startTransformation(String[] cmd) throws IOException {
  BufferedReader reader=null;
  Process antProcess=Runtime.getRuntime().exec(cmd);
  try {
    reader=new BufferedReader(new InputStreamReader(antProcess.getInputStream()));
    for (String line=reader.readLine(); line != null; line=reader.readLine()) {
      System.out.println(line);
    }
  }
  finally {
    reader.close();
  }
  reader=null;
  try {
    reader=new BufferedReader(new InputStreamReader(antProcess.getErrorStream()));
    for (String line=reader.readLine(); line != null; line=reader.readLine()) {
      System.err.println(line);
    }
  }
  finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
}
Program: 100859
Project: 100859
Buggy source:
/** 
 * Start ant process to execute the build process.
 * @throws IOException IOException
 */
public void startAnt() throws IOException {
  List<String> cmd=new ArrayList<String>(Constants.INT_8);
  String[] cmds=null;
  cmd.add(getCommandRunner());
  cmd.add("String_Node_Str");
  cmd.add(antBuildFile);
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add(propertyFile);
  if (debugMode) {
    cmd.add("String_Node_Str");
  }
  cmds=new String[cmd.size()];
  cmd.toArray(cmds);
  startTransformation(cmds);
}

Fixed version (ground truth):
/** 
 * Start ant process to execute the build process.
 * @throws IOException IOException
 */
public void startAnt() throws IOException {
  List<String> cmd=new ArrayList<String>(Constants.INT_8);
  String[] cmds;
  cmd.add(getCommandRunner());
  cmd.add("String_Node_Str");
  cmd.add(antBuildFile);
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add(propertyFile);
  if (debugMode) {
    cmd.add("String_Node_Str");
  }
  cmds=new String[cmd.size()];
  cmd.toArray(cmds);
  startTransformation(cmds);
}
Program: 100860
Project: 100860
Buggy source:
/** 
 * Get the DITAOTFileLogger instance. Singleton.
 * @return DITAOTFileLogger logger
 */
public static DITAOTFileLogger getInstance(){
  if (logger == null) {
    logger=new DITAOTFileLogger();
  }
  return logger;
}

Fixed version (ground truth):
/** 
 * Get the DITAOTFileLogger instance. Singleton.
 * @return DITAOTFileLogger logger
 */
public static synchronized DITAOTFileLogger getInstance(){
  if (logger == null) {
    logger=new DITAOTFileLogger();
  }
  return logger;
}
Program: 100861
Project: 100861
Buggy source:
/** 
 * Internal Singleton getInstance() method, for Classloader to locate the CLASSPATH
 * @return
 */
private static MessageUtils getInstance(){
  if (utils == null) {
    utils=new MessageUtils();
  }
  return utils;
}

Fixed version (ground truth):
/** 
 * Internal Singleton getInstance() method, for Classloader to locate the CLASSPATH
 * @return
 */
private static synchronized MessageUtils getInstance(){
  if (utils == null) {
    utils=new MessageUtils();
  }
  return utils;
}
Program: 100862
Project: 100862
Buggy source:
private void updateRefOfDita(Content changeTable,Hashtable<String,String> conflictTable,AbstractPipelineInput input){
  DITAOTJavaLogger logger=new DITAOTJavaLogger();
  String tempDir=((PipelineHashIO)input).getAttribute(Constants.ANT_INVOKER_PARAM_TEMPDIR);
  if (!new File(tempDir).isAbsolute()) {
    String baseDir=((PipelineHashIO)input).getAttribute(Constants.ANT_INVOKER_PARAM_BASEDIR);
    tempDir=new File(baseDir,tempDir).getAbsolutePath();
  }
  File ditalist=new File(tempDir,Constants.FILE_NAME_DITA_LIST);
  File xmlDitalist=new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML);
  Properties prop=new Properties();
  try {
    if (xmlDitalist.exists()) {
      prop.loadFromXML(new FileInputStream(xmlDitalist));
    }
 else {
      prop.load(new FileInputStream(ditalist));
    }
  }
 catch (  IOException io) {
    logger.logError(io.getMessage());
  }
  TopicRefWriter topicRefWriter=new TopicRefWriter();
  topicRefWriter.setContent(changeTable);
  topicRefWriter.setup(conflictTable);
  StringTokenizer fullTopicList=new StringTokenizer(prop.getProperty(Constants.FULL_DITAMAP_TOPIC_LIST),Constants.COMMA);
  try {
    while (fullTopicList.hasMoreTokens()) {
      topicRefWriter.write(new File(tempDir,fullTopicList.nextToken()).getAbsolutePath());
    }
  }
 catch (  DITAOTException ex) {
    logger.logException(ex);
  }
}

Fixed version (ground truth):
private void updateRefOfDita(Content changeTable,Hashtable<String,String> conflictTable,AbstractPipelineInput input){
  DITAOTJavaLogger logger=new DITAOTJavaLogger();
  String tempDir=((PipelineHashIO)input).getAttribute(Constants.ANT_INVOKER_PARAM_TEMPDIR);
  if (!new File(tempDir).isAbsolute()) {
    String baseDir=((PipelineHashIO)input).getAttribute(Constants.ANT_INVOKER_PARAM_BASEDIR);
    tempDir=new File(baseDir,tempDir).getAbsolutePath();
  }
  File ditalist=new File(tempDir,Constants.FILE_NAME_DITA_LIST);
  File xmlDitalist=new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML);
  Properties prop=new Properties();
  InputStream in=null;
  try {
    if (xmlDitalist.exists()) {
      in=new FileInputStream(xmlDitalist);
      prop.loadFromXML(in);
    }
 else {
      in=new FileInputStream(ditalist);
      prop.load(in);
    }
  }
 catch (  IOException io) {
    logger.logError(io.getMessage());
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
        logger.logException(e);
      }
    }
  }
  TopicRefWriter topicRefWriter=new TopicRefWriter();
  topicRefWriter.setContent(changeTable);
  topicRefWriter.setup(conflictTable);
  StringTokenizer fullTopicList=new StringTokenizer(prop.getProperty(Constants.FULL_DITAMAP_TOPIC_LIST),Constants.COMMA);
  try {
    while (fullTopicList.hasMoreTokens()) {
      topicRefWriter.write(new File(tempDir,fullTopicList.nextToken()).getAbsolutePath());
    }
  }
 catch (  DITAOTException ex) {
    logger.logException(ex);
  }
}
Program: 100865
Project: 100865
Buggy source:
private Map<String,Set<String>> readMapFromXML(String filename){
  File inputFile=new File(tempDir,filename);
  Map<String,Set<String>> graph=new HashMap<String,Set<String>>();
  if (!inputFile.exists())   return graph;
  Properties prop=new Properties();
  try {
    FileInputStream in=new FileInputStream(inputFile);
    prop.loadFromXML(in);
    in.close();
  }
 catch (  IOException e) {
    this.javaLogger.logException(e);
  }
  Iterator<Object> it=prop.keySet().iterator();
  while (it.hasNext()) {
    String key=(String)it.next();
    String value=prop.getProperty(key);
    graph.put(key,StringUtils.restoreSet(value,Constants.COMMA));
  }
  return graph;
}

Fixed version (ground truth):
private Map<String,Set<String>> readMapFromXML(String filename){
  File inputFile=new File(tempDir,filename);
  Map<String,Set<String>> graph=new HashMap<String,Set<String>>();
  if (!inputFile.exists())   return graph;
  Properties prop=new Properties();
  FileInputStream in=null;
  try {
    in=new FileInputStream(inputFile);
    prop.loadFromXML(in);
    in.close();
  }
 catch (  IOException e) {
    this.javaLogger.logException(e);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
  Iterator<Object> it=prop.keySet().iterator();
  while (it.hasNext()) {
    String key=(String)it.next();
    String value=prop.getProperty(key);
    graph.put(key,StringUtils.restoreSet(value,Constants.COMMA));
  }
  return graph;
}
Program: 100867
Project: 100867
Buggy source:
private void writeMapToXML(Map<String,Set<String>> m,String filename){
  if (m == null)   return;
  Properties prop=new Properties();
  Iterator<Map.Entry<String,Set<String>>> iter=m.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry<String,Set<String>> entry=iter.next();
    String key=entry.getKey();
    String value=StringUtils.assembleString(entry.getValue(),Constants.COMMA);
    prop.setProperty(key,value);
  }
  File outputFile=new File(tempDir,filename);
  try {
    FileOutputStream os=new FileOutputStream(outputFile,false);
    prop.storeToXML(os,null);
    os.close();
  }
 catch (  IOException e) {
    this.javaLogger.logException(e);
  }
}

Fixed version (ground truth):
private void writeMapToXML(Map<String,Set<String>> m,String filename){
  if (m == null)   return;
  Properties prop=new Properties();
  Iterator<Map.Entry<String,Set<String>>> iter=m.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry<String,Set<String>> entry=iter.next();
    String key=entry.getKey();
    String value=StringUtils.assembleString(entry.getValue(),Constants.COMMA);
    prop.setProperty(key,value);
  }
  File outputFile=new File(tempDir,filename);
  FileOutputStream os=null;
  try {
    os=new FileOutputStream(outputFile,false);
    prop.storeToXML(os,null);
    os.close();
  }
 catch (  IOException e) {
    this.javaLogger.logException(e);
  }
 finally {
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
}
Program: 100868
Project: 100868
Buggy source:
private void updateList(String tempDir){
  Properties property=new Properties();
  FileOutputStream output=null;
  FileOutputStream xmlDitalist=null;
  try {
    property.loadFromXML(new FileInputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML)));
    for (int i=0; i < PROPERTY_UPDATE_LIST.length; i++) {
      updateProperty(PROPERTY_UPDATE_LIST[i],property);
    }
    output=new FileOutputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST));
    xmlDitalist=new FileOutputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML));
    property.store(output,null);
    property.storeToXML(xmlDitalist,null);
    output.flush();
    xmlDitalist.flush();
  }
 catch (  Exception e) {
    javaLogger.logException(e);
  }
 finally {
    try {
      output.close();
      xmlDitalist.close();
    }
 catch (    IOException e) {
      javaLogger.logException(e);
    }
  }
}

Fixed version (ground truth):
private void updateList(String tempDir){
  Properties property=new Properties();
  FileInputStream in=null;
  FileOutputStream output=null;
  FileOutputStream xmlDitalist=null;
  try {
    in=new FileInputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML));
    property.loadFromXML(in);
    for (int i=0; i < PROPERTY_UPDATE_LIST.length; i++) {
      updateProperty(PROPERTY_UPDATE_LIST[i],property);
    }
    output=new FileOutputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST));
    xmlDitalist=new FileOutputStream(new File(tempDir,Constants.FILE_NAME_DITA_LIST_XML));
    property.store(output,null);
    property.storeToXML(xmlDitalist,null);
    output.flush();
    xmlDitalist.flush();
  }
 catch (  Exception e) {
    javaLogger.logException(e);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
    if (output != null) {
      try {
        output.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
    if (xmlDitalist != null) {
      try {
        xmlDitalist.close();
      }
 catch (      IOException e) {
        javaLogger.logException(e);
      }
    }
  }
}
Program: 100869
Project: 100869
Buggy source:
/** 
 * Return if the file is a supported image file by extension
 * @param lcasefn
 * @return
 */
public static boolean isSupportedImageFile(String lcasefn){
  return lcasefn.endsWith(Constants.FILE_EXTENSION_JPG) || lcasefn.endsWith(Constants.FILE_EXTENSION_GIF) || lcasefn.endsWith(Constants.FILE_EXTENSION_EPS)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPEG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_PNG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_SVG);
}

Fixed version (ground truth):
/** 
 * Return if the file is a supported image file by extension
 * @param lcasefn
 * @return
 */
public static boolean isSupportedImageFile(String lcasefn){
  return lcasefn.endsWith(Constants.FILE_EXTENSION_JPG) || lcasefn.endsWith(Constants.FILE_EXTENSION_GIF) || lcasefn.endsWith(Constants.FILE_EXTENSION_EPS)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPEG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_PNG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_SVG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_TIFF)|| lcasefn.endsWith(Constants.FILE_EXTENSION_TIF);
}
Program: 100870
Project: 100870
Buggy source:
/** 
 * Return if the file is a valid target file by extension
 * @param lcasefn
 * @return
 */
public static boolean isValidTarget(String lcasefn){
  DITAOTJavaLogger logger=new DITAOTJavaLogger();
  Properties params=new Properties();
  if (lcasefn.indexOf(Constants.STRING_BLANK) != -1) {
    params.put("String_Node_Str",lcasefn);
    logger.logWarn(MessageUtils.getMessage("String_Node_Str",params).toString());
  }
  return lcasefn.endsWith(Constants.FILE_EXTENSION_DITA) || lcasefn.endsWith(Constants.FILE_EXTENSION_DITAMAP) || lcasefn.endsWith(Constants.FILE_EXTENSION_XML)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_GIF)|| lcasefn.endsWith(Constants.FILE_EXTENSION_EPS)|| lcasefn.endsWith(Constants.FILE_EXTENSION_HTML)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPEG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_PNG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_SVG);
}

Fixed version (ground truth):
/** 
 * Return if the file is a valid target file by extension
 * @param lcasefn
 * @return
 */
public static boolean isValidTarget(String lcasefn){
  DITAOTJavaLogger logger=new DITAOTJavaLogger();
  Properties params=new Properties();
  if (lcasefn.indexOf(Constants.STRING_BLANK) != -1) {
    params.put("String_Node_Str",lcasefn);
    logger.logWarn(MessageUtils.getMessage("String_Node_Str",params).toString());
  }
  return lcasefn.endsWith(Constants.FILE_EXTENSION_DITA) || lcasefn.endsWith(Constants.FILE_EXTENSION_DITAMAP) || lcasefn.endsWith(Constants.FILE_EXTENSION_XML)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_GIF)|| lcasefn.endsWith(Constants.FILE_EXTENSION_EPS)|| lcasefn.endsWith(Constants.FILE_EXTENSION_HTML)|| lcasefn.endsWith(Constants.FILE_EXTENSION_JPEG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_PNG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_SVG)|| lcasefn.endsWith(Constants.FILE_EXTENSION_TIFF)|| lcasefn.endsWith(Constants.FILE_EXTENSION_TIF);
}
Program: 100872
Project: 100872
Buggy source:
/** 
 * (non-Javadoc)
 * @see org.dita.dost.module.AbstractPipelineModule#execute(org.dita.dost.pipeline.AbstractPipelineInput)
 */
public AbstractPipelineOutput execute(AbstractPipelineInput input) throws DITAOTException {
  try {
    parseAndValidateInput(input);
    extractIndexTerm();
    IndexTermCollection.getInstantce().sort();
    IndexTermCollection.getInstantce().outputTerms();
  }
 catch (  Exception e) {
    javaLogger.logException(e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see org.dita.dost.module.AbstractPipelineModule#execute(org.dita.dost.pipeline.AbstractPipelineInput)
 */
public AbstractPipelineOutput execute(AbstractPipelineInput input) throws DITAOTException {
  try {
    IndexTermCollection.getInstantce().clear();
    parseAndValidateInput(input);
    extractIndexTerm();
    IndexTermCollection.getInstantce().sort();
    IndexTermCollection.getInstantce().outputTerms();
  }
 catch (  Exception e) {
    javaLogger.logException(e);
  }
  return null;
}
Program: 100873
Project: 100873
Buggy source:
/** 
 * Add a sub term into the sub term list.
 * @param term
 */
public void addSubTerm(IndexTerm term){
  int i=0;
  int subTermNum=subTerms.size();
  for (; i < subTermNum; i++) {
    IndexTerm subTerm=(IndexTerm)subTerms.get(i);
    if (subTerm.equals(term)) {
      return;
    }
    if (subTerm.getTermFullName().equals(term.getTermFullName()) && subTerm.getTermKey().equals(term.getTermKey())) {
      subTerm.addTargets(term.getTargetList());
      subTerm.addSubTerms(term.getSubTerms());
      return;
    }
  }
  if (i == subTermNum) {
    subTerms.add(term);
  }
}

Fixed version (ground truth):
/** 
 * Add a sub term into the sub term list.
 * @param term
 */
public void addSubTerm(IndexTerm term){
  int i=0;
  int subTermNum=subTerms.size();
  if (!Constants.IndexTerm_Prefix_See.equals(term.getTermPrefix()) && !Constants.IndexTerm_Prefix_See_Also.equals(term.getTermPrefix())) {
    leaf=false;
  }
  for (; i < subTermNum; i++) {
    IndexTerm subTerm=(IndexTerm)subTerms.get(i);
    if (subTerm.equals(term)) {
      return;
    }
    if (subTerm.getTermFullName().equals(term.getTermFullName()) && subTerm.getTermKey().equals(term.getTermKey())) {
      subTerm.addTargets(term.getTargetList());
      subTerm.addSubTerms(term.getSubTerms());
      return;
    }
  }
  if (i == subTermNum) {
    subTerms.add(term);
  }
}
Program: 100874
Project: 100874
Buggy source:
public void updateSubTerm(){
  if (subTerms.size() == 1) {
    IndexTerm term=(IndexTerm)subTerms.get(0);
    if (term.getTermPrefix() != null && "String_Node_Str".equalsIgnoreCase(term.getTermPrefix().trim())) {
      term.setTermPrefix("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void updateSubTerm(){
  if (subTerms.size() == 1) {
    IndexTerm term=(IndexTerm)subTerms.get(0);
    if (term.getTermPrefix() != null && Constants.IndexTerm_Prefix_See.equalsIgnoreCase(term.getTermPrefix().trim())) {
      term.setTermPrefix(Constants.IndexTerm_Prefix_See_Also);
    }
  }
}
Program: 100876
Project: 100876
Buggy source:
private void parseIndexTerm(String localName){
  if (indexTermSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTermTarget target=new IndexTermTarget();
    String fragment=null;
    IndexTerm parentTerm=null;
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
      }
    }
    if (topicIdStack.peek() == null) {
      fragment=null;
    }
 else {
      fragment=topicIdStack.peek().toString();
    }
    if (title != null) {
      target.setTargetName(title);
    }
 else {
      target.setTargetName(targetFile);
    }
    if (fragment != null)     target.setTargetURI(targetFile + Constants.SHARP + fragment);
 else     target.setTargetURI(targetFile);
    indexTerm.addTarget(target);
    termStack.push(indexTerm);
  }
}

Fixed version (ground truth):
private void parseIndexTerm(String localName){
  if (indexTermSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTerm parentTerm=null;
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
      }
    }
    termStack.push(indexTerm);
  }
}
Program: 100877
Project: 100877
Buggy source:
private void parseIndexSeeAlso(String localName){
  if (indexSeeAlsoSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTerm parentTerm=null;
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
      }
    }
    indexTerm.setTermPrefix("String_Node_Str");
    termStack.push(indexTerm);
  }
}

Fixed version (ground truth):
private void parseIndexSeeAlso(String localName){
  if (indexSeeAlsoSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTerm parentTerm=null;
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
      }
    }
    indexTerm.setTermPrefix(Constants.IndexTerm_Prefix_See_Also);
    termStack.push(indexTerm);
  }
}
Program: 100878
Project: 100878
Buggy source:
private void parseIndexSee(String localName){
  if (indexSeeSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTerm parentTerm=null;
    indexTerm.setTermPrefix("String_Node_Str");
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
        indexTerm.setTermPrefix("String_Node_Str");
      }
    }
    termStack.push(indexTerm);
  }
}

Fixed version (ground truth):
private void parseIndexSee(String localName){
  if (indexSeeSpecList.contains(localName)) {
    IndexTerm indexTerm=new IndexTerm();
    IndexTerm parentTerm=null;
    indexTerm.setTermPrefix(Constants.IndexTerm_Prefix_See);
    if (!termStack.isEmpty()) {
      parentTerm=(IndexTerm)termStack.peek();
      if (parentTerm.hasSubTerms()) {
        parentTerm.updateSubTerm();
        indexTerm.setTermPrefix(Constants.IndexTerm_Prefix_See_Also);
      }
    }
    termStack.push(indexTerm);
  }
}
Program: 100879
Project: 100879
Buggy source:
/** 
 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,java.lang.String,java.lang.String)
 */
public void endElement(String uri,String localName,String qName) throws SAXException {
  if (indexTermSpecList.contains(localName)) {
    IndexTerm term=(IndexTerm)termStack.pop();
    if (term.getTermName() == null) {
      term.setTermName("String_Node_Str");
      javaLogger.logWarn(MessageUtils.getMessage("String_Node_Str").toString());
    }
    if (term.getTermKey() == null) {
      term.setTermKey(term.getTermName());
    }
    if (termStack.empty()) {
      indexTermList.add(term);
    }
 else {
      IndexTerm parentTerm=(IndexTerm)termStack.peek();
      parentTerm.addSubTerm(term);
    }
  }
  if (indexSeeSpecList.contains(localName) || indexSeeAlsoSpecList.contains(localName)) {
    IndexTerm term=(IndexTerm)termStack.pop();
    IndexTerm parentTerm=(IndexTerm)termStack.peek();
    if (term.getTermKey() == null) {
      term.setTermKey(term.getTermFullName());
    }
    term.addTargets(parentTerm.getTargetList());
    parentTerm.addSubTerm(term);
  }
  if (Constants.ELEMENT_NAME_TITLE.equals(localName)) {
    inTitleElement=false;
    if (!titleMap.containsKey(topicIdStack.peek())) {
      if (titleMap.size() == 0)       defaultTitle=title;
      titleMap.put(topicIdStack.peek(),title);
    }
  }
  if (indexSortAsSpecList.contains(localName)) {
    insideSortingAs=false;
  }
  if (topicSpecList.contains(localName)) {
    topicIdStack.pop();
  }
}

Fixed version (ground truth):
/** 
 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,java.lang.String,java.lang.String)
 */
public void endElement(String uri,String localName,String qName) throws SAXException {
  if (indexTermSpecList.contains(localName)) {
    IndexTerm term=(IndexTerm)termStack.pop();
    if (term.getTermName() == null) {
      term.setTermName("String_Node_Str");
      javaLogger.logWarn(MessageUtils.getMessage("String_Node_Str").toString());
    }
    if (term.getTermKey() == null) {
      term.setTermKey(term.getTermName());
    }
    if (term.isLeaf()) {
      IndexTermTarget target=genTarget();
      term.addTarget(target);
    }
    if (termStack.empty()) {
      indexTermList.add(term);
    }
 else {
      IndexTerm parentTerm=(IndexTerm)termStack.peek();
      parentTerm.addSubTerm(term);
    }
  }
  if (indexSeeSpecList.contains(localName) || indexSeeAlsoSpecList.contains(localName)) {
    IndexTerm term=(IndexTerm)termStack.pop();
    IndexTerm parentTerm=(IndexTerm)termStack.peek();
    if (term.getTermKey() == null) {
      term.setTermKey(term.getTermFullName());
    }
    term.addTarget(genTarget());
    parentTerm.addSubTerm(term);
  }
  if (Constants.ELEMENT_NAME_TITLE.equals(localName)) {
    inTitleElement=false;
    if (!titleMap.containsKey(topicIdStack.peek())) {
      if (titleMap.size() == 0)       defaultTitle=title;
      titleMap.put(topicIdStack.peek(),title);
    }
  }
  if (indexSortAsSpecList.contains(localName)) {
    insideSortingAs=false;
  }
  if (topicSpecList.contains(localName)) {
    topicIdStack.pop();
  }
}
Program: 100880
Project: 100880
Buggy source:
/** 
 * Output the given indexterm into the PrintWriter.  
 * @param term
 * @param printWriter
 */
private void outputIndexTerm(IndexTerm term,PrintWriter printWriter){
  List targets=term.getTargetList();
  List subTerms=term.getSubTerms();
  int targetNum=targets.size();
  int subTermNum=subTerms.size();
  printWriter.println("String_Node_Str");
  printWriter.print("String_Node_Str");
  printWriter.print(term.getTermFullName());
  printWriter.print("String_Node_Str");
  printWriter.println();
  for (int i=0; i < targetNum; i++) {
    IndexTermTarget target=(IndexTermTarget)targets.get(i);
    printWriter.print("String_Node_Str");
    printWriter.print(target.getTargetName());
    printWriter.print("String_Node_Str");
    printWriter.println();
    printWriter.print("String_Node_Str");
    printWriter.print(target.getTargetURI());
    printWriter.print("String_Node_Str");
    printWriter.println();
  }
  printWriter.println("String_Node_Str");
  if (subTerms != null && subTermNum > 0) {
    printWriter.println("String_Node_Str");
    for (int i=0; i < subTermNum; i++) {
      IndexTerm subTerm=(IndexTerm)subTerms.get(i);
      outputIndexTerm(subTerm,printWriter);
    }
    printWriter.println("String_Node_Str");
  }
  printWriter.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Output the given indexterm into the PrintWriter.  
 * @param term
 * @param printWriter
 */
private void outputIndexTerm(IndexTerm term,PrintWriter printWriter){
  List targets=term.getTargetList();
  List subTerms=term.getSubTerms();
  int targetNum=targets.size();
  int subTermNum=subTerms.size();
  printWriter.println("String_Node_Str");
  printWriter.print("String_Node_Str");
  printWriter.print(term.getTermFullName());
  printWriter.print("String_Node_Str");
  printWriter.println();
  if (targets == null || targets.isEmpty()) {
    targets=new ArrayList(Constants.INT_1);
    findTargets(term,targets);
    targetNum=targets.size();
  }
  for (int i=0; i < targetNum; i++) {
    IndexTermTarget target=(IndexTermTarget)targets.get(i);
    printWriter.print("String_Node_Str");
    printWriter.print(target.getTargetName());
    printWriter.print("String_Node_Str");
    printWriter.println();
    printWriter.print("String_Node_Str");
    printWriter.print(target.getTargetURI());
    printWriter.print("String_Node_Str");
    printWriter.println();
  }
  printWriter.println("String_Node_Str");
  if (subTerms != null && subTermNum > 0) {
    printWriter.println("String_Node_Str");
    for (int i=0; i < subTermNum; i++) {
      IndexTerm subTerm=(IndexTerm)subTerms.get(i);
      outputIndexTerm(subTerm,printWriter);
    }
    printWriter.println("String_Node_Str");
  }
  printWriter.println("String_Node_Str");
}
Program: 100882
Project: 100882
Buggy source:
/** 
 * Sort term list extracted from dita files base on Locale.
 */
public void sort(){
  int termListSize=termList.size();
  if (IndexTerm.getTermLocale() == null) {
    IndexTerm.setTermLocale(new Locale(Constants.LANGUAGE_EN,Constants.COUNTRY_US));
  }
  for (int i=0; i < termListSize; i++) {
    IndexTerm term=(IndexTerm)termList.get(i);
    term.sortSubTerms();
  }
  Collections.sort(termList);
}

Fixed version (ground truth):
/** 
 * Sort term list extracted from dita files base on Locale.
 */
public void sort(){
  int termListSize=termList.size();
  if (IndexTerm.getTermLocale() == null || IndexTerm.getTermLocale().getLanguage().trim().length() == 0) {
    IndexTerm.setTermLocale(new Locale(Constants.LANGUAGE_EN,Constants.COUNTRY_US));
  }
  for (int i=0; i < termListSize; i++) {
    IndexTerm term=(IndexTerm)termList.get(i);
    term.sortSubTerms();
  }
  Collections.sort(termList);
}
Program: 100884
Project: 100884
Buggy source:
/** 
 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.Attributes)
 */
public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException {
  String classAttr=attributes.getValue(Constants.ATTRIBUTE_NAME_CLASS);
  handleSpecialization(localName,classAttr);
  parseTopic(localName,attributes.getValue(Constants.ATTRIBUTE_NAME_ID));
  parseIndexTerm(localName);
  parseIndexSee(localName);
  parseIndexSeeAlso(localName);
  if (IndexTerm.getTermLocale() == null) {
    String xmlLang=attributes.getValue(Constants.ATTRIBUTE_NAME_XML_LANG);
    if (xmlLang != null) {
      Locale locale;
      if (xmlLang.length() == 5) {
        locale=new Locale(xmlLang.substring(0,2).toLowerCase(),xmlLang.substring(3,5).toUpperCase());
      }
 else {
        locale=new Locale(xmlLang.substring(0,2).toLowerCase());
      }
      IndexTerm.setTermLocale(locale);
    }
  }
  if (Constants.ELEMENT_NAME_TITLE.equals(localName) && !titleMap.containsKey(topicIdStack.peek())) {
    inTitleElement=true;
    title=null;
  }
  if (indexSortAsSpecList.contains(localName)) {
    insideSortingAs=true;
  }
}

Fixed version (ground truth):
/** 
 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.Attributes)
 */
public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException {
  String classAttr=attributes.getValue(Constants.ATTRIBUTE_NAME_CLASS);
  handleSpecialization(localName,classAttr);
  parseTopic(localName,attributes.getValue(Constants.ATTRIBUTE_NAME_ID));
  parseIndexTerm(localName);
  parseIndexSee(localName);
  parseIndexSeeAlso(localName);
  if (IndexTerm.getTermLocale() == null) {
    String xmlLang=attributes.getValue(Constants.ATTRIBUTE_NAME_XML_LANG);
    if (xmlLang != null) {
      Locale locale;
      IndexTerm.setTermLocale(StringUtils.getLocale(xmlLang));
    }
  }
  if (Constants.ELEMENT_NAME_TITLE.equals(localName) && !titleMap.containsKey(topicIdStack.peek())) {
    inTitleElement=true;
    title=null;
  }
  if (indexSortAsSpecList.contains(localName)) {
    insideSortingAs=true;
  }
}
Program: 100887
Project: 100887
Buggy source:
/** 
 * @see org.xml.sax.helpers.DefaultHandler#characters(char[],int,int)
 */
public void characters(char[] ch,int start,int length) throws SAXException {
  String temp=new String(ch,start,length).trim();
  boolean withSpace=(ch[start] == '\n' || temp.startsWith(Constants.LINE_SEPARATOR));
  if (temp.length() == 0) {
    return;
  }
  if (!termStack.empty()) {
    IndexTerm indexTerm=(IndexTerm)termStack.peek();
    temp=StringUtils.restoreEntity(temp);
    indexTerm.setTermName(StringUtils.setOrAppend(indexTerm.getTermName(),temp,withSpace));
  }
 else   if (insideSortingAs && temp.length() > 0) {
    IndexTerm indexTerm=(IndexTerm)termStack.peek();
    temp=StringUtils.restoreEntity(temp);
    indexTerm.setTermKey(StringUtils.setOrAppend(indexTerm.getTermKey(),temp,withSpace));
  }
 else   if (inTitleElement) {
    temp=StringUtils.restoreEntity(temp);
    title=StringUtils.setOrAppend(title,temp,true);
  }
}

Fixed version (ground truth):
/** 
 * @see org.xml.sax.helpers.DefaultHandler#characters(char[],int,int)
 */
public void characters(char[] ch,int start,int length) throws SAXException {
  String temp=new String(ch,start,length).trim();
  boolean withSpace=(ch[start] == '\n' || temp.startsWith(Constants.LINE_SEPARATOR));
  if (temp.length() == 0) {
    return;
  }
  if (!insideSortingAs && !termStack.empty()) {
    IndexTerm indexTerm=(IndexTerm)termStack.peek();
    temp=StringUtils.restoreEntity(temp);
    indexTerm.setTermName(StringUtils.setOrAppend(indexTerm.getTermName(),temp,withSpace));
  }
 else   if (insideSortingAs && temp.length() > 0) {
    IndexTerm indexTerm=(IndexTerm)termStack.peek();
    temp=StringUtils.restoreEntity(temp);
    indexTerm.setTermKey(StringUtils.setOrAppend(indexTerm.getTermKey(),temp,withSpace));
  }
 else   if (inTitleElement) {
    temp=StringUtils.restoreEntity(temp);
    title=StringUtils.setOrAppend(title,temp,true);
  }
}
Program: 100888
Project: 100888
Buggy source:
/** 
 * @param rootPath
 * @param relativePath
 * @return
 */
public static String resolveDirectory(String rootPath,String relativePath){
  if (relativePath.indexOf('#') != -1) {
    relativePath=relativePath.substring(0,relativePath.indexOf('#'));
  }
  relativePath=relativePath.replace('\\',File.separatorChar);
  relativePath=relativePath.replace('/',File.separatorChar);
  if (rootPath == null) {
    return relativePath;
  }
  String prefix=null;
  if (rootPath.charAt(rootPath.length() - 1) == File.separatorChar) {
    prefix=rootPath.substring(0,rootPath.length() - 1);
  }
 else {
    prefix=rootPath;
  }
  String postfix=relativePath;
  if (relativePath.startsWith("String_Node_Str")) {
    int sepPos=relativePath.indexOf(File.separatorChar);
    int lastPos=prefix.lastIndexOf(File.separatorChar);
    postfix=relativePath.substring(sepPos == -1 ? 0 : sepPos + File.separator.length(),relativePath.length());
    if (lastPos == -1) {
      return postfix;
    }
    prefix=prefix.substring(0,lastPos);
  }
  return prefix + File.separatorChar + postfix;
}

Fixed version (ground truth):
/** 
 * @param rootPath
 * @param relativePath
 * @return
 */
public static String resolveDirectory(String rootPath,String relativePath){
  if (relativePath.indexOf('#') != -1) {
    relativePath=relativePath.substring(0,relativePath.indexOf('#'));
  }
  relativePath=relativePath.replace('\\',File.separatorChar);
  relativePath=relativePath.replace('/',File.separatorChar);
  if (rootPath == null) {
    return relativePath;
  }
  String prefix=null;
  if (rootPath.charAt(rootPath.length() - 1) == File.separatorChar) {
    prefix=rootPath.substring(0,rootPath.length() - 1);
  }
 else {
    prefix=rootPath;
  }
  String postfix=relativePath;
  while (postfix.startsWith("String_Node_Str")) {
    int sepPos=postfix.indexOf(File.separatorChar);
    int lastPos=prefix.lastIndexOf(File.separatorChar);
    postfix=postfix.substring(sepPos == -1 ? 0 : sepPos + File.separator.length(),postfix.length());
    if (lastPos == -1) {
      return postfix;
    }
    prefix=prefix.substring(0,lastPos);
  }
  return prefix + File.separatorChar + postfix;
}
Program: 100891
Project: 100891
Buggy source:
/** 
 * Loads the XML file and maps the content to a hashmap.
 * @return A hashmap containing all data from the XML file, hopefully thefilename and its corresponding hash.
 * @throws com.github.arara.exception.AraraException if something badhappens, including a malformed XML or an encoding problem.
 */
public static HashMap load() throws AraraException {
  try {
    FileInputStream inputStream=new FileInputStream(AraraConstants.ARARADATABASE);
    Reader reader=new InputStreamReader(inputStream,"String_Node_Str");
    XStream xstream=new XStream();
    HashMap map=(HashMap)xstream.fromXML(reader);
    reader.close();
    inputStream.close();
    return map;
  }
 catch (  FileNotFoundException fnfe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  UnsupportedEncodingException uee) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  XStreamException xe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  IOException ioe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
}

Fixed version (ground truth):
/** 
 * Loads the XML file and maps the content to a hashmap.
 * @return A hashmap containing all data from the XML file, hopefully thefilename and its corresponding hash.
 * @throws com.github.arara.exception.AraraException if something badhappens, including a malformed XML or an encoding problem.
 */
public static HashMap load() throws AraraException {
  try {
    FileInputStream inputStream=new FileInputStream(absolutePath.concat(File.separator).concat(AraraConstants.ARARADATABASE));
    Reader reader=new InputStreamReader(inputStream,"String_Node_Str");
    XStream xstream=new XStream();
    HashMap map=(HashMap)xstream.fromXML(reader);
    reader.close();
    inputStream.close();
    return map;
  }
 catch (  FileNotFoundException fnfe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  UnsupportedEncodingException uee) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  XStreamException xe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  IOException ioe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
}
Program: 100892
Project: 100892
Buggy source:
/** 
 * Saves the hashmap into a XML file.
 * @param map A hashmap containing all data from files and theircorresponding hashes.
 * @throws com.github.arara.exception.AraraException if something badhappens.
 */
public static void save(HashMap map) throws AraraException {
  try {
    FileOutputStream outputStream=new FileOutputStream(AraraConstants.ARARADATABASE);
    OutputStreamWriter writer=new OutputStreamWriter(outputStream,"String_Node_Str");
    XStream xstream=new XStream();
    xstream.toXML(map,writer);
    writer.close();
    outputStream.close();
  }
 catch (  UnsupportedEncodingException uee) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  XStreamException xe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  IOException ioe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
}

Fixed version (ground truth):
/** 
 * Saves the hashmap into a XML file.
 * @param map A hashmap containing all data from files and theircorresponding hashes.
 * @throws com.github.arara.exception.AraraException if something badhappens.
 */
public static void save(HashMap map) throws AraraException {
  try {
    FileOutputStream outputStream=new FileOutputStream(absolutePath.concat(File.separator).concat(AraraConstants.ARARADATABASE));
    OutputStreamWriter writer=new OutputStreamWriter(outputStream,"String_Node_Str");
    XStream xstream=new XStream();
    xstream.toXML(map,writer);
    writer.close();
    outputStream.close();
  }
 catch (  UnsupportedEncodingException uee) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  XStreamException xe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
catch (  IOException ioe) {
    throw new AraraException(localization.getMessage("String_Node_Str",AraraConstants.ARARADATABASE));
  }
}
Program: 100893
Project: 100893
Buggy source:
/** 
 * Checks if the XML file exists in the current directory.
 * @return a boolean indicating if the XML file exists in the currentdirectory.
 */
public static boolean exists(){
  return ConditionalMethods.exists(AraraConstants.ARARADATABASE);
}

Fixed version (ground truth):
/** 
 * Checks if the XML file exists in the current directory.
 * @return a boolean indicating if the XML file exists in the currentdirectory.
 */
public static boolean exists(){
  return ConditionalMethods.exists(absolutePath.concat(File.separator).concat(AraraConstants.ARARADATABASE));
}