nus-yam/ex-repair huggingface dataset:
Program: 70353
Project: 70353
Buggy source:
@Decaf(dfScript="String_Node_Str",mpiRunner="String_Node_Str",computingNodes="String_Node_Str") @Constraints(computingUnits="String_Node_Str") Integer taskConcurrentMultipleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);

Fixed version (ground truth):
@Constraints(computingUnits="String_Node_Str") Integer taskConcurrentMultipleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);
Program: 70354
Project: 70354
Buggy source:
@Decaf(dfScript="String_Node_Str",mpiRunner="String_Node_Str",computingNodes="String_Node_Str") @Constraints(computingUnits="String_Node_Str") int taskSingleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);

Fixed version (ground truth):
@Constraints(computingUnits="String_Node_Str") int taskSingleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);
Program: 70355
Project: 70355
Buggy source:
@Decaf(dfScript="String_Node_Str",mpiRunner="String_Node_Str",computingNodes="String_Node_Str") @Constraints(computingUnits="String_Node_Str") Integer taskMultipleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);

Fixed version (ground truth):
@Constraints(computingUnits="String_Node_Str") Integer taskMultipleDecaf(@Parameter(type=Type.FILE,direction=Direction.OUT,stream=Stream.STDOUT) String fileOut);
Program: 70356
Project: 70356
Buggy source:
/** 
 * Sets MPI / OMPSs environment variables
 */
private static void setEnvironmentVariables(){
  String hostname="String_Node_Str";
  try {
    hostname=InetAddress.getLocalHost().getHostName();
  }
 catch (  UnknownHostException e1) {
    ErrorManager.warn("String_Node_Str" + hostname);
  }
  GATWorker.hostnames.add(hostname);
  ++GATWorker.numNodes;
  boolean firstElement=true;
  StringBuilder hostnamesSTR=new StringBuilder();
  for (Iterator<String> it=GATWorker.hostnames.iterator(); it.hasNext(); ) {
    String nodeName=it.next();
    if (nodeName.endsWith("String_Node_Str")) {
      nodeName=nodeName.substring(0,hostname.lastIndexOf("String_Node_Str"));
    }
    if (firstElement) {
      firstElement=false;
      hostnamesSTR.append(hostname);
      for (int i=1; i < GATWorker.cus; ++i) {
        hostnamesSTR.append("String_Node_Str").append(hostname);
      }
    }
 else {
      for (int i=0; i < GATWorker.cus; ++i) {
        hostnamesSTR.append("String_Node_Str").append(hostname);
      }
    }
  }
  if (GATWorker.debug) {
    System.out.println("String_Node_Str" + hostnamesSTR.toString());
    System.out.println("String_Node_Str" + GATWorker.numNodes);
    System.out.println("String_Node_Str" + GATWorker.cus);
  }
  System.setProperty(Constants.COMPSS_HOSTNAMES,hostnamesSTR.toString());
  System.setProperty(Constants.COMPSS_NUM_NODES,String.valueOf(GATWorker.numNodes));
  System.setProperty(Constants.COMPSS_NUM_THREADS,String.valueOf(GATWorker.cus));
}

Fixed version (ground truth):
/** 
 * Sets MPI / OMPSs environment variables
 */
private static void setEnvironmentVariables(){
  String hostname="String_Node_Str";
  try {
    hostname=InetAddress.getLocalHost().getHostName();
  }
 catch (  UnknownHostException e1) {
    ErrorManager.warn("String_Node_Str" + hostname);
  }
  GATWorker.hostnames.add(hostname);
  ++GATWorker.numNodes;
  boolean firstElement=true;
  StringBuilder hostnamesSTR=new StringBuilder();
  for (  String nodeName : GATWorker.hostnames) {
    if (nodeName.endsWith("String_Node_Str")) {
      nodeName=nodeName.substring(0,nodeName.lastIndexOf("String_Node_Str"));
    }
    if (firstElement) {
      firstElement=false;
      hostnamesSTR.append(nodeName);
      for (int i=1; i < GATWorker.cus; ++i) {
        hostnamesSTR.append("String_Node_Str").append(nodeName);
      }
    }
 else {
      for (int i=0; i < GATWorker.cus; ++i) {
        hostnamesSTR.append("String_Node_Str").append(nodeName);
      }
    }
  }
  if (GATWorker.debug) {
    System.out.println("String_Node_Str" + hostnamesSTR.toString());
    System.out.println("String_Node_Str" + GATWorker.numNodes);
    System.out.println("String_Node_Str" + GATWorker.cus);
  }
  System.setProperty(Constants.COMPSS_HOSTNAMES,hostnamesSTR.toString());
  System.setProperty(Constants.COMPSS_NUM_NODES,String.valueOf(GATWorker.numNodes));
  System.setProperty(Constants.COMPSS_NUM_THREADS,String.valueOf(GATWorker.cus));
}
Program: 70357
Project: 70357
Buggy source:
private void deleteFolder(File folder){
  if (folder.isDirectory()) {
    for (    File f : folder.listFiles()) {
      deleteFolder(f);
    }
  }
  if (!folder.delete()) {
    logger.error("String_Node_Str" + (folder == null ? "String_Node_Str" : folder.getName()));
  }
}

Fixed version (ground truth):
private void deleteFolder(File folder){
  if (folder.isDirectory()) {
    for (    File f : folder.listFiles()) {
      deleteFolder(f);
    }
  }
  if (!folder.delete()) {
    LOGGER.error("String_Node_Str" + (folder == null ? "String_Node_Str" : folder.getName()));
  }
}
Program: 70359
Project: 70359
Buggy source:
private void waitForCopyTofinish(Copy copy){
  Semaphore sem=new Semaphore(0);
  SafeCopyListener currentCopylistener=new SafeCopyListener(sem);
  copy.addEventListener(currentCopylistener);
  currentCopylistener.addOperation();
  currentCopylistener.enable();
  try {
    sem.acquire();
  }
 catch (  InterruptedException ex) {
    ErrorManager.warn("String_Node_Str" + getName() + "String_Node_Str");
    Thread.currentThread().interrupt();
  }
  if (debug) {
    logger.debug("String_Node_Str" + copy.getName() + "String_Node_Str"+ copy.getId()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void waitForCopyTofinish(Copy copy){
  Semaphore sem=new Semaphore(0);
  SafeCopyListener currentCopylistener=new SafeCopyListener(sem);
  copy.addEventListener(currentCopylistener);
  currentCopylistener.addOperation();
  currentCopylistener.enable();
  try {
    sem.acquire();
  }
 catch (  InterruptedException ex) {
    ErrorManager.warn("String_Node_Str" + getName() + "String_Node_Str");
    Thread.currentThread().interrupt();
  }
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + copy.getName() + "String_Node_Str"+ copy.getId()+ "String_Node_Str");
  }
}
Program: 70360
Project: 70360
Buggy source:
@Override public void setWorkerIsReady(String nodeName){
  logger.info("String_Node_Str" + nodeName);
  WorkerStarter ws=WorkerStarter.getWorkerStarter(nodeName);
  if (ws != null) {
    ws.setWorkerIsReady();
  }
 else {
    logger.warn("String_Node_Str" + nodeName + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void setWorkerIsReady(String nodeName){
  logger.info("String_Node_Str" + nodeName + "String_Node_Str");
  WorkerStarter ws=WorkerStarter.getWorkerStarter(nodeName);
  if (ws != null) {
    ws.setWorkerIsReady();
  }
 else {
    logger.warn("String_Node_Str" + nodeName + "String_Node_Str");
  }
}
Program: 70362
Project: 70362
Buggy source:
public static Map<String,String> getEnvironment(NIOWorker nw){
  Map<String,String> env=new HashMap<>();
  String ldLibraryPath=System.getenv(LIBRARY_PATH_ENV);
  if (ldLibraryPath == null) {
    ldLibraryPath=nw.getLibPath();
  }
 else {
    ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getLibPath());
  }
  ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getInstallDir() + C_LIB_RELATIVE_PATH);
  ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getInstallDir() + COMMONS_LIB_RELATIVE_PATH);
  env.put("String_Node_Str",ldLibraryPath);
  return env;
}

Fixed version (ground truth):
public static Map<String,String> getEnvironment(NIOWorker nw){
  Map<String,String> env=new HashMap<>();
  String ldLibraryPath=System.getenv(LIBRARY_PATH_ENV);
  if (ldLibraryPath == null) {
    ldLibraryPath=nw.getLibPath();
  }
 else {
    ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getLibPath());
  }
  ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getInstallDir() + C_LIB_RELATIVE_PATH);
  ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getInstallDir() + BINDINGS_RELATIVE_PATH);
  env.put("String_Node_Str",ldLibraryPath);
  return env;
}
Program: 70363
Project: 70363
Buggy source:
public static Map<String,String> getEnvironment(NIOWorker nw){
  Map<String,String> env=new HashMap<>();
  String pycompssHome=nw.getInstallDir() + PYCOMPSS_RELATIVE_PATH;
  env.put("String_Node_Str",pycompssHome);
  String pythonPath=System.getenv("String_Node_Str");
  if (pythonPath == null) {
    pythonPath=pycompssHome + "String_Node_Str" + nw.getPythonpath()+ "String_Node_Str"+ nw.getAppDir();
  }
 else {
    pythonPath=pycompssHome + "String_Node_Str" + nw.getPythonpath()+ "String_Node_Str"+ nw.getAppDir()+ pythonPath;
  }
  env.put("String_Node_Str",pythonPath);
  String ldLibraryPath=System.getenv("String_Node_Str");
  if (ldLibraryPath == null) {
    ldLibraryPath=nw.getLibPath();
  }
 else {
    ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getLibPath());
  }
  env.put("String_Node_Str",ldLibraryPath);
  return env;
}

Fixed version (ground truth):
public static Map<String,String> getEnvironment(NIOWorker nw){
  Map<String,String> env=new HashMap<>();
  String pycompssHome=nw.getInstallDir() + PYCOMPSS_RELATIVE_PATH;
  env.put("String_Node_Str",pycompssHome);
  String pythonPath=System.getenv("String_Node_Str");
  if (pythonPath == null) {
    pythonPath=pycompssHome + "String_Node_Str" + nw.getPythonpath()+ "String_Node_Str"+ nw.getAppDir();
  }
 else {
    pythonPath=pycompssHome + "String_Node_Str" + nw.getPythonpath()+ "String_Node_Str"+ nw.getAppDir()+ pythonPath;
  }
  env.put("String_Node_Str",pythonPath);
  String ldLibraryPath=System.getenv("String_Node_Str");
  if (ldLibraryPath == null) {
    ldLibraryPath=nw.getLibPath();
  }
 else {
    ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + nw.getLibPath());
  }
  String bindingsHome=nw.getInstallDir() + BINDINGS_RELATIVE_PATH;
  ldLibraryPath=ldLibraryPath.concat("String_Node_Str" + bindingsHome);
  env.put("String_Node_Str",ldLibraryPath);
  return env;
}
Program: 70364
Project: 70364
Buggy source:
/** 
 * We have explicitly called the barrier API. STEPS: Add a new synchronization node. Add an edge from last synchronization point to barrier. Add edges from writer tasks to barrier
 */
private void addNewBarrier(){
  synchronizationId++;
  taskDetectedAfterSync=false;
  this.GM.addBarrierToGraph(synchronizationId);
  if (synchronizationId > 1) {
    this.GM.addEdgeToGraph("String_Node_Str" + (synchronizationId - 1),"String_Node_Str" + synchronizationId,"String_Node_Str");
  }
  for (  Task writer : writers.values()) {
    this.GM.addEdgeToGraph(String.valueOf(writer.getId()),"String_Node_Str" + synchronizationId,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * We have explicitly called the barrier API. STEPS: Add a new synchronization node. Add an edge from last synchronization point to barrier. Add edges from writer tasks to barrier
 */
private void addNewBarrier(){
  synchronizationId++;
  taskDetectedAfterSync=false;
  this.GM.addBarrierToGraph(synchronizationId);
  if (synchronizationId > 1) {
    this.GM.addEdgeToGraph("String_Node_Str" + (synchronizationId - 1),"String_Node_Str" + synchronizationId,"String_Node_Str");
  }
  HashSet<Task> uniqueWriters=new HashSet<>(writers.values());
  for (  Task writer : uniqueWriters) {
    if (writer.getSynchronizationId() == (synchronizationId - 1)) {
      this.GM.addEdgeToGraph(String.valueOf(writer.getId()),"String_Node_Str" + synchronizationId,"String_Node_Str");
    }
  }
}
Program: 70365
Project: 70365
Buggy source:
public static Integer align(String pFlag,String pMode,String dFlag,String database,String iFlag,String partitionFile,String oFlag,String partitionOutput){
  return -1;
}

Fixed version (ground truth):
/** 
 * Dummy implementation to call the BLAST binary for algin withou extra CMD args
 * @param pFlag
 * @param pMode
 * @param dFlag
 * @param database
 * @param iFlag
 * @param partitionFile
 * @param oFlag
 * @param partitionOutput
 * @return
 */
public static Integer align(String pFlag,String pMode,String dFlag,String database,String iFlag,String partitionFile,String oFlag,String partitionOutput){
  return -1;
}
Program: 70366
Project: 70366
Buggy source:
private static void parseArgs(String[] args){
  Blast.debug=Boolean.parseBoolean(args[0]);
  Blast.databasePath=args[1];
  Blast.inputFileName=args[2];
  Blast.numFragments=Integer.parseInt(args[3]);
  Blast.tmpDir=args[4];
  Blast.outputFileName=args[5];
  Blast.commandArgs="String_Node_Str";
  for (int i=6; i < args.length; i++) {
    Blast.commandArgs+=args[i] + "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Parses the input parameters and initializes the class atributes
 * @param args
 */
private static void parseArgs(String[] args){
  Blast.debug=Boolean.parseBoolean(args[0]);
  Blast.databasePath=args[1];
  Blast.inputFileName=args[2];
  Blast.numFragments=Integer.parseInt(args[3]);
  Blast.tmpDir=args[4];
  Blast.outputFileName=args[5];
  Blast.commandArgs="String_Node_Str";
  for (int i=6; i < args.length; i++) {
    Blast.commandArgs+=args[i] + "String_Node_Str";
  }
}
Program: 70367
Project: 70367
Buggy source:
private static void logArgs(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + System.getenv(ENV_BLAST_BINARY));
  System.out.println("String_Node_Str" + Blast.debug);
  System.out.println("String_Node_Str" + Blast.databasePath);
  System.out.println("String_Node_Str" + Blast.inputFileName);
  System.out.println("String_Node_Str" + Blast.numFragments);
  System.out.println("String_Node_Str" + Blast.tmpDir);
  System.out.println("String_Node_Str" + Blast.outputFileName);
  System.out.println("String_Node_Str" + Blast.commandArgs);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Prints the class attributes used for the execution
 */
private static void logArgs(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + System.getenv(ENV_BLAST_BINARY));
  System.out.println("String_Node_Str" + Blast.debug);
  System.out.println("String_Node_Str" + Blast.databasePath);
  System.out.println("String_Node_Str" + Blast.inputFileName);
  System.out.println("String_Node_Str" + Blast.numFragments);
  System.out.println("String_Node_Str" + Blast.tmpDir);
  System.out.println("String_Node_Str" + Blast.outputFileName);
  System.out.println("String_Node_Str" + Blast.commandArgs);
  System.out.println("String_Node_Str");
}
Program: 70368
Project: 70368
Buggy source:
public static void main(String[] args) throws BlastException {
}

Fixed version (ground truth):
/** 
 * MAIN CODE
 * @param args
 * @throws BlastException
 */
public static void main(String[] args) throws BlastException {
}
Program: 70369
Project: 70369
Buggy source:
public BlastException(String msg,Exception e){
  super(msg,e);
}

Fixed version (ground truth):
/** 
 * Constructs a new BlastException with a nested exception @e and error message @msg
 * @param msg
 * @param e
 */
public BlastException(String msg,Exception e){
  super(msg,e);
}
Program: 70370
Project: 70370
Buggy source:
/** 
 * Bind numCUs core units to the job
 * @param jobId
 * @param numCUs
 * @return
 * @throws UnsufficientAvailableComputingUnitsException
 */
public int[] bindComputingUnits(int jobId,int numCUs) throws UnsufficientAvailableComputingUnitsException {
  int assignedCoreUnits[]=new int[numCUs];
  int numAssignedCores=0;
synchronized (this.bindedComputingUnits) {
    for (int coreId=0; coreId < this.bindedComputingUnits.length; ++coreId) {
      if (this.bindedComputingUnits[coreId] == -1) {
        this.bindedComputingUnits[coreId]=jobId;
        assignedCoreUnits[numAssignedCores]=coreId;
        numAssignedCores++;
      }
      if (numAssignedCores == numCUs) {
        break;
      }
    }
    if (numAssignedCores != numCUs) {
      releaseComputingUnits(jobId);
      throw new UnsufficientAvailableComputingUnitsException("String_Node_Str");
    }
  }
  return assignedCoreUnits;
}

Fixed version (ground truth):
/** 
 * Bind numCUs core units to the job
 * @param jobId
 * @param numCUs
 * @return
 * @throws UnsufficientAvailableComputingUnitsException
 */
public int[] bindComputingUnits(int jobId,int numCUs) throws UnsufficientAvailableComputingUnitsException {
  if (numCUs == 0)   return new int[0];
  int assignedCoreUnits[]=new int[numCUs];
  int numAssignedCores=0;
synchronized (this.bindedComputingUnits) {
    for (int coreId=0; coreId < this.bindedComputingUnits.length; ++coreId) {
      if (this.bindedComputingUnits[coreId] == -1) {
        this.bindedComputingUnits[coreId]=jobId;
        assignedCoreUnits[numAssignedCores]=coreId;
        numAssignedCores++;
      }
      if (numAssignedCores == numCUs) {
        break;
      }
    }
    if (numAssignedCores != numCUs) {
      releaseComputingUnits(jobId);
      throw new UnsufficientAvailableComputingUnitsException("String_Node_Str");
    }
  }
  return assignedCoreUnits;
}
Program: 70371
Project: 70371
Buggy source:
private static void generateTrace(){
  if (debug) {
    logger.debug("String_Node_Str");
  }
  String script=System.getenv(ITConstants.IT_HOME) + TRACE_SCRIPT_PATH;
  String appName=System.getProperty(ITConstants.IT_APP_NAME);
  ProcessBuilder pb=new ProcessBuilder(script,"String_Node_Str",System.getProperty(ITConstants.IT_APP_LOG_DIR),appName,String.valueOf(hostToSlots.size() + 1));
  Process p;
  pb.environment().remove(LD_PRELOAD);
  try {
    p=pb.start();
  }
 catch (  IOException e) {
    ErrorManager.warn("String_Node_Str",e);
    return;
  }
  StreamGobbler outputGobbler=new StreamGobbler(p.getInputStream(),System.out);
  StreamGobbler errorGobbler=new StreamGobbler(p.getErrorStream(),System.err);
  outputGobbler.start();
  errorGobbler.start();
  int exitCode=0;
  try {
    exitCode=p.waitFor();
    if (exitCode != 0) {
      ErrorManager.warn("String_Node_Str" + exitCode);
    }
  }
 catch (  InterruptedException e) {
    ErrorManager.warn("String_Node_Str" + e.getMessage());
  }
  String lang=System.getProperty(ITConstants.IT_LANG);
  if (exitCode == 0 && lang.equalsIgnoreCase(ITConstants.Lang.PYTHON.name())) {
    try {
      new TraceMerger(System.getProperty(ITConstants.IT_APP_LOG_DIR),appName).merge();
    }
 catch (    IOException e) {
      ErrorManager.warn("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private static void generateTrace(){
  if (debug) {
    logger.debug("String_Node_Str");
  }
  String script=System.getenv(ITConstants.IT_HOME) + TRACE_SCRIPT_PATH;
  String appName=System.getProperty(ITConstants.IT_APP_NAME);
  ProcessBuilder pb=new ProcessBuilder(script,"String_Node_Str",System.getProperty(ITConstants.IT_APP_LOG_DIR),appName,String.valueOf(hostToSlots.size() + 1));
  Process p;
  pb.environment().remove(LD_PRELOAD);
  try {
    p=pb.start();
  }
 catch (  IOException e) {
    ErrorManager.warn("String_Node_Str",e);
    return;
  }
  StreamGobbler outputGobbler=new StreamGobbler(p.getInputStream(),System.out,logger);
  StreamGobbler errorGobbler=new StreamGobbler(p.getErrorStream(),System.err,logger);
  outputGobbler.start();
  errorGobbler.start();
  int exitCode=0;
  try {
    exitCode=p.waitFor();
    if (exitCode != 0) {
      ErrorManager.warn("String_Node_Str" + exitCode);
    }
  }
 catch (  InterruptedException e) {
    ErrorManager.warn("String_Node_Str" + e.getMessage());
  }
  String lang=System.getProperty(ITConstants.IT_LANG);
  if (exitCode == 0 && lang.equalsIgnoreCase(ITConstants.Lang.PYTHON.name())) {
    try {
      new TraceMerger(System.getProperty(ITConstants.IT_APP_LOG_DIR),appName).merge();
    }
 catch (    IOException e) {
      ErrorManager.warn("String_Node_Str",e);
    }
  }
}
Program: 70372
Project: 70372
Buggy source:
private static void generateMasterPackage(){
  if (debug) {
    logger.debug("String_Node_Str");
  }
  String script=System.getenv(ITConstants.IT_HOME) + TRACE_SCRIPT_PATH;
  ProcessBuilder pb=new ProcessBuilder(script,"String_Node_Str","String_Node_Str","String_Node_Str");
  pb.environment().remove(LD_PRELOAD);
  Process p;
  try {
    p=pb.start();
  }
 catch (  IOException e) {
    ErrorManager.warn("String_Node_Str",e);
    return;
  }
  if (debug) {
    StreamGobbler outputGobbler=new StreamGobbler(p.getInputStream(),System.out);
    StreamGobbler errorGobbler=new StreamGobbler(p.getErrorStream(),System.err);
    outputGobbler.start();
    errorGobbler.start();
  }
  try {
    int exitCode=p.waitFor();
    if (exitCode != 0) {
      ErrorManager.warn("String_Node_Str" + exitCode);
    }
  }
 catch (  InterruptedException e) {
    ErrorManager.warn("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private static void generateMasterPackage(){
  if (debug) {
    logger.debug("String_Node_Str");
  }
  String script=System.getenv(ITConstants.IT_HOME) + TRACE_SCRIPT_PATH;
  ProcessBuilder pb=new ProcessBuilder(script,"String_Node_Str","String_Node_Str","String_Node_Str");
  pb.environment().remove(LD_PRELOAD);
  Process p;
  try {
    p=pb.start();
  }
 catch (  IOException e) {
    ErrorManager.warn("String_Node_Str",e);
    return;
  }
  if (debug) {
    StreamGobbler outputGobbler=new StreamGobbler(p.getInputStream(),System.out,logger);
    StreamGobbler errorGobbler=new StreamGobbler(p.getErrorStream(),System.err,logger);
    outputGobbler.start();
    errorGobbler.start();
  }
  try {
    int exitCode=p.waitFor();
    if (exitCode != 0) {
      ErrorManager.warn("String_Node_Str" + exitCode);
    }
  }
 catch (  InterruptedException e) {
    ErrorManager.warn("String_Node_Str" + e.getMessage());
  }
}
Program: 70373
Project: 70373
Buggy source:
/** 
 * Executes a given command @cmd with the stream redirections @streamValues
 * @param cmd
 * @param hasReturn
 * @param streamValues
 * @return
 * @throws InvokeExecutionException
 */
public static Object executeCMD(String[] cmd,boolean hasReturn,StreamSTD streamValues,File taskSandboxWorkingDir) throws InvokeExecutionException {
  ProcessBuilder builder=new ProcessBuilder(cmd);
  builder.directory(taskSandboxWorkingDir);
  builder.environment().remove(Tracer.LD_PRELOAD);
  String fileInPath=streamValues.getStdIn();
  if (fileInPath != null) {
    builder.redirectInput(new File(fileInPath));
  }
  String fileOutPath=streamValues.getStdOut();
  if (fileOutPath != null) {
    builder.redirectOutput(Redirect.appendTo(new File(fileOutPath)));
  }
  String fileErrPath=streamValues.getStdErr();
  if (fileErrPath != null) {
    builder.redirectError(Redirect.appendTo(new File(fileErrPath)));
  }
  Process process=null;
  int exitValue=-1;
  try {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    process=builder.start();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    exitValue=process.waitFor();
  }
 catch (  Exception e) {
    throw new InvokeExecutionException(ERROR_PROC_EXEC,e);
  }
 finally {
    logBinaryExecution(process,exitValue,fileOutPath,fileErrPath);
  }
  return hasReturn ? exitValue : null;
}

Fixed version (ground truth):
/** 
 * Executes a given command @cmd with the stream redirections @streamValues
 * @param cmd
 * @param hasReturn
 * @param streamValues
 * @return
 * @throws InvokeExecutionException
 */
public static Object executeCMD(String[] cmd,boolean hasReturn,StreamSTD streamValues,File taskSandboxWorkingDir) throws InvokeExecutionException {
  ProcessBuilder builder=new ProcessBuilder(cmd);
  builder.directory(taskSandboxWorkingDir);
  builder.environment().remove(Tracer.LD_PRELOAD);
  String fileInPath=streamValues.getStdIn();
  if (fileInPath != null) {
    builder.redirectInput(new File(fileInPath));
  }
  String fileOutPath=streamValues.getStdOut();
  if (fileOutPath != null) {
    builder.redirectOutput(Redirect.appendTo(new File(fileOutPath)));
  }
  String fileErrPath=streamValues.getStdErr();
  if (fileErrPath != null) {
    builder.redirectError(Redirect.appendTo(new File(fileErrPath)));
  }
  Process process=null;
  int exitValue=-1;
  try {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    process=builder.start();
    exitValue=process.waitFor();
  }
 catch (  Exception e) {
    throw new InvokeExecutionException(ERROR_PROC_EXEC,e);
  }
 finally {
    logBinaryExecution(process,exitValue,fileOutPath,fileErrPath);
  }
  return hasReturn ? exitValue : null;
}
Program: 70374
Project: 70374
Buggy source:
private static void logBinaryExecution(Process process,int exitValue,String fileOutPath,String fileErrPath) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + exitValue);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  if (process != null) {
    try (BufferedReader outputReader=(fileOutPath != null) ? new BufferedReader(new FileReader(fileOutPath)) : new BufferedReader(new InputStreamReader(process.getInputStream()))){
      String line=null;
      while ((line=outputReader.readLine()) != null) {
        System.out.println(line);
      }
    }
 catch (    IOException ioe) {
      throw new InvokeExecutionException(ERROR_OUTPUTREADER,ioe);
    }
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  if (process != null) {
    try (BufferedReader errorReader=(fileErrPath != null) ? new BufferedReader(new FileReader(fileErrPath)) : new BufferedReader(new InputStreamReader(process.getErrorStream()))){
      String line=null;
      while ((line=errorReader.readLine()) != null) {
        System.err.println(line);
      }
    }
 catch (    IOException ioe) {
      throw new InvokeExecutionException(ERROR_ERRORREADER,ioe);
    }
  }
}

Fixed version (ground truth):
private static void logBinaryExecution(Process process,int exitValue,String fileOutPath,String fileErrPath) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + exitValue);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  if (process != null) {
    try (BufferedReader outputReader=(fileOutPath != null) ? new BufferedReader(new FileReader(fileOutPath)) : new BufferedReader(new InputStreamReader(process.getInputStream()))){
      String line=null;
      while ((line=outputReader.readLine()) != null) {
        System.out.println(line);
      }
    }
 catch (    IOException ioe) {
      throw new InvokeExecutionException(ERROR_OUTPUTREADER,ioe);
    }
  }
  System.out.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  if (process != null) {
    try (BufferedReader errorReader=(fileErrPath != null) ? new BufferedReader(new FileReader(fileErrPath)) : new BufferedReader(new InputStreamReader(process.getErrorStream()))){
      String line=null;
      while ((line=errorReader.readLine()) != null) {
        System.err.println(line);
      }
    }
 catch (    IOException ioe) {
      throw new InvokeExecutionException(ERROR_ERRORREADER,ioe);
    }
  }
  System.err.println("String_Node_Str");
}
Program: 70376
Project: 70376
Buggy source:
public static Object invokeOmpSsMethod(String ompssBinary,Object[] values,boolean hasReturn,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + ompssBinary);
  String computingUnits=System.getProperty(Constants.COMPSS_NUM_THREADS);
  System.out.println("String_Node_Str" + computingUnits);
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_OMPSS_ARGS + binaryParams.size()];
  cmd[0]=ompssBinary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_OMPSS_ARGS + i]=binaryParams.get(i);
  }
  System.setProperty(OMP_NUM_THREADS,computingUnits);
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,hasReturn,streamValues,taskSandboxWorkingDir);
}

Fixed version (ground truth):
public static Object invokeOmpSsMethod(String ompssBinary,Object[] values,boolean hasReturn,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + ompssBinary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  String computingUnits=System.getProperty(Constants.COMPSS_NUM_THREADS);
  System.out.println("String_Node_Str" + computingUnits);
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_OMPSS_ARGS + binaryParams.size()];
  cmd[0]=ompssBinary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_OMPSS_ARGS + i]=binaryParams.get(i);
  }
  System.setProperty(OMP_NUM_THREADS,computingUnits);
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,hasReturn,streamValues,taskSandboxWorkingDir);
}
Program: 70377
Project: 70377
Buggy source:
public static Object invokeBinaryMethod(String binary,Object[] values,boolean hasReturn,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + binary);
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_BINARY_ARGS + binaryParams.size()];
  cmd[0]=binary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_BINARY_ARGS + i]=binaryParams.get(i);
  }
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,hasReturn,streamValues,taskSandboxWorkingDir);
}

Fixed version (ground truth):
public static Object invokeBinaryMethod(String binary,Object[] values,boolean hasReturn,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + binary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_BINARY_ARGS + binaryParams.size()];
  cmd[0]=binary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_BINARY_ARGS + i]=binaryParams.get(i);
  }
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,hasReturn,streamValues,taskSandboxWorkingDir);
}
Program: 70379
Project: 70379
Buggy source:
/** 
 * Communications initializer
 */
public static synchronized void init(){
  appHost=new MasterResource();
  try {
    if (STORAGE_CONF == null || STORAGE_CONF.equals("String_Node_Str") || STORAGE_CONF.equals("String_Node_Str")) {
      logger.warn("String_Node_Str");
    }
 else {
      logger.debug("String_Node_Str" + STORAGE_CONF);
      StorageItf.init(STORAGE_CONF);
    }
  }
 catch (  StorageException e) {
    logger.fatal("String_Node_Str" + STORAGE_CONF,e);
    System.exit(1);
  }
  loadAdaptorsJars();
  if (System.getProperty(ITConstants.IT_TRACING) != null && Integer.parseInt(System.getProperty(ITConstants.IT_TRACING)) > 0) {
    logger.debug("String_Node_Str");
    int tracing_level=Integer.parseInt(System.getProperty(ITConstants.IT_TRACING));
    Tracer.init(tracing_level);
    Tracer.emitEvent(Tracer.Event.STATIC_IT.getId(),Tracer.Event.STATIC_IT.getType());
  }
}

Fixed version (ground truth):
/** 
 * Communications initializer
 */
public static void init(){
  appHost=new MasterResource();
  try {
    if (STORAGE_CONF == null || STORAGE_CONF.equals("String_Node_Str") || STORAGE_CONF.equals("String_Node_Str")) {
      logger.warn("String_Node_Str");
    }
 else {
      logger.debug("String_Node_Str" + STORAGE_CONF);
      StorageItf.init(STORAGE_CONF);
    }
  }
 catch (  StorageException e) {
    logger.fatal("String_Node_Str" + STORAGE_CONF,e);
    System.exit(1);
  }
  loadAdaptorsJars();
  if (System.getProperty(ITConstants.IT_TRACING) != null && Integer.parseInt(System.getProperty(ITConstants.IT_TRACING)) > 0) {
    logger.debug("String_Node_Str");
    int tracing_level=Integer.parseInt(System.getProperty(ITConstants.IT_TRACING));
    Tracer.init(tracing_level);
    Tracer.emitEvent(Tracer.Event.STATIC_IT.getId(),Tracer.Event.STATIC_IT.getType());
  }
}
Program: 70380
Project: 70380
Buggy source:
/** 
 * Return the active adaptors
 * @return
 */
public static synchronized HashMap<String,CommAdaptor> getAdaptors(){
  return adaptors;
}

Fixed version (ground truth):
/** 
 * Return the active adaptors
 * @return
 */
public static Map<String,CommAdaptor> getAdaptors(){
  return adaptors;
}
Program: 70381
Project: 70381
Buggy source:
/** 
 * Stops all the submitted jobs
 */
public static synchronized void stopSubmittedjobs(){
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stopSubmittedJobs();
  }
}

Fixed version (ground truth):
/** 
 * Stops all the submitted jobs
 */
public static void stopSubmittedjobs(){
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stopSubmittedJobs();
  }
}
Program: 70382
Project: 70382
Buggy source:
/** 
 * Initializes the internal adaptor and constructs a comm configuration
 * @param adaptorName
 * @param project_properties
 * @param resources_properties
 * @return
 * @throws ConstructConfigurationException
 */
public static synchronized Configuration constructConfiguration(String adaptorName,Object project_properties,Object resources_properties) throws ConstructConfigurationException {
  CommAdaptor adaptor=adaptors.get(adaptorName);
  if (adaptor == null) {
    try {
      Constructor<?> constrAdaptor=Class.forName(adaptorName).getConstructor();
      adaptor=(CommAdaptor)constrAdaptor.newInstance();
    }
 catch (    NoSuchMethodException|SecurityException|ClassNotFoundException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
      throw new ConstructConfigurationException(e);
    }
    adaptor.init();
    adaptors.put(adaptorName,adaptor);
  }
  if (debug) {
    logger.debug("String_Node_Str" + adaptorName);
  }
  return adaptor.constructConfiguration(project_properties,resources_properties);
}

Fixed version (ground truth):
/** 
 * Initializes the internal adaptor and constructs a comm configuration
 * @param adaptorName
 * @param project_properties
 * @param resources_properties
 * @return
 * @throws ConstructConfigurationException
 */
public static Configuration constructConfiguration(String adaptorName,Object project_properties,Object resources_properties) throws ConstructConfigurationException {
  CommAdaptor adaptor=adaptors.get(adaptorName);
  if (adaptor == null) {
    try {
      Constructor<?> constrAdaptor=Class.forName(adaptorName).getConstructor();
      adaptor=(CommAdaptor)constrAdaptor.newInstance();
    }
 catch (    NoSuchMethodException|SecurityException|ClassNotFoundException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
      throw new ConstructConfigurationException(e);
    }
    adaptor.init();
    adaptors.put(adaptorName,adaptor);
  }
  if (debug) {
    logger.debug("String_Node_Str" + adaptorName);
  }
  return adaptor.constructConfiguration(project_properties,resources_properties);
}
Program: 70383
Project: 70383
Buggy source:
/** 
 * Initializes a worker with name @name and configuration @config
 * @param name
 * @param config
 * @return
 */
public static synchronized COMPSsWorker initWorker(String name,Configuration config){
  String adaptorName=config.getAdaptorName();
  CommAdaptor adaptor=adaptors.get(adaptorName);
  return adaptor.initWorker(name,config);
}

Fixed version (ground truth):
/** 
 * Initializes a worker with name @name and configuration @config
 * @param name
 * @param config
 * @return
 */
public static COMPSsWorker initWorker(String name,Configuration config){
  String adaptorName=config.getAdaptorName();
  CommAdaptor adaptor=adaptors.get(adaptorName);
  return adaptor.initWorker(name,config);
}
Program: 70384
Project: 70384
Buggy source:
/** 
 * Returns all the data stored in a host @host
 * @param host
 * @return
 */
public static synchronized HashSet<LogicalData> getAllData(Resource host){
  return host.getAllDataFromHost();
}

Fixed version (ground truth):
/** 
 * Returns all the data stored in a host @host
 * @param host
 * @return
 */
public static HashSet<LogicalData> getAllData(Resource host){
  return host.getAllDataFromHost();
}
Program: 70385
Project: 70385
Buggy source:
/** 
 * Stops the communication layer.  Clean FTM, Job, {GATJob, NIOJob} and WSJob
 */
public static synchronized void stop(){
  appHost.deleteIntermediate();
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stop();
  }
  if (STORAGE_CONF != null && !STORAGE_CONF.equals("String_Node_Str") && !STORAGE_CONF.equals("String_Node_Str")) {
    try {
      logger.debug("String_Node_Str");
      StorageItf.finish();
    }
 catch (    StorageException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  if (Tracer.isActivated()) {
    Tracer.emitEvent(Tracer.EVENT_END,Tracer.getRuntimeEventsType());
    Tracer.fini();
  }
}

Fixed version (ground truth):
/** 
 * Stops the communication layer.  Clean FTM, Job, {GATJob, NIOJob} and WSJob
 */
public static void stop(){
  appHost.deleteIntermediate();
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stop();
  }
  if (STORAGE_CONF != null && !STORAGE_CONF.equals("String_Node_Str") && !STORAGE_CONF.equals("String_Node_Str")) {
    try {
      logger.debug("String_Node_Str");
      StorageItf.finish();
    }
 catch (    StorageException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  if (Tracer.isActivated()) {
    Tracer.emitEvent(Tracer.EVENT_END,Tracer.getRuntimeEventsType());
    Tracer.fini();
  }
}
Program: 70387
Project: 70387
Buggy source:
public MultiURI(Protocol protocol,Resource host,String path){
  this.protocol=protocol;
  this.host=host;
  this.path=path;
  this.internal=new HashMap<>();
}

Fixed version (ground truth):
public MultiURI(Protocol protocol,Resource host,String path){
  this.protocol=protocol;
  this.host=host;
  this.path=path;
  this.internal=new HashMap<>();
  try {
    host.setInternalURI(this);
  }
 catch (  UnstartedNodeException e) {
    e.printStackTrace();
  }
}
Program: 70388
Project: 70388
Buggy source:
public String debugString(){
  StringBuilder sb=new StringBuilder(this.protocol.getSchema() + this.host.toString() + File.separator+ this.path+ "String_Node_Str");
  for (  Entry<String,Object> e : internal.entrySet()) {
    sb.append("String_Node_Str").append(e.getKey()).append("String_Node_Str").append(e.getValue()).append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
public String debugString(){
  StringBuilder sb=new StringBuilder(this.protocol.getSchema() + this.host.getName() + File.separator+ this.path+ "String_Node_Str");
  for (  Entry<String,Object> e : internal.entrySet()) {
    sb.append("String_Node_Str").append(e.getKey()).append("String_Node_Str").append(e.getValue()).append("String_Node_Str");
  }
  return sb.toString();
}
Program: 70389
Project: 70389
Buggy source:
public Object getInternalURI(String adaptor) throws UnstartedNodeException {
  Object o=internal.get(adaptor);
  if (o == null) {
    host.setInternalURI(this);
    o=internal.get(adaptor);
  }
  return o;
}

Fixed version (ground truth):
public Object getInternalURI(String adaptor) throws UnstartedNodeException {
  Object o=internal.get(adaptor);
  return o;
}
Program: 70391
Project: 70391
Buggy source:
public static synchronized void init(){
  appHost=new MasterResource();
  try {
    if (STORAGE_CONF == null || STORAGE_CONF.equals("String_Node_Str") || STORAGE_CONF.equals("String_Node_Str")) {
      logger.warn("String_Node_Str");
    }
 else {
      logger.debug("String_Node_Str" + STORAGE_CONF);
      StorageItf.init(STORAGE_CONF);
    }
  }
 catch (  StorageException e) {
    logger.fatal("String_Node_Str" + STORAGE_CONF,e);
    System.exit(1);
  }
  loadAdaptorsJars();
  if (System.getProperty(ITConstants.IT_TRACING) != null && Integer.parseInt(System.getProperty(ITConstants.IT_TRACING)) > 0) {
    logger.debug("String_Node_Str");
    int tracing_level=Integer.parseInt(System.getProperty(ITConstants.IT_TRACING));
    Tracer.init(tracing_level);
    Tracer.emitEvent(Tracer.Event.STATIC_IT.getId(),Tracer.Event.STATIC_IT.getType());
  }
}

Fixed version (ground truth):
/** 
 * Communications initializer
 */
public static synchronized void init(){
  appHost=new MasterResource();
  try {
    if (STORAGE_CONF == null || STORAGE_CONF.equals("String_Node_Str") || STORAGE_CONF.equals("String_Node_Str")) {
      logger.warn("String_Node_Str");
    }
 else {
      logger.debug("String_Node_Str" + STORAGE_CONF);
      StorageItf.init(STORAGE_CONF);
    }
  }
 catch (  StorageException e) {
    logger.fatal("String_Node_Str" + STORAGE_CONF,e);
    System.exit(1);
  }
  loadAdaptorsJars();
  if (System.getProperty(ITConstants.IT_TRACING) != null && Integer.parseInt(System.getProperty(ITConstants.IT_TRACING)) > 0) {
    logger.debug("String_Node_Str");
    int tracing_level=Integer.parseInt(System.getProperty(ITConstants.IT_TRACING));
    Tracer.init(tracing_level);
    Tracer.emitEvent(Tracer.Event.STATIC_IT.getId(),Tracer.Event.STATIC_IT.getType());
  }
}
Program: 70392
Project: 70392
Buggy source:
public static synchronized LogicalData registerPSCO(String dataId,String id){
  String targetPath=Protocol.PERSISTENT_URI.getSchema() + id;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  return logicalData;
}

Fixed version (ground truth):
/** 
 * Registers a new PSCO id @id for the data with id @dataId dataId must exist
 * @param dataId
 * @param id
 * @return
 */
public static synchronized LogicalData registerPSCO(String dataId,String id){
  String targetPath=Protocol.PERSISTENT_URI.getSchema() + id;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  return logicalData;
}
Program: 70393
Project: 70393
Buggy source:
public static synchronized LogicalData registerData(String dataId){
  logger.debug("String_Node_Str" + dataId);
  LogicalData logicalData=new LogicalData(dataId);
  data.put(dataId,logicalData);
  return logicalData;
}

Fixed version (ground truth):
/** 
 * Registers a new data with id @dataId
 * @param dataId
 * @return
 */
public static synchronized LogicalData registerData(String dataId){
  logger.debug("String_Node_Str" + dataId);
  LogicalData logicalData=new LogicalData(dataId);
  data.put(dataId,logicalData);
  return logicalData;
}
Program: 70394
Project: 70394
Buggy source:
public static synchronized String dataDump(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  for (  Map.Entry<String,LogicalData> lde : data.entrySet()) {
    sb.append("String_Node_Str").append(lde.getKey()).append("String_Node_Str");
    LogicalData ld=lde.getValue();
    for (    MultiURI u : ld.getURIs()) {
      sb.append("String_Node_Str").append(u.toString()).append("String_Node_Str");
      for (      String adaptor : adaptors.keySet()) {
        Object internal=null;
        try {
          internal=u.getInternalURI(adaptor);
          if (internal != null) {
            sb.append("String_Node_Str").append(internal.toString()).append("String_Node_Str");
          }
        }
 catch (        UnstartedNodeException une) {
        }
      }
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Dumps the stored data (only for testing)
 * @return
 */
public static synchronized String dataDump(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  for (  Map.Entry<String,LogicalData> lde : data.entrySet()) {
    sb.append("String_Node_Str").append(lde.getKey()).append("String_Node_Str");
    LogicalData ld=lde.getValue();
    for (    MultiURI u : ld.getURIs()) {
      sb.append("String_Node_Str").append(u.toString()).append("String_Node_Str");
      for (      String adaptor : adaptors.keySet()) {
        Object internal=null;
        try {
          internal=u.getInternalURI(adaptor);
          if (internal != null) {
            sb.append("String_Node_Str").append(internal.toString()).append("String_Node_Str");
          }
        }
 catch (        UnstartedNodeException une) {
        }
      }
    }
  }
  return sb.toString();
}
Program: 70395
Project: 70395
Buggy source:
public static MasterResource getAppHost(){
  return appHost;
}

Fixed version (ground truth):
/** 
 * Returns the resource assigned as master node
 * @return
 */
public static MasterResource getAppHost(){
  return appHost;
}
Program: 70396
Project: 70396
Buggy source:
public static synchronized HashMap<String,CommAdaptor> getAdaptors(){
  return adaptors;
}

Fixed version (ground truth):
/** 
 * Return the active adaptors
 * @return
 */
public static synchronized HashMap<String,CommAdaptor> getAdaptors(){
  return adaptors;
}
Program: 70397
Project: 70397
Buggy source:
public static synchronized void stopSubmittedjobs(){
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stopSubmittedJobs();
  }
}

Fixed version (ground truth):
/** 
 * Stops all the submitted jobs
 */
public static synchronized void stopSubmittedjobs(){
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stopSubmittedJobs();
  }
}