nus-yam/ex-repair huggingface dataset:
Program: 64330
Project: 64330
Buggy source:
private final Configuration prepareAspects(final Configuration taskModel) throws TaskException {
  final DefaultConfiguration newTaskModel=new DefaultConfiguration(taskModel.getName(),taskModel.getLocation());
  final HashMap parameterMap=new HashMap();
  final HashMap elementMap=new HashMap();
  processAttributes(taskModel,newTaskModel,parameterMap);
  processElements(taskModel,newTaskModel,elementMap);
  dispatchAspectsSettings(parameterMap,elementMap);
  checkForUnusedSettings(parameterMap,elementMap);
  return newTaskModel;
}

Fixed version (ground truth):
private final Configuration prepareAspects(final Configuration taskModel) throws TaskException {
  final DefaultConfiguration newTaskModel=new DefaultConfiguration(taskModel.getName(),taskModel.getLocation());
  final HashMap parameterMap=new HashMap();
  final HashMap elementMap=new HashMap();
  processAttributes(taskModel,newTaskModel,parameterMap);
  processElements(taskModel,newTaskModel,elementMap);
  try {
    newTaskModel.setValue(taskModel.getValue());
  }
 catch (  final ConfigurationException cee) {
  }
  dispatchAspectsSettings(parameterMap,elementMap);
  checkForUnusedSettings(parameterMap,elementMap);
  return newTaskModel;
}
Program: 64332
Project: 64332
Buggy source:
/** 
 * Move the generated source file(s) to the base directory
 * @param baseDir Description of Parameter
 * @param sourceBaseFile Description of Parameter
 * @param classname Description of Parameter
 * @param adapter Description of Parameter
 * @exception TaskException Description of Exception
 */
private void moveGeneratedFile(File baseDir,File sourceBaseFile,String classname,RmicAdapter adapter) throws TaskException {
  String classFileName=classname.replace('.',File.separatorChar) + "String_Node_Str";
  String[] generatedFiles=adapter.getMapper().mapFileName(classFileName);
  for (int i=0; i < generatedFiles.length; i++) {
    String sourceFileName=classFileName.substring(0,classFileName.length() - 6) + "String_Node_Str";
    File oldFile=new File(baseDir,sourceFileName);
    File newFile=new File(sourceBaseFile,sourceFileName);
    try {
      FileUtils.newFileUtils().copyFile(oldFile,newFile,filtering);
      oldFile.delete();
    }
 catch (    IOException ioe) {
      String msg="String_Node_Str" + oldFile + "String_Node_Str"+ newFile+ "String_Node_Str"+ ioe.getMessage();
      throw new TaskException(msg,ioe);
    }
  }
}

Fixed version (ground truth):
/** 
 * Move the generated source file(s) to the base directory
 * @param baseDir Description of Parameter
 * @param sourceBaseFile Description of Parameter
 * @param classname Description of Parameter
 * @param adapter Description of Parameter
 * @exception TaskException Description of Exception
 */
private void moveGeneratedFile(File baseDir,File sourceBaseFile,String classname,RmicAdapter adapter) throws TaskException {
  String classFileName=classname.replace('.',File.separatorChar) + "String_Node_Str";
  String[] generatedFiles=adapter.getMapper().mapFileName(classFileName);
  for (int i=0; i < generatedFiles.length; i++) {
    String sourceFileName=classFileName.substring(0,classFileName.length() - 6) + "String_Node_Str";
    File oldFile=new File(baseDir,sourceFileName);
    File newFile=new File(sourceBaseFile,sourceFileName);
    try {
      if (filtering) {
        final FilterSetCollection filters=new FilterSetCollection(project.getGlobalFilterSet());
        FileUtils.newFileUtils().copyFile(oldFile,newFile,filters);
      }
 else {
        FileUtils.newFileUtils().copyFile(oldFile,newFile);
      }
      oldFile.delete();
    }
 catch (    IOException ioe) {
      String msg="String_Node_Str" + oldFile + "String_Node_Str"+ newFile+ "String_Node_Str"+ ioe.getMessage();
      throw new TaskException(msg,ioe);
    }
  }
}
Program: 64336
Project: 64336
Buggy source:
/** 
 * Move the generated source file(s) to the base directory
 * @param baseDir Description of Parameter
 * @param sourceBaseFile Description of Parameter
 * @param classname Description of Parameter
 * @param adapter Description of Parameter
 * @exception TaskException Description of Exception
 */
private void moveGeneratedFile(File baseDir,File sourceBaseFile,String classname,RmicAdapter adapter) throws TaskException {
  String classFileName=classname.replace('.',File.separatorChar) + "String_Node_Str";
  String[] generatedFiles=adapter.getMapper().mapFileName(classFileName);
  for (int i=0; i < generatedFiles.length; i++) {
    String sourceFileName=classFileName.substring(0,classFileName.length() - 6) + "String_Node_Str";
    File oldFile=new File(baseDir,sourceFileName);
    File newFile=new File(sourceBaseFile,sourceFileName);
    try {
      FileUtils.newFileUtils().copyFile(oldFile,newFile,filtering);
      oldFile.delete();
    }
 catch (    IOException ioe) {
      String msg="String_Node_Str" + oldFile + "String_Node_Str"+ newFile+ "String_Node_Str"+ ioe.getMessage();
      throw new TaskException(msg,ioe);
    }
  }
}

Fixed version (ground truth):
/** 
 * Move the generated source file(s) to the base directory
 * @param baseDir Description of Parameter
 * @param sourceBaseFile Description of Parameter
 * @param classname Description of Parameter
 * @param adapter Description of Parameter
 * @exception TaskException Description of Exception
 */
private void moveGeneratedFile(File baseDir,File sourceBaseFile,String classname,RmicAdapter adapter) throws TaskException {
  String classFileName=classname.replace('.',File.separatorChar) + "String_Node_Str";
  String[] generatedFiles=adapter.getMapper().mapFileName(classFileName);
  for (int i=0; i < generatedFiles.length; i++) {
    String sourceFileName=classFileName.substring(0,classFileName.length() - 6) + "String_Node_Str";
    File oldFile=new File(baseDir,sourceFileName);
    File newFile=new File(sourceBaseFile,sourceFileName);
    try {
      if (filtering) {
        final FilterSetCollection filters=new FilterSetCollection(project.getGlobalFilterSet());
        FileUtils.newFileUtils().copyFile(oldFile,newFile,filters);
      }
 else {
        FileUtils.newFileUtils().copyFile(oldFile,newFile);
      }
      oldFile.delete();
    }
 catch (    IOException ioe) {
      String msg="String_Node_Str" + oldFile + "String_Node_Str"+ newFile+ "String_Node_Str"+ ioe.getMessage();
      throw new TaskException(msg,ioe);
    }
  }
}
Program: 64337
Project: 64337
Buggy source:
/** 
 * create the parameters file that contains all file to merge and the output filename.
 */
protected File createParamFile() throws BuildException {
  File[] snapshots=getSnapshots();
  File file=createTmpFile();
  FileWriter fw=null;
  try {
    fw=new FileWriter(file);
    PrintWriter pw=new PrintWriter(fw);
    for (int i=0; i < snapshots.length; i++) {
      pw.println(snapshots[i].getAbsolutePath());
    }
    pw.println(project.resolveFile(tofile.getPath()));
    pw.flush();
    return file;
  }
 catch (  IOException e) {
    if (fw != null) {
      try {
        fw.close();
      }
 catch (      IOException ignored) {
      }
    }
    throw new BuildException("String_Node_Str" + file,e);
  }
}

Fixed version (ground truth):
/** 
 * create the parameters file that contains all file to merge and the output filename.
 */
protected File createParamFile() throws BuildException {
  File[] snapshots=getSnapshots();
  File file=createTmpFile();
  FileWriter fw=null;
  try {
    fw=new FileWriter(file);
    PrintWriter pw=new PrintWriter(fw);
    for (int i=0; i < snapshots.length; i++) {
      pw.println(snapshots[i].getAbsolutePath());
    }
    pw.println(project.resolveFile(tofile.getPath()));
    pw.flush();
  }
 catch (  IOException e) {
    throw new BuildException("String_Node_Str" + file,e);
  }
 finally {
    if (fw != null) {
      try {
        fw.close();
      }
 catch (      IOException ignored) {
      }
    }
  }
  return file;
}
Program: 64338
Project: 64338
Buggy source:
/** 
 * create an empty class element with its default cov.data (0) 
 */
protected Element createClassElement(ClassFile classFile){
  Element classElem=report.createElement("String_Node_Str");
  classElem.setAttribute("String_Node_Str",classFile.getName());
  classElem.setAttribute("String_Node_Str",classFile.getSourceFile());
  Element classData=report.createElement("String_Node_Str");
  classElem.appendChild(classData);
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  return classElem;
}

Fixed version (ground truth):
/** 
 * create an empty class element with its default cov.data (0) 
 */
protected Element createClassElement(ClassFile classFile){
  Element classElem=report.createElement("String_Node_Str");
  classElem.setAttribute("String_Node_Str",classFile.getName());
  if (null != classFile.getSourceFile()) {
    classElem.setAttribute("String_Node_Str",classFile.getSourceFile());
  }
  Element classData=report.createElement("String_Node_Str");
  classElem.appendChild(classData);
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  classData.setAttribute("String_Node_Str","String_Node_Str");
  return classElem;
}
Program: 64339
Project: 64339
Buggy source:
/** 
 * Create a nested <src ...> element for multiple source path support.
 * @return a nexted src element.
 */
public Path createSrc(){
  if (src == null) {
    src=new Path(project);
  }
  return src.createPath();
}

Fixed version (ground truth):
/** 
 * Create a nested src element for multiple source path support.
 * @return a nested src element.
 */
public Path createSrc(){
  if (src == null) {
    src=new Path(project);
  }
  return src.createPath();
}
Program: 64340
Project: 64340
Buggy source:
/** 
 * Nested <replacevalue> element.
 */
public NestedString createReplaceValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * Nested &lt;replacevalue&gt; element.
 */
public NestedString createReplaceValue(){
  return value;
}
Program: 64341
Project: 64341
Buggy source:
/** 
 * Add nested <replacefilter> element.
 */
public Replacefilter createReplacefilter(){
  Replacefilter filter=new Replacefilter();
  replacefilters.addElement(filter);
  return filter;
}

Fixed version (ground truth):
/** 
 * Add nested &lt;replacefilter&gt; element.
 */
public Replacefilter createReplacefilter(){
  Replacefilter filter=new Replacefilter();
  replacefilters.addElement(filter);
  return filter;
}
Program: 64342
Project: 64342
Buggy source:
/** 
 * Nested <replacetoken> element.
 */
public NestedString createReplaceToken(){
  if (token == null) {
    token=new NestedString();
  }
  return token;
}

Fixed version (ground truth):
/** 
 * Nested &lt;replacetoken&gt; element.
 */
public NestedString createReplaceToken(){
  if (token == null) {
    token=new NestedString();
  }
  return token;
}
Program: 64343
Project: 64343
Buggy source:
/** 
 * @exception java.io.IOException <description>
 */
public void start() throws IOException {
}

Fixed version (ground truth):
/** 
 * @exception java.io.IOException
 */
public void start() throws IOException {
}
Program: 64344
Project: 64344
Buggy source:
/** 
 * @param param1 <description>
 * @exception java.io.IOException <description>
 */
public void setProcessErrorStream(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String s=reader.readLine();
  if (s != null) {
    log("String_Node_Str" + s,Project.MSG_DEBUG);
  }
}

Fixed version (ground truth):
/** 
 * @param param1
 * @exception java.io.IOException
 */
public void setProcessErrorStream(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String s=reader.readLine();
  if (s != null) {
    log("String_Node_Str" + s,Project.MSG_DEBUG);
  }
}
Program: 64345
Project: 64345
Buggy source:
/** 
 * @param param1 <description>
 * @exception java.io.IOException <description>
 */
public void setProcessInputStream(OutputStream param1) throws IOException {
}

Fixed version (ground truth):
/** 
 * @param param1
 * @exception java.io.IOException
 */
public void setProcessInputStream(OutputStream param1) throws IOException {
}
Program: 64346
Project: 64346
Buggy source:
/** 
 * @param param1 <description>
 * @exception java.io.IOException <description>
 */
public void setProcessErrorStream(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String s=reader.readLine();
  if (s != null) {
    log("String_Node_Str" + s,Project.MSG_DEBUG);
  }
}

Fixed version (ground truth):
/** 
 * @param param1
 * @exception java.io.IOException
 */
public void setProcessErrorStream(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String s=reader.readLine();
  if (s != null) {
    log("String_Node_Str" + s,Project.MSG_DEBUG);
  }
}
Program: 64347
Project: 64347
Buggy source:
/** 
 * @param param1 <description>
 * @exception java.io.IOException <description>
 */
public void setProcessOutputStream(InputStream is) throws IOException {
  try {
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    String javafile;
    while ((javafile=reader.readLine()) != null) {
      log("String_Node_Str" + javafile,Project.MSG_DEBUG);
      if (javafile.endsWith("String_Node_Str")) {
        String classfile=toClassFile(javafile);
        String key=classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1);
        log("String_Node_Str" + classfile,Project.MSG_DEBUG);
        log("String_Node_Str" + key,Project.MSG_DEBUG);
        _genfiles.put(key,new File(classfile));
      }
    }
    reader.close();
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.toString();
    throw new BuildException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * @param is
 * @exception java.io.IOException
 */
public void setProcessOutputStream(InputStream is) throws IOException {
  try {
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    String javafile;
    while ((javafile=reader.readLine()) != null) {
      log("String_Node_Str" + javafile,Project.MSG_DEBUG);
      if (javafile.endsWith("String_Node_Str")) {
        String classfile=toClassFile(javafile);
        String key=classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1);
        log("String_Node_Str" + classfile,Project.MSG_DEBUG);
        log("String_Node_Str" + key,Project.MSG_DEBUG);
        _genfiles.put(key,new File(classfile));
      }
    }
    reader.close();
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.toString();
    throw new BuildException(msg,e);
  }
}
Program: 64348
Project: 64348
Buggy source:
/** 
 * Getter method that returns the value of the <ejb-name> element.
 */
public String getEjbName(){
  return ejbName;
}

Fixed version (ground truth):
/** 
 * Getter method that returns the value of the &lt;ejb-name&gt; element.
 */
public String getEjbName(){
  return ejbName;
}
Program: 64349
Project: 64349
Buggy source:
/** 
 * A subTask <write> tag was found.  Create the object,  Save it in our list, and return it.
 */
public TelnetSubTask createWrite(){
  TelnetSubTask task=(TelnetSubTask)new TelnetWrite();
  telnetTasks.addElement(task);
  return task;
}

Fixed version (ground truth):
/** 
 * A subTask &lt;write&gt; tag was found.  Create the object,  Save it in our list, and return it.
 */
public TelnetSubTask createWrite(){
  TelnetSubTask task=(TelnetSubTask)new TelnetWrite();
  telnetTasks.addElement(task);
  return task;
}
Program: 64350
Project: 64350
Buggy source:
/** 
 * A subTask <read> tag was found.  Create the object,  Save it in our list, and return it.
 */
public TelnetSubTask createRead(){
  TelnetSubTask task=(TelnetSubTask)new TelnetRead();
  telnetTasks.addElement(task);
  return task;
}

Fixed version (ground truth):
/** 
 * A subTask &lt;read&gt; tag was found.  Create the object,  Save it in our list, and return it.
 */
public TelnetSubTask createRead(){
  TelnetSubTask task=(TelnetSubTask)new TelnetRead();
  telnetTasks.addElement(task);
  return task;
}
Program: 64351
Project: 64351
Buggy source:
/** 
 * if no host is set, returning ':<port>', will take localhost 
 */
public String toString(){
  return host + "String_Node_Str" + port;
}

Fixed version (ground truth):
/** 
 * if no host is set, returning ':&lt;port&gt;', will take localhost 
 */
public String toString(){
  return host + "String_Node_Str" + port;
}
Program: 64352
Project: 64352
Buggy source:
/** 
 * Convert to a CovReport-like signature ie, <classname>.<method>()
 */
protected String getMethodSignature(ClassFile clazz,MethodInfo method){
  StringBuffer buf=new StringBuffer(clazz.getFullName());
  buf.append("String_Node_Str");
  buf.append(method.getName());
  buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Convert to a CovReport-like signature ie, &lt;classname&gt;.&lt;method&gt;()
 */
protected String getMethodSignature(ClassFile clazz,MethodInfo method){
  StringBuffer buf=new StringBuffer(clazz.getFullName());
  buf.append("String_Node_Str");
  buf.append(method.getName());
  buf.append("String_Node_Str");
  return buf.toString();
}
Program: 64353
Project: 64353
Buggy source:
public void execute() throws BuildException {
  if (null == jar && null == filesets) {
    throw new BuildException("String_Node_Str");
  }
  if (null != jar) {
    doOneJar(jar,signedjar);
    return;
  }
 else {
    for (int i=0; i < filesets.size(); i++) {
      FileSet fs=(FileSet)filesets.elementAt(i);
      DirectoryScanner ds=fs.getDirectoryScanner(project);
      String[] jarFiles=ds.getIncludedFiles();
      for (int j=0; j < jarFiles.length; j++) {
        doOneJar(new File(jarFiles[j]),null);
      }
    }
  }
}

Fixed version (ground truth):
public void execute() throws BuildException {
  if (null == jar && null == filesets) {
    throw new BuildException("String_Node_Str");
  }
  if (null != jar) {
    doOneJar(jar,signedjar);
    return;
  }
 else {
    for (int i=0; i < filesets.size(); i++) {
      FileSet fs=(FileSet)filesets.elementAt(i);
      DirectoryScanner ds=fs.getDirectoryScanner(project);
      String[] jarFiles=ds.getIncludedFiles();
      for (int j=0; j < jarFiles.length; j++) {
        doOneJar(new File(fs.getDir(project),jarFiles[j]),null);
      }
    }
  }
}
Program: 64354
Project: 64354
Buggy source:
public void process(String line){
  if (!util.match("String_Node_Str",line)) {
    if (util.match("String_Node_Str",line)) {
      log("String_Node_Str",Project.MSG_VERBOSE);
      throw new BuildException("String_Node_Str");
    }
 else     if (util.match("String_Node_Str",line)) {
      line=util.substitute("String_Node_Str" + description + "String_Node_Str",line);
    }
 else     if (util.match("String_Node_Str",line)) {
      return;
    }
    stringbuf.append(line);
    stringbuf.append("String_Node_Str");
  }
}

Fixed version (ground truth):
public void process(String line){
  if (!util.match("String_Node_Str",line)) {
    if (util.match("String_Node_Str",line)) {
      log("String_Node_Str",Project.MSG_VERBOSE);
      throw new BuildException("String_Node_Str");
    }
 else     if (util.match("String_Node_Str",line)) {
      description=backslash(description);
      line=util.substitute("String_Node_Str" + description + "String_Node_Str",line);
    }
 else     if (util.match("String_Node_Str",line)) {
      return;
    }
    stringbuf.append(line);
    stringbuf.append("String_Node_Str");
  }
}
Program: 64355
Project: 64355
Buggy source:
public String getEmptyChangeList() throws BuildException {
  final StringBuffer stringbuf=new StringBuffer();
  execP4Command("String_Node_Str",new P4HandlerAdapter(){
    public void process(    String line){
      if (!util.match("String_Node_Str",line)) {
        if (util.match("String_Node_Str",line)) {
          log("String_Node_Str",Project.MSG_VERBOSE);
          throw new BuildException("String_Node_Str");
        }
 else         if (util.match("String_Node_Str",line)) {
          line=util.substitute("String_Node_Str" + description + "String_Node_Str",line);
        }
 else         if (util.match("String_Node_Str",line)) {
          return;
        }
        stringbuf.append(line);
        stringbuf.append("String_Node_Str");
      }
    }
  }
);
  return stringbuf.toString();
}

Fixed version (ground truth):
public String getEmptyChangeList() throws BuildException {
  final StringBuffer stringbuf=new StringBuffer();
  execP4Command("String_Node_Str",new P4HandlerAdapter(){
    public void process(    String line){
      if (!util.match("String_Node_Str",line)) {
        if (util.match("String_Node_Str",line)) {
          log("String_Node_Str",Project.MSG_VERBOSE);
          throw new BuildException("String_Node_Str");
        }
 else         if (util.match("String_Node_Str",line)) {
          description=backslash(description);
          line=util.substitute("String_Node_Str" + description + "String_Node_Str",line);
        }
 else         if (util.match("String_Node_Str",line)) {
          return;
        }
        stringbuf.append(line);
        stringbuf.append("String_Node_Str");
      }
    }
  }
);
  return stringbuf.toString();
}
Program: 64356
Project: 64356
Buggy source:
/** 
 * Sets whether to fork the javac compiler.
 * @param f "true|false|on|off|yes|no" or the name of the javacexecutable.
 */
public void setFork(String f){
  if (f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str")) {
    fork="String_Node_Str";
    forkedExecutable=getSystemJavac();
  }
 else   if (f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str")) {
    fork="String_Node_Str";
  }
 else {
    fork="String_Node_Str";
    forkedExecutable=f;
  }
}

Fixed version (ground truth):
/** 
 * Sets whether to fork the javac compiler.
 * @param f "true|false|on|off|yes|no" or the name of the javacexecutable.
 */
public void setFork(String f){
  if (f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str")) {
    fork="String_Node_Str";
    forkedExecutable=getSystemJavac();
  }
 else   if (f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str") || f.equalsIgnoreCase("String_Node_Str")) {
    fork="String_Node_Str";
    forkedExecutable=null;
  }
 else {
    fork="String_Node_Str";
    forkedExecutable=f;
  }
}
Program: 64357
Project: 64357
Buggy source:
/** 
 * The name of the javac executable to use in fork-mode.
 */
public String getJavacExecutable(){
  return forkedExecutable;
}

Fixed version (ground truth):
/** 
 * The name of the javac executable to use in fork-mode.
 */
public String getJavacExecutable(){
  if (forkedExecutable == null && isForkedJavac()) {
    forkedExecutable=getSystemJavac();
  }
 else   if (forkedExecutable != null && !isForkedJavac()) {
    forkedExecutable=null;
  }
  return forkedExecutable;
}
Program: 64358
Project: 64358
Buggy source:
/** 
 * Handle operations for type <code>int</code>.
 * @param oldValue the current value read from the property file or<code>null</code> if the <code>key</code> was not contained in the property file.
 */
private void executeInteger(String oldValue) throws BuildException {
  int value=0;
  int newValue=0;
  DecimalFormat fmt=(m_pattern != null) ? new DecimalFormat(m_pattern) : new DecimalFormat();
  if (oldValue != null) {
    try {
      value=fmt.parse(oldValue).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_value != null) {
    try {
      value=fmt.parse(m_value).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_default != null && oldValue == null) {
    try {
      value=fmt.parse(m_default).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_operation == Operation.EQUALS_OPER) {
    newValue=value;
  }
 else   if (m_operation == Operation.INCREMENT_OPER) {
    newValue+=value;
  }
 else   if (m_operation == Operation.DECREMENT_OPER) {
    newValue-=value;
  }
  m_value=fmt.format(newValue);
}

Fixed version (ground truth):
/** 
 * Handle operations for type <code>int</code>.
 * @param oldValue the current value read from the property file or<code>null</code> if the <code>key</code> was not contained in the property file.
 */
private void executeInteger(String oldValue) throws BuildException {
  int value=0;
  int newValue=0;
  DecimalFormat fmt=(m_pattern != null) ? new DecimalFormat(m_pattern) : new DecimalFormat();
  if (oldValue != null) {
    try {
      value=fmt.parse(oldValue).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_value != null) {
    try {
      value=fmt.parse(m_value).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_default != null && oldValue == null) {
    try {
      value=fmt.parse(m_default).intValue();
    }
 catch (    NumberFormatException nfe) {
    }
catch (    ParseException pe) {
    }
  }
  if (m_operation == Operation.EQUALS_OPER) {
    newValue=value;
  }
 else   if (m_operation == Operation.INCREMENT_OPER) {
    newValue=++value;
  }
 else   if (m_operation == Operation.DECREMENT_OPER) {
    newValue=--value;
  }
  m_value=fmt.format(newValue);
}
Program: 64359
Project: 64359
Buggy source:
/** 
 * SAX parser call-back method that is invoked when an element is exited. Used to blank out (set to the empty string, not nullify) the name of the currentAttribute.  A better method would be to use a stack as an instance variable, however since we are only interested in leaf-node data this is a simpler and workable solution.
 * @param name The name of the attribute being exited. Ignoredin this implementation.
 */
public void endElement(String name) throws SAXException {
}

Fixed version (ground truth):
/** 
 * SAX parser call-back method that is invoked when an element is exited. Used to blank out (set to the empty string, not nullify) the name of the currentAttribute.  A better method would be to use a stack as an instance variable, however since we are only interested in leaf-node data this is a simpler and workable solution.
 * @param name The name of the attribute being exited. Ignoredin this implementation.
 */
public void endElement(String name) throws SAXException {
  processElement();
  currentText="String_Node_Str";
  this.currentElement="String_Node_Str";
  if (name.equals(EJB_REF)) {
    inEJBRef=false;
  }
 else   if (parseState == STATE_IN_ENTITY && name.equals(ENTITY_BEAN)) {
    parseState=STATE_IN_BEANS;
  }
 else   if (parseState == STATE_IN_SESSION && name.equals(SESSION_BEAN)) {
    parseState=STATE_IN_BEANS;
  }
 else   if (parseState == STATE_IN_MESSAGE && name.equals(MESSAGE_BEAN)) {
    parseState=STATE_IN_BEANS;
  }
 else   if (parseState == STATE_IN_BEANS && name.equals(ENTERPRISE_BEANS)) {
    parseState=STATE_IN_EJBJAR;
  }
 else   if (parseState == STATE_IN_EJBJAR && name.equals(EJB_JAR)) {
    parseState=STATE_LOOKING_EJBJAR;
  }
}
Program: 64361
Project: 64361
Buggy source:
/** 
 * Apply a template on a part of the xml document.
 * @param root root of the document fragment
 * @param xslfile style file
 * @param outfilename filename of the result of the style applied on the Node
 * @throws SAXException SAX Parsing Error on the style Sheet.
 */
protected void transform(Node root,String xslname,String htmlname) throws SAXException {
  try {
    final long t0=System.currentTimeMillis();
    XSLTInputSource xsl_source=getXSLStreamSource(xslname);
    XSLTProcessor processor=XSLTProcessorFactory.getProcessor();
    File htmlfile=new File(toDir,htmlname);
    File dir=new File(htmlfile.getParent());
    if (!dir.exists()) {
      dir.mkdirs();
    }
    task.log("String_Node_Str" + xslname + "String_Node_Str"+ htmlfile+ "String_Node_Str",Project.MSG_VERBOSE);
    processor.process(new XSLTInputSource(root),xsl_source,new XSLTResultTarget(htmlfile.getAbsolutePath()));
    final long dt=System.currentTimeMillis() - t0;
    task.log("String_Node_Str" + xslname + "String_Node_Str"+ dt+ "String_Node_Str");
  }
 catch (  IOException e) {
    task.log(e.getMessage(),Project.MSG_ERR);
    e.printStackTrace();
    throw new SAXException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Apply a template on a part of the xml document.
 * @param root root of the document fragment
 * @param xslfile style file
 * @param outfilename filename of the result of the style applied on the Node
 * @throws SAXException SAX Parsing Error on the style Sheet.
 */
protected void transform(Node root,String xslname,String htmlname) throws SAXException {
  try {
    XSLTInputSource xsl_source=getXSLStreamSource(xslname);
    XSLTProcessor processor=XSLTProcessorFactory.getProcessor();
    File htmlfile=new File(toDir,htmlname);
    File dir=new File(htmlfile.getParent());
    if (!dir.exists()) {
      dir.mkdirs();
    }
    task.log("String_Node_Str" + xslname + "String_Node_Str"+ htmlfile+ "String_Node_Str",Project.MSG_VERBOSE);
    processor.process(new XSLTInputSource(root),xsl_source,new XSLTResultTarget(htmlfile.getAbsolutePath()));
  }
 catch (  IOException e) {
    task.log(e.getMessage(),Project.MSG_ERR);
    e.printStackTrace();
    throw new SAXException(e.getMessage());
  }
}
Program: 64362
Project: 64362
Buggy source:
/** 
 * default xsls are embedded in the distribution jar. As a default we will use them, otherwise we will get the one supplied by the client in a given directory. It must have the same name.
 */
protected XSLTInputSource getXSLStreamSource(String name) throws IOException {
  InputStream in;
  String systemId;
  if (styleDir == null) {
    in=getResourceAsStream("String_Node_Str" + name);
    systemId=getClass().getResource("String_Node_Str" + name).toString();
  }
 else {
    File f=new File(styleDir,name);
    in=new FileInputStream(f);
    systemId=f.getAbsolutePath();
  }
  XSLTInputSource ss=new XSLTInputSource(in);
  ss.setSystemId(systemId);
  return ss;
}

Fixed version (ground truth):
/** 
 * default xsls are embedded in the distribution jar. As a default we will use them, otherwise we will get the one supplied by the client in a given directory. It must have the same name.
 */
protected XSLTInputSource getXSLStreamSource(String name) throws IOException {
  InputStream in;
  String systemId;
  if (styleDir == null) {
    in=getResourceAsStream("String_Node_Str" + name);
    systemId=getClass().getResource("String_Node_Str" + name).toString();
  }
 else {
    File f=new File(styleDir,name);
    in=new FileInputStream(f);
    systemId="String_Node_Str" + f.getAbsolutePath();
  }
  XSLTInputSource ss=new XSLTInputSource(in);
  ss.setSystemId(systemId);
  return ss;
}
Program: 64363
Project: 64363
Buggy source:
public void init(String propType,AttributeList attrs) throws SAXParseException {
  try {
    element=project.createDataType(propType);
    if (element == null) {
      throw new BuildException("String_Node_Str" + propType);
    }
    configureId(element,attrs);
    if (target != null) {
      wrapper=new RuntimeConfigurable(element);
      wrapper.setAttributes(attrs);
      target.addDataType(wrapper);
    }
 else {
      configure(element,attrs,project);
    }
  }
 catch (  BuildException exc) {
    throw new SAXParseException(exc.getMessage(),locator,exc);
  }
}

Fixed version (ground truth):
public void init(String propType,AttributeList attrs) throws SAXParseException {
  try {
    element=project.createDataType(propType);
    if (element == null) {
      throw new BuildException("String_Node_Str" + propType);
    }
    if (target != null) {
      wrapper=new RuntimeConfigurable(element);
      wrapper.setAttributes(attrs);
      target.addDataType(wrapper);
    }
 else {
      configure(element,attrs,project);
      configureId(element,attrs);
    }
  }
 catch (  BuildException exc) {
    throw new SAXParseException(exc.getMessage(),locator,exc);
  }
}
Program: 64364
Project: 64364
Buggy source:
public void setupDirectoryScanner(FileScanner ds,Project p){
  if (ds == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ds.setBasedir(dir);
  for (int i=0; i < additionalPatterns.size(); i++) {
    Object o=additionalPatterns.elementAt(i);
    defaultPatterns.append((PatternSet)o,p);
  }
  ds.setIncludes(defaultPatterns.getIncludePatterns(p));
  ds.setExcludes(defaultPatterns.getExcludePatterns(p));
  if (useDefaultExcludes)   ds.addDefaultExcludes();
}

Fixed version (ground truth):
public void setupDirectoryScanner(FileScanner ds,Project p){
  if (ds == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ds.setBasedir(dir);
  for (int i=0; i < additionalPatterns.size(); i++) {
    Object o=additionalPatterns.elementAt(i);
    defaultPatterns.append((PatternSet)o,p);
  }
  p.log("String_Node_Str" + dir + "String_Node_Str"+ defaultPatterns,p.MSG_DEBUG);
  ds.setIncludes(defaultPatterns.getIncludePatterns(p));
  ds.setExcludes(defaultPatterns.getExcludePatterns(p));
  if (useDefaultExcludes)   ds.addDefaultExcludes();
}
Program: 64365
Project: 64365
Buggy source:
/** 
 * Create a type instance based on name.
 * @param name the name
 * @return the type instance
 * @exception TypeException if an error occurs
 */
public Object create(final String name) throws TypeException {
  TypeFactory factory=getTypeFactory(name);
  if (null == factory && null != m_parent) {
    m_parent.getTypeFactory(name);
  }
  if (null == factory)   return null;
 else {
    final Object object=factory.create(name);
    if (!m_type.isInstance(object)) {
      throw new TypeException("String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ m_type.getName()+ "String_Node_Str");
    }
    return object;
  }
}

Fixed version (ground truth):
/** 
 * Create a type instance based on name.
 * @param name the name
 * @return the type instance
 * @exception TypeException if an error occurs
 */
public Object create(final String name) throws TypeException {
  TypeFactory factory=getTypeFactory(name);
  if (null == factory && null != m_parent) {
    factory=m_parent.getTypeFactory(name);
  }
  if (null == factory) {
    throw new TypeException("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    final Object object=factory.create(name);
    if (!m_type.isInstance(object)) {
      throw new TypeException("String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ m_type.getName()+ "String_Node_Str");
    }
    return object;
  }
}
Program: 64366
Project: 64366
Buggy source:
/** 
 * Find the list of environment variables for this process.
 */
public static synchronized Vector getProcEnvironment(){
  if (procEnvironment != null)   return procEnvironment;
  procEnvironment=new Vector();
  try {
    ByteArrayOutputStream out=new ByteArrayOutputStream();
    Execute exe=new Execute(new PumpStreamHandler(out));
    exe.setCommandline(getProcEnvCommand());
    exe.setNewenvironment(true);
    int retval=exe.execute();
    if (retval != 0) {
    }
    BufferedReader in=new BufferedReader(new StringReader(out.toString()));
    String line;
    while ((line=in.readLine()) != null) {
      procEnvironment.addElement(line);
    }
  }
 catch (  java.io.IOException exc) {
    exc.printStackTrace();
  }
  return procEnvironment;
}

Fixed version (ground truth):
/** 
 * Find the list of environment variables for this process.
 */
public static synchronized Vector getProcEnvironment(){
  if (procEnvironment != null)   return procEnvironment;
  procEnvironment=new Vector();
  try {
    ByteArrayOutputStream out=new ByteArrayOutputStream();
    Execute exe=new Execute(new PumpStreamHandler(out));
    exe.setCommandline(getProcEnvCommand());
    exe.setNewenvironment(true);
    int retval=exe.execute();
    if (retval != 0) {
    }
    BufferedReader in=new BufferedReader(new StringReader(out.toString()));
    String var=null;
    String line, lineSep=System.getProperty("String_Node_Str");
    while ((line=in.readLine()) != null) {
      if (line.indexOf('=') == -1) {
        if (var == null) {
          var=lineSep + line;
        }
 else {
          var+=lineSep + line;
        }
      }
 else {
        if (var != null) {
          procEnvironment.addElement(var);
        }
        var=line;
      }
    }
    procEnvironment.addElement(var);
  }
 catch (  java.io.IOException exc) {
    exc.printStackTrace();
  }
  return procEnvironment;
}
Program: 64367
Project: 64367
Buggy source:
protected void loadEnvironment(String prefix){
  Properties props=new Properties();
  if (!prefix.endsWith("String_Node_Str"))   prefix+="String_Node_Str";
  log("String_Node_Str" + prefix,Project.MSG_VERBOSE);
  try {
    Vector osEnv=Execute.getProcEnvironment();
    for (Enumeration e=osEnv.elements(); e.hasMoreElements(); ) {
      String entry=(String)e.nextElement();
      int pos=entry.indexOf('=');
      props.put(prefix + entry.substring(0,pos),entry.substring(pos + 1));
    }
    addProperties(props);
  }
 catch (  Exception ex) {
    throw new BuildException(ex,location);
  }
}

Fixed version (ground truth):
protected void loadEnvironment(String prefix){
  Properties props=new Properties();
  if (!prefix.endsWith("String_Node_Str"))   prefix+="String_Node_Str";
  log("String_Node_Str" + prefix,Project.MSG_VERBOSE);
  try {
    Vector osEnv=Execute.getProcEnvironment();
    for (Enumeration e=osEnv.elements(); e.hasMoreElements(); ) {
      String entry=(String)e.nextElement();
      int pos=entry.indexOf('=');
      if (pos == -1) {
        log("String_Node_Str" + entry,Project.MSG_WARN);
      }
 else {
        props.put(prefix + entry.substring(0,pos),entry.substring(pos + 1));
      }
    }
    addProperties(props);
  }
 catch (  Exception ex) {
    throw new BuildException(ex,location);
  }
}
Program: 64368
Project: 64368
Buggy source:
/** 
 * Execute P4 command assembled by subclasses.
 * @param command The command to run
 * @param p4input Input to be fed to command on stdin
 * @param handler A P4Handler to process any input and output
 */
protected void execP4Command(String command,P4Handler handler) throws BuildException {
  try {
    Commandline commandline=new Commandline();
    commandline.setExecutable("String_Node_Str");
    commandline.createArgument().setValue(P4Port);
    commandline.createArgument().setValue(P4User);
    commandline.createArgument().setValue(P4Client);
    commandline.createArgument().setLine(command);
    log("String_Node_Str" + commandline.getCommandline(),Project.MSG_VERBOSE);
    if (handler == null)     handler=new SimpleP4OutputHandler(this);
    Execute exe=new Execute(handler,null);
    exe.setAntRun(project);
    exe.setCommandline(commandline.getCommandline());
    try {
      exe.execute();
    }
 catch (    IOException e) {
      throw new BuildException(e);
    }
 finally {
      try {
        handler.stop();
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  Exception e) {
    throw new BuildException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Execute P4 command assembled by subclasses.
 * @param command The command to run
 * @param p4input Input to be fed to command on stdin
 * @param handler A P4Handler to process any input and output
 */
protected void execP4Command(String command,P4Handler handler) throws BuildException {
  try {
    Commandline commandline=new Commandline();
    commandline.setExecutable("String_Node_Str");
    if (P4Port != null && P4Port.length() != 0) {
      commandline.createArgument().setValue(P4Port);
    }
    if (P4User != null && P4User.length() != 0) {
      commandline.createArgument().setValue(P4User);
    }
    if (P4Client != null && P4Client.length() != 0) {
      commandline.createArgument().setValue(P4Client);
    }
    commandline.createArgument().setLine(command);
    log("String_Node_Str" + commandline.getCommandline(),Project.MSG_VERBOSE);
    if (handler == null)     handler=new SimpleP4OutputHandler(this);
    Execute exe=new Execute(handler,null);
    exe.setAntRun(project);
    exe.setCommandline(commandline.getCommandline());
    try {
      exe.execute();
    }
 catch (    IOException e) {
      throw new BuildException(e);
    }
 finally {
      try {
        handler.stop();
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  Exception e) {
    throw new BuildException("String_Node_Str" + e.getMessage());
  }
}
Program: 64369
Project: 64369
Buggy source:
/** 
 * Called when an event is to be posed to the member.
 * @param event Event to post.
 * @return true if event should be propogated, false ifit should be cancelled.
 */
public boolean eventPosted(EventObject event){
  ElementSelectionEvent e=(ElementSelectionEvent)event;
  String text=_defText;
  ACSElement[] selected=e.getSelectedElements();
  if (selected != null && selected.length > 0) {
    StringBuffer buf=new StringBuffer();
    for (int i=0; i < selected.length; i++) {
      if (selected[i] instanceof ACSTargetElement) {
        if (buf.length() > 0) {
          buf.append("String_Node_Str");
        }
        buf.append(((ACSTargetElement)selected[i]).getName());
      }
    }
    if (buf.length() > 0) {
      text=buf.toString();
    }
  }
  setText(text);
  return true;
}

Fixed version (ground truth):
/** 
 * Called when an event is to be posed to the member.
 * @param event Event to post.
 * @return true if event should be propogated, false ifit should be cancelled.
 */
public boolean eventPosted(EventObject event){
  ElementSelectionEvent e=(ElementSelectionEvent)event;
  String text=_defText;
  ACSElement[] selected=e.getSelectedElements();
  if (selected != null && selected.length > 0) {
    StringBuffer buf=new StringBuffer();
    String name=null;
    for (int i=0; i < selected.length; i++) {
      if (selected[i] instanceof ACSTargetElement) {
        name=((ACSTargetElement)selected[i]).getName();
        if (buf.toString().indexOf(name) < 0) {
          if (buf.length() > 0) {
            buf.append("String_Node_Str");
          }
          buf.append(name);
        }
      }
    }
    if (buf.length() > 0) {
      text=buf.toString();
    }
  }
  setText(text);
  return true;
}
Program: 64370
Project: 64370
Buggy source:
public void actionPerformed(ActionEvent e){
  JFileChooser chooser=null;
  if (_widget.getText().length() > 0) {
    chooser=new JFileChooser(_widget.getText());
  }
 else {
    chooser=new JFileChooser();
  }
  _filter=(_filter == null ? chooser.getAcceptAllFileFilter() : _filter);
  chooser.setFileFilter(_filter);
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  if (chooser.showDialog(getChild(),"String_Node_Str") == JFileChooser.APPROVE_OPTION) {
    Object oldValue=getValue();
    Object newValue=chooser.getSelectedFile();
    setValue(newValue);
    firePropertyChange(oldValue,newValue);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  JFileChooser chooser=null;
  chooser=new JFileChooser();
  chooser.setSelectedFile((File)getValue());
  _filter=(_filter == null ? chooser.getAcceptAllFileFilter() : _filter);
  chooser.setFileFilter(_filter);
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  if (chooser.showDialog(getChild(),"String_Node_Str") == JFileChooser.APPROVE_OPTION) {
    Object oldValue=getValue();
    Object newValue=chooser.getSelectedFile();
    setValue(newValue);
    firePropertyChange(oldValue,newValue);
  }
}
Program: 64371
Project: 64371
Buggy source:
public void actionPerformed(ActionEvent e){
  JFileChooser chooser=null;
  if (_widget.getText().length() > 0) {
    chooser=new JFileChooser(_widget.getText());
  }
 else   if (_path != null) {
    chooser=new JFileChooser(_path);
  }
 else {
    chooser=new JFileChooser();
  }
  _filter=(_filter == null ? chooser.getAcceptAllFileFilter() : _filter);
  chooser.setFileFilter(_filter);
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  if (chooser.showDialog(getChild(),"String_Node_Str") == JFileChooser.APPROVE_OPTION) {
    setValue(chooser.getSelectedFile());
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  JFileChooser chooser=null;
  if (_widget.getText().length() > 0) {
    chooser=new JFileChooser(_widget.getText());
  }
 else {
    chooser=new JFileChooser();
  }
  _filter=(_filter == null ? chooser.getAcceptAllFileFilter() : _filter);
  chooser.setFileFilter(_filter);
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  if (chooser.showDialog(getChild(),"String_Node_Str") == JFileChooser.APPROVE_OPTION) {
    Object oldValue=getValue();
    Object newValue=chooser.getSelectedFile();
    setValue(newValue);
    firePropertyChange(oldValue,newValue);
  }
}
Program: 64372
Project: 64372
Buggy source:
/** 
 * Default ctor.
 */
public FilePropertyEditor(){
  _container=new JPanel(new BorderLayout());
  _widget=new JTextField(){
    public boolean isManagingFocus(){
      return false;
    }
  }
;
  _widget.addFocusListener(new FocusHandler(this));
  _container.add(_widget,BorderLayout.CENTER);
  JButton b=new JButton("String_Node_Str");
  b.addActionListener(new ActionHandler());
  _container.add(b,BorderLayout.EAST);
}

Fixed version (ground truth):
/** 
 * Default ctor.
 */
public FilePropertyEditor(){
  _container=new JPanel(new BorderLayout());
  _widget=new JTextField();
  _widget.addFocusListener(new FocusHandler(this));
  _container.add(_widget,BorderLayout.CENTER);
  JButton b=new JButton("String_Node_Str");
  b.addActionListener(new ActionHandler());
  _container.add(b,BorderLayout.EAST);
}
Program: 64373
Project: 64373
Buggy source:
/** 
 * Called when an event is to be posted to the member.
 * @param event Event to post.
 * @return true if event should be propogated, false ifit should be cancelled.
 */
public boolean eventPosted(EventObject event){
  ElementSelectionEvent e=(ElementSelectionEvent)event;
  ACSElement[] elements=e.getSelectedElements();
  updateDisplay(elements);
  return true;
}

Fixed version (ground truth):
/** 
 * Called when an event is to be posted to the member.
 * @param event Event to post.
 * @return true if event should be propogated, false ifit should be cancelled.
 */
public boolean eventPosted(EventObject event){
  if (event instanceof ProjectClosedEvent) {
    updateDisplay(null);
  }
 else {
    ElementSelectionEvent e=(ElementSelectionEvent)event;
    ACSElement[] elements=e.getSelectedElements();
    updateDisplay(elements);
  }
  return true;
}
Program: 64374
Project: 64374
Buggy source:
/** 
 * Determines if the given event should be accepted.
 * @param event Event to test.
 * @return True if event should be given to BusMember, false otherwise.
 */
public boolean accept(EventObject event){
  return event instanceof ElementSelectionEvent;
}

Fixed version (ground truth):
/** 
 * Determines if the given event should be accepted.
 * @param event Event to test.
 * @return True if event should be given to BusMember, false otherwise.
 */
public boolean accept(EventObject event){
  return event instanceof ElementSelectionEvent || event instanceof ProjectClosedEvent;
}