nus-yam/ex-repair huggingface dataset:
Program: 70457
Project: 70457
Buggy source:
/** 
 * Prints in a file the final task graph
 */
public void commitGraph(){
  logger.debug("String_Node_Str");
  try {
    full_graph.close();
    try (FileInputStream sourceStream=new FileInputStream(COMPLETE_GRAPH_TMP_FILE);FileOutputStream destStream=new FileOutputStream(COMPLETE_GRAPH_FILE);FileChannel sourceChannel=sourceStream.getChannel();FileChannel destChannel=destStream.getChannel()){
      destChannel.transferFrom(sourceChannel,0,sourceChannel.size());
    }
     full_graph=new BufferedWriter(new FileWriter(COMPLETE_GRAPH_TMP_FILE,true));
    BufferedWriter finalGraph=new BufferedWriter(new FileWriter(COMPLETE_GRAPH_FILE,true));
    closeDependenceGraph(finalGraph);
    openLegend(finalGraph);
    legend.close();
    try (FileInputStream sourceStream=new FileInputStream(COMPLETE_LEGEND_TMP_FILE);FileOutputStream destStream=new FileOutputStream(COMPLETE_GRAPH_FILE);FileChannel sourceChannel=sourceStream.getChannel();FileChannel destChannel=destStream.getChannel()){
      destChannel.position(destChannel.size());
      sourceChannel.transferTo(0,sourceChannel.size(),destChannel);
    }
     legend=new BufferedWriter(new FileWriter(COMPLETE_LEGEND_TMP_FILE,true));
    closeLegend(finalGraph);
    closeGraphFile(finalGraph);
    finalGraph.close();
  }
 catch (  Exception e) {
    logger.error(ERROR_COMMIT_FINAL_GRAPH,e);
  }
}

Fixed version (ground truth):
/** 
 * Prints in a file the final task graph
 */
public void commitGraph(){
  logger.debug("String_Node_Str");
  try {
    full_graph.close();
    FileInputStream sourceFIS=null;
    FileOutputStream destFOS=null;
    FileChannel sourceChannel=null;
    FileChannel destChannel=null;
    try {
      sourceFIS=new FileInputStream(COMPLETE_GRAPH_TMP_FILE);
      destFOS=new FileOutputStream(COMPLETE_GRAPH_FILE);
      sourceChannel=sourceFIS.getChannel();
      destChannel=destFOS.getChannel();
      destChannel.transferFrom(sourceChannel,0,sourceChannel.size());
    }
  finally {
      sourceChannel.close();
      sourceFIS.close();
      destChannel.close();
      destFOS.close();
    }
    full_graph=new BufferedWriter(new FileWriter(COMPLETE_GRAPH_TMP_FILE,true));
    BufferedWriter finalGraph=new BufferedWriter(new FileWriter(COMPLETE_GRAPH_FILE,true));
    closeDependenceGraph(finalGraph);
    openLegend(finalGraph);
    legend.close();
    try {
      sourceFIS=new FileInputStream(COMPLETE_LEGEND_TMP_FILE);
      sourceChannel=sourceFIS.getChannel();
      destFOS=new FileOutputStream(COMPLETE_GRAPH_FILE,true);
      destChannel=destFOS.getChannel();
      destChannel.position(destChannel.size());
      sourceChannel.transferTo(0,sourceChannel.size(),destChannel);
    }
  finally {
      sourceChannel.close();
      sourceFIS.close();
      destChannel.close();
      destFOS.close();
    }
    legend=new BufferedWriter(new FileWriter(COMPLETE_LEGEND_TMP_FILE,true));
    closeLegend(finalGraph);
    closeGraphFile(finalGraph);
    finalGraph.close();
  }
 catch (  Exception e) {
    logger.error(ERROR_COMMIT_FINAL_GRAPH,e);
  }
}
Program: 70458
Project: 70458
Buggy source:
public MethodConfiguration(MethodConfiguration clone){
  super(clone);
  host=clone.host;
  user=clone.host;
  installDir=clone.installDir;
  workingDir=clone.workingDir;
  totalComputingUnits=clone.totalComputingUnits;
  appDir=clone.appDir;
  classpath=clone.classpath;
  pythonpath=clone.pythonpath;
  libraryPath=clone.libraryPath;
}

Fixed version (ground truth):
public MethodConfiguration(MethodConfiguration clone){
  super(clone);
  host=clone.host;
  user=clone.user;
  installDir=clone.installDir;
  workingDir=clone.workingDir;
  totalComputingUnits=clone.totalComputingUnits;
  appDir=clone.appDir;
  classpath=clone.classpath;
  pythonpath=clone.pythonpath;
  libraryPath=clone.libraryPath;
}
Program: 70459
Project: 70459
Buggy source:
public final void getWorkloadState(ResourceUser.WorkloadStatus response){
  int coreCount=CoreManager.getCoreCount();
  Profile[] coreProfile=new Profile[coreCount];
  for (int coreId=0; coreId < coreCount; coreId++) {
    coreProfile[coreId]=new Profile();
  }
  for (  ResourceScheduler<P,T> ui : workers.values()) {
    if (ui == null) {
      continue;
    }
    LinkedList<Implementation<T>>[] impls=ui.getExecutableImpls();
    for (int coreId=0; coreId < coreCount; coreId++) {
      for (      Implementation<T> impl : impls[coreId]) {
        coreProfile[coreId].accumulate(ui.getProfile(impl));
      }
    }
    LinkedList<AllocatableAction<P,T>> runningActions=ui.getHostedActions();
    long now=System.currentTimeMillis();
    for (    AllocatableAction<P,T> running : runningActions) {
      if (running.getImplementations().length > 0) {
        int coreId=running.getImplementations()[0].getCoreId();
        response.registerRunning(coreId,now - running.getStartTime());
      }
    }
  }
  for (int coreId=0; coreId < coreCount; coreId++) {
    response.registerNoResources(coreId,blockedActions.getActionCounts()[coreId]);
    response.registerReady(coreId,readyCounts[coreId]);
    response.registerTimes(coreId,coreProfile[coreId].getMinExecutionTime(),coreProfile[coreId].getAverageExecutionTime(),coreProfile[coreId].getMaxExecutionTime());
  }
}

Fixed version (ground truth):
public final void getWorkloadState(ResourceUser.WorkloadStatus response){
  int coreCount=CoreManager.getCoreCount();
  Profile[] coreProfile=new Profile[coreCount];
  for (int coreId=0; coreId < coreCount; coreId++) {
    coreProfile[coreId]=new Profile();
  }
  for (  ResourceScheduler<P,T> ui : workers.values()) {
    if (ui == null) {
      continue;
    }
    LinkedList<Implementation<T>>[] impls=ui.getExecutableImpls();
    for (int coreId=0; coreId < coreCount; coreId++) {
      for (      Implementation<T> impl : impls[coreId]) {
        coreProfile[coreId].accumulate(ui.getProfile(impl));
      }
    }
    LinkedList<AllocatableAction<P,T>> runningActions=ui.getHostedActions();
    long now=System.currentTimeMillis();
    for (    AllocatableAction<P,T> running : runningActions) {
      if (running.getImplementations().length > 0) {
        Integer coreId=running.getImplementations()[0].getCoreId();
        if (coreId != null) {
          response.registerRunning(coreId,now - running.getStartTime());
        }
      }
    }
  }
  for (int coreId=0; coreId < coreCount; coreId++) {
    response.registerNoResources(coreId,blockedActions.getActionCounts()[coreId]);
    response.registerReady(coreId,readyCounts[coreId]);
    response.registerTimes(coreId,coreProfile[coreId].getMinExecutionTime(),coreProfile[coreId].getAverageExecutionTime(),coreProfile[coreId].getMaxExecutionTime());
  }
}
Program: 70460
Project: 70460
Buggy source:
public TaskAnalyser(){
  currentTaskCount=new HashMap<Integer,Integer>();
  writers=new TreeMap<Integer,Task>();
  appIdToTaskCount=new HashMap<Long,Integer>();
  appIdToTotalTaskCount=new HashMap<Long,Integer>();
  appIdToSemaphore=new HashMap<Long,Semaphore>();
  appIdToWrittenFiles=new HashMap<Long,TreeSet<Integer>>();
  waitedTasks=new Hashtable<Task,List<Semaphore>>();
  synchronizationId=0;
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
public TaskAnalyser(){
  currentTaskCount=new HashMap<Integer,Integer>();
  writers=new TreeMap<Integer,Task>();
  appIdToTaskCount=new HashMap<Long,Integer>();
  appIdToTotalTaskCount=new HashMap<Long,Integer>();
  appIdToSemaphore=new HashMap<Long,Semaphore>();
  appIdToWrittenFiles=new HashMap<Long,TreeSet<Integer>>();
  appIdToSCOWrittenIds=new HashMap<Long,TreeSet<Integer>>();
  waitedTasks=new Hashtable<Task,List<Semaphore>>();
  synchronizationId=0;
  logger.info("String_Node_Str");
}
Program: 70462
Project: 70462
Buggy source:
@Override public void dependencyFreeAction(AllocatableAction<P,T> action) throws BlockedActionException {
  dependingActions.removeAction(action);
  try {
    Score actionScore=action.schedulingScore(this);
    action.schedule(actionScore);
  }
 catch (  UnassignedActionException ex) {
    unassignedReadyActions.addAction(action);
  }
}

Fixed version (ground truth):
@Override public void dependencyFreeAction(AllocatableAction<P,T> action) throws BlockedActionException {
  dependingActions.removeAction(action);
  try {
    Score actionScore=action.schedulingScore(this);
    action.schedule(actionScore);
    try {
      action.tryToLaunch();
    }
 catch (    InvalidSchedulingException ise) {
      action.schedule(action.getConstrainingPredecessor().getAssignedResource(),actionScore);
      try {
        action.tryToLaunch();
      }
 catch (      InvalidSchedulingException ise2) {
      }
    }
  }
 catch (  UnassignedActionException ex) {
    unassignedReadyActions.addAction(action);
  }
}
Program: 70464
Project: 70464
Buggy source:
public void start(HashMap<String,String> disks) throws Exception {
  this.node.start();
  for (  java.util.Map.Entry<String,String> disk : disks.entrySet()) {
    addSharedDisk(disk.getKey(),disk.getValue());
  }
}

Fixed version (ground truth):
public void start() throws Exception {
  this.node.start();
  if (sharedDisks != null) {
    for (    java.util.Map.Entry<String,String> disk : sharedDisks.entrySet()) {
      SharedDiskManager.addSharedToMachine(disk.getKey(),disk.getValue(),this);
    }
  }
}
Program: 70465
Project: 70465
Buggy source:
public void run(){
  Thread.currentThread().setName(selectedResource.getResource().getName() + "String_Node_Str");
  try {
    selectedResource.getResource().start(new HashMap<String,String>());
    notifyCompleted();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    ErrorManager.warn("String_Node_Str",e);
    notifyError();
  }
}

Fixed version (ground truth):
public void run(){
  Thread.currentThread().setName(selectedResource.getResource().getName() + "String_Node_Str");
  try {
    selectedResource.getResource().start();
    notifyCompleted();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    ErrorManager.warn("String_Node_Str",e);
    notifyError();
  }
}
Program: 70466
Project: 70466
Buggy source:
@Override protected void doAction(){
  (new Thread(){
    public void run(){
      Thread.currentThread().setName(selectedResource.getResource().getName() + "String_Node_Str");
      try {
        selectedResource.getResource().start(new HashMap<String,String>());
        notifyCompleted();
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
        ErrorManager.warn("String_Node_Str",e);
        notifyError();
      }
    }
  }
).start();
}

Fixed version (ground truth):
@Override protected void doAction(){
  (new Thread(){
    public void run(){
      Thread.currentThread().setName(selectedResource.getResource().getName() + "String_Node_Str");
      try {
        selectedResource.getResource().start();
        notifyCompleted();
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
        ErrorManager.warn("String_Node_Str",e);
        notifyError();
      }
    }
  }
).start();
}
Program: 70467
Project: 70467
Buggy source:
public FakeWorker(WorkerResourceDescription description,int limitOfTasks){
  super("String_Node_Str",(T)description,new FakeNode(),limitOfTasks);
}

Fixed version (ground truth):
public FakeWorker(WorkerResourceDescription description,int limitOfTasks){
  super("String_Node_Str",(T)description,new FakeNode(),limitOfTasks,null);
}
Program: 70470
Project: 70470
Buggy source:
/** 
 * Reconfigures the master node adding its shared disks
 * @param sharedDisks Shared Disk descriptions (diskName->mountpoint)
 */
public static void updateMasterConfiguration(HashMap<String,String> sharedDisks){
  for (  java.util.Map.Entry<String,String> disk : sharedDisks.entrySet()) {
    String diskName=disk.getKey();
    String mountPoint=disk.getValue();
    Comm.appHost.addSharedDisk(diskName,mountPoint);
  }
}

Fixed version (ground truth):
/** 
 * Reconfigures the master node adding its shared disks
 * @param sharedDisks Shared Disk descriptions (diskName->mountpoint)
 */
public static void updateMasterConfiguration(HashMap<String,String> sharedDisks){
  Comm.appHost.updateSharedDisk(sharedDisks);
  try {
    Comm.appHost.start();
  }
 catch (  Exception e) {
    ErrorManager.error("String_Node_Str",e);
  }
}
Program: 70471
Project: 70471
Buggy source:
/** 
 * Initializes a new Method Worker
 * @param name
 * @param rd
 * @param sharedDisks
 * @param mc
 */
public static void newMethodWorker(String name,MethodResourceDescription rd,HashMap<String,String> sharedDisks,MethodConfiguration mc){
  int taskCount;
  int limitOfTasks=mc.getLimitOfTasks();
  int computingUnits=rd.getTotalComputingUnits();
  if (limitOfTasks < 0 && computingUnits < 0) {
    taskCount=0;
  }
 else {
    taskCount=Math.max(limitOfTasks,computingUnits);
  }
  mc.setLimitOfTasks(taskCount);
  MethodWorker newResource=new MethodWorker(name,rd,mc);
  addStaticResource(newResource);
}

Fixed version (ground truth):
/** 
 * Initializes a new Method Worker
 * @param name
 * @param rd
 * @param sharedDisks
 * @param mc
 */
public static void newMethodWorker(String name,MethodResourceDescription rd,HashMap<String,String> sharedDisks,MethodConfiguration mc){
  int taskCount;
  int limitOfTasks=mc.getLimitOfTasks();
  int computingUnits=rd.getTotalComputingUnits();
  if (limitOfTasks < 0 && computingUnits < 0) {
    taskCount=0;
  }
 else {
    taskCount=Math.max(limitOfTasks,computingUnits);
  }
  mc.setLimitOfTasks(taskCount);
  MethodWorker newResource=new MethodWorker(name,rd,mc,sharedDisks);
  addStaticResource(newResource);
}
Program: 70472
Project: 70472
Buggy source:
@Override protected void doFailed(){
  String taskName=task.getTaskParams().getName();
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(Comm.appHost.getJobsDirPath()).append("String_Node_Str");
  Iterator<Integer> j=jobs.iterator();
  while (true) {
    sb.append(j.next());
    if (!j.hasNext()) {
      break;
    }
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  ErrorManager.warn(sb.toString());
  task.setStatus(Task.TaskState.FAILED);
  producer.notifyTaskEnd(task);
}

Fixed version (ground truth):
@Override protected void doFailed(){
  String taskName=task.getTaskParams().getName();
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str").append(taskName).append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(Comm.appHost.getJobsDirPath()).append("String_Node_Str");
  Iterator<Integer> j=jobs.iterator();
  while (j.hasNext()) {
    sb.append(j.next());
    if (!j.hasNext()) {
      break;
    }
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  ErrorManager.warn(sb.toString());
  task.setStatus(Task.TaskState.FAILED);
  producer.notifyTaskEnd(task);
}
Program: 70473
Project: 70473
Buggy source:
private void transferJobData(DependencyParameter param,JobTransfersListener listener){
  Worker<?> w=selectedResource.getResource();
  DataAccessId access=param.getDataAccessId();
  if (access instanceof DataAccessId.WAccessId) {
    String tgtName=((DataAccessId.WAccessId)access).getWrittenDataInstance().getRenaming();
    param.setDataTarget(w.getCompleteRemotePath(param.getType(),tgtName));
    return;
  }
  listener.addOperation();
  if (access instanceof DataAccessId.RAccessId) {
    String srcName=((DataAccessId.RAccessId)access).getReadDataInstance().getRenaming();
    w.getData(srcName,srcName,param,listener);
  }
 else {
    String srcName=((DataAccessId.RWAccessId)access).getReadDataInstance().getRenaming();
    String tgtName=((DataAccessId.RWAccessId)access).getWrittenDataInstance().getRenaming();
    w.getData(srcName,tgtName,(LogicalData)null,param,listener);
  }
}

Fixed version (ground truth):
private void transferJobData(DependencyParameter param,JobTransfersListener listener){
  Worker<?> w=selectedResource.getResource();
  DataAccessId access=param.getDataAccessId();
  if (access instanceof DataAccessId.WAccessId) {
    String tgtName=((DataAccessId.WAccessId)access).getWrittenDataInstance().getRenaming();
    if (debug) {
      jobLogger.debug("String_Node_Str" + w.getCompleteRemotePath(param.getType(),tgtName));
    }
    param.setDataTarget(w.getCompleteRemotePath(param.getType(),tgtName));
    return;
  }
  listener.addOperation();
  if (access instanceof DataAccessId.RAccessId) {
    String srcName=((DataAccessId.RAccessId)access).getReadDataInstance().getRenaming();
    w.getData(srcName,srcName,param,listener);
  }
 else {
    String srcName=((DataAccessId.RWAccessId)access).getReadDataInstance().getRenaming();
    String tgtName=((DataAccessId.RWAccessId)access).getWrittenDataInstance().getRenaming();
    w.getData(srcName,tgtName,(LogicalData)null,param,listener);
  }
}
Program: 70476
Project: 70476
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");
  }
}

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");
  }
  if (debug) {
    logger.debug("String_Node_Str" + copy.getName() + "String_Node_Str"+ copy.getId()+ "String_Node_Str");
  }
}
Program: 70477
Project: 70477
Buggy source:
private synchronized void addLocation_private(DataLocation loc){
  isBeingSaved=false;
  locations.add(loc);
switch (loc.getType()) {
case PRIVATE:
    for (    Resource host : loc.getHosts()) {
      if (host == null) {
        host=Comm.appHost;
      }
      boolean done=false;
      HashSet<LogicalData> files=null;
      while (!done) {
        try {
          files=hostToPrivateFiles.get(host);
          if (files == null) {
            files=new HashSet<LogicalData>();
            hostToPrivateFiles.put(host,files);
          }
          done=true;
        }
 catch (        ConcurrentModificationException cme) {
          logger.debug("String_Node_Str");
        }
      }
      files.add(this);
    }
  if (loc.getPath().startsWith(File.separator)) {
    onFile=true;
  }
break;
case SHARED:
String shared=loc.getSharedDisk();
boolean done=false;
HashSet<LogicalData> files=null;
while (!done) {
try {
files=sharedDiskToSharedFiles.get(shared);
if (files == null) {
files=new HashSet<LogicalData>();
sharedDiskToSharedFiles.put(shared,files);
}
done=true;
}
 catch (ConcurrentModificationException cme) {
logger.debug("String_Node_Str");
}
}
files.add(this);
onFile=true;
break;
}
}

Fixed version (ground truth):
private synchronized void addLocation_private(DataLocation loc){
  isBeingSaved=false;
  locations.add(loc);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + this.getName() + "String_Node_Str"+ loc.getLocationKey()+ "String_Node_Str");
  }
switch (loc.getType()) {
case PRIVATE:
    for (    Resource host : loc.getHosts()) {
      if (host == null) {
        host=Comm.appHost;
      }
      boolean done=false;
      HashSet<LogicalData> files=null;
      while (!done) {
        try {
          files=hostToPrivateFiles.get(host);
          if (files == null) {
            files=new HashSet<LogicalData>();
            hostToPrivateFiles.put(host,files);
          }
          done=true;
        }
 catch (        ConcurrentModificationException cme) {
          logger.debug("String_Node_Str");
        }
      }
      files.add(this);
    }
  if (loc.getPath().startsWith(File.separator)) {
    onFile=true;
  }
break;
case SHARED:
String shared=loc.getSharedDisk();
boolean done=false;
HashSet<LogicalData> files=null;
while (!done) {
try {
files=sharedDiskToSharedFiles.get(shared);
if (files == null) {
files=new HashSet<LogicalData>();
sharedDiskToSharedFiles.put(shared,files);
}
done=true;
}
 catch (ConcurrentModificationException cme) {
logger.debug("String_Node_Str");
}
}
files.add(this);
onFile=true;
break;
}
}
Program: 70478
Project: 70478
Buggy source:
public Copy(LogicalData srcData,DataLocation prefSrc,DataLocation prefTgt,LogicalData tgtData,Transferable reason,EventListener listener){
  super(srcData,listener);
  this.srcData=srcData;
  this.srcLoc=prefSrc;
  this.tgtData=tgtData;
  this.tgtLoc=prefTgt;
  this.reason=reason;
}

Fixed version (ground truth):
public Copy(LogicalData srcData,DataLocation prefSrc,DataLocation prefTgt,LogicalData tgtData,Transferable reason,EventListener listener){
  super(srcData,listener);
  this.srcData=srcData;
  this.srcLoc=prefSrc;
  this.tgtData=tgtData;
  this.tgtLoc=prefTgt;
  this.reason=reason;
  if (debug) {
    logger.debug("String_Node_Str" + this.getName() + "String_Node_Str"+ this.getId()+ "String_Node_Str");
  }
}
Program: 70479
Project: 70479
Buggy source:
public void setFinalTarget(String targetAbsolutePath){
  reason.setDataTarget(targetAbsolutePath);
}

Fixed version (ground truth):
public void setFinalTarget(String targetAbsolutePath){
  if (debug) {
    logger.debug("String_Node_Str" + targetAbsolutePath);
  }
  reason.setDataTarget(targetAbsolutePath);
}
Program: 70480
Project: 70480
Buggy source:
public void stop(boolean saveUniqueData,ShutdownListener sl){
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  Semaphore sem=new Semaphore(0);
  SafeCopyListener listener=new SafeCopyListener(sem);
  HashSet<LogicalData> lds=LogicalData.getAllDataFromHost(this);
  HashMap<String,String> disks=SharedDiskManager.terminate(this);
  COMPSsNode masterNode=Comm.appHost.getNode();
  for (  LogicalData ld : lds) {
    ld.notifyToInProgressCopiesEnd(listener);
    DataLocation lastLoc=ld.removeHostAndCheckLocationToSave(this,disks);
    if (lastLoc != null && saveUniqueData) {
      listener.addOperation();
      DataLocation safeLoc=DataLocation.getLocation(Comm.appHost,Comm.appHost.getTempDirPath() + ld.getName());
      masterNode.obtainData(ld,lastLoc,safeLoc,ld,new SafeCopyTransferable(),listener);
    }
  }
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  listener.enable();
  try {
    sem.acquire();
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  if (this.getType() != Type.SERVICE) {
    if (tracing) {
      node.generatePackage();
      getTracingPackageToMaster();
      if (debug) {
        logger.debug("String_Node_Str" + this.getName());
      }
    }
    if (debug) {
      node.generateWorkersDebugInfo();
      getWorkersDebugInfo();
      logger.debug("String_Node_Str" + this.getName());
    }
  }
  this.deleteIntermediate();
  sl.addOperation();
  node.stop(sl);
}

Fixed version (ground truth):
public void stop(ShutdownListener sl){
  this.deleteIntermediate();
  sl.addOperation();
  node.stop(sl);
}
Program: 70481
Project: 70481
Buggy source:
public void copiedData(int transferGroupId){
  LinkedList<Copy> copies=groupToCopy.remove(transferGroupId);
  if (copies == null) {
    return;
  }
  for (  Copy c : copies) {
    if (!c.isRegistered()) {
      continue;
    }
    DataLocation actualLocation=c.getSourceData().finishedCopy(c);
    LogicalData tgtData=c.getTargetData();
    if (tgtData != null) {
      tgtData.addLocation(actualLocation);
    }
  }
}

Fixed version (ground truth):
public void copiedData(int transferGroupId){
  logger.debug("String_Node_Str");
  LinkedList<Copy> copies=groupToCopy.remove(transferGroupId);
  if (copies == null) {
    logger.debug("String_Node_Str");
    return;
  }
  for (  Copy c : copies) {
    logger.debug("String_Node_Str" + c.getName());
    if (!c.isRegistered()) {
      logger.debug("String_Node_Str" + c.getName());
      continue;
    }
    DataLocation actualLocation=c.getSourceData().finishedCopy(c);
    if (actualLocation != null) {
      logger.debug("String_Node_Str" + actualLocation.getPath());
    }
 else {
      logger.debug("String_Node_Str");
    }
    LogicalData tgtData=c.getTargetData();
    if (tgtData != null) {
      logger.debug("String_Node_Str");
      if (actualLocation.getType().equals(DataLocation.Type.PRIVATE)) {
        logger.debug("String_Node_Str" + actualLocation.getPath() + "String_Node_Str"+ tgtData.getName());
        tgtData.addLocation(actualLocation);
      }
 else {
        logger.debug("String_Node_Str" + tgtData.getName());
      }
      logger.debug("String_Node_Str" + tgtData.getName() + "String_Node_Str"+ tgtData.getURIs());
    }
 else {
      logger.warn("String_Node_Str" + c.getName());
    }
  }
}
Program: 70482
Project: 70482
Buggy source:
public long getMonitorInterval(){
  return config.getLong(ITConstants.IT_MONITOR);
}

Fixed version (ground truth):
public long getMonitorInterval(){
  return config.getLong(ITConstants.IT_MONITOR,ITConstants.DEFAULT_MONITOR_INTERVAL);
}
Program: 70483
Project: 70483
Buggy source:
public String getDeploymentId(){
  return config.getString(ITConstants.IT_DEPLOYMENT_ID);
}

Fixed version (ground truth):
public String getDeploymentId(){
  return config.getString(ITConstants.IT_DEPLOYMENT_ID,ITConstants.DEFAULT_DEPLOYMENT_ID);
}
Program: 70484
Project: 70484
Buggy source:
public void stop(boolean saveUniqueData,ShutdownListener sl){
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  Semaphore sem=new Semaphore(0);
  SafeCopyListener listener=new SafeCopyListener(sem);
  HashSet<LogicalData> lds=LogicalData.getAllDataFromHost(this);
  HashMap<String,String> disks=SharedDiskManager.terminate(this);
  COMPSsNode masterNode=Comm.appHost.getNode();
  for (  LogicalData ld : lds) {
    ld.notifyToInProgressCopiesEnd(listener);
    DataLocation lastLoc=ld.removeHostAndCheckLocationToSave(this,disks);
    if (lastLoc != null && saveUniqueData) {
      listener.addOperation();
      DataLocation safeLoc=DataLocation.getLocation(Comm.appHost,Comm.appHost.getTempDirPath() + ld.getName());
      masterNode.obtainData(ld,lastLoc,safeLoc,ld,new SafeCopyTransferable(),listener);
    }
  }
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  listener.enable();
  try {
    sem.acquire();
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (this.getType() != Type.SERVICE) {
    if (tracing) {
      node.generatePackage();
      getTracingPackageToMaster();
    }
    if (debug) {
      node.generateWorkersDebugInfo();
      getWorkersDebugInfo();
    }
  }
  this.deleteIntermediate();
  sl.addOperation();
  node.stop(sl);
}

Fixed version (ground truth):
public void stop(boolean saveUniqueData,ShutdownListener sl){
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  Semaphore sem=new Semaphore(0);
  SafeCopyListener listener=new SafeCopyListener(sem);
  HashSet<LogicalData> lds=LogicalData.getAllDataFromHost(this);
  HashMap<String,String> disks=SharedDiskManager.terminate(this);
  COMPSsNode masterNode=Comm.appHost.getNode();
  for (  LogicalData ld : lds) {
    ld.notifyToInProgressCopiesEnd(listener);
    DataLocation lastLoc=ld.removeHostAndCheckLocationToSave(this,disks);
    if (lastLoc != null && saveUniqueData) {
      listener.addOperation();
      DataLocation safeLoc=DataLocation.getLocation(Comm.appHost,Comm.appHost.getTempDirPath() + ld.getName());
      masterNode.obtainData(ld,lastLoc,safeLoc,ld,new SafeCopyTransferable(),listener);
    }
  }
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  listener.enable();
  try {
    sem.acquire();
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str" + getName() + "String_Node_Str");
  }
  if (debug) {
    logger.debug("String_Node_Str" + this.getName());
  }
  if (this.getType() != Type.SERVICE) {
    if (tracing) {
      node.generatePackage();
      getTracingPackageToMaster();
      if (debug) {
        logger.debug("String_Node_Str" + this.getName());
      }
    }
    if (debug) {
      node.generateWorkersDebugInfo();
      getWorkersDebugInfo();
      logger.debug("String_Node_Str" + this.getName());
    }
  }
  this.deleteIntermediate();
  sl.addOperation();
  node.stop(sl);
}
Program: 70485
Project: 70485
Buggy source:
public void receivedShutdown(Connection requester,LinkedList<Data> filesToSend){
  closingConnection=requester;
  finish=true;
  if (!hasPendingTransfers()) {
    shutdown(closingConnection);
  }
}

Fixed version (ground truth):
public void receivedShutdown(Connection requester,LinkedList<Data> filesToSend){
  logger.debug("String_Node_Str");
  closingConnection=requester;
  finish=true;
  if (!hasPendingTransfers()) {
    shutdown(closingConnection);
  }
}
Program: 70486
Project: 70486
Buggy source:
@Override public void generateWorkersDebugInfo(){
  logger.debug("String_Node_Str" + this.getHost());
  if (node == null) {
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  CommandGenerateWorkerDebugFiles cmd=new CommandGenerateWorkerDebugFiles(this.getHost(),this.getInstallDir(),this.getWorkingDir(),this.getName());
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void generateWorkersDebugInfo(){
  logger.debug("String_Node_Str" + this.getHost());
  if (node == null) {
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  CommandGenerateWorkerDebugFiles cmd=new CommandGenerateWorkerDebugFiles(this.getHost(),this.getInstallDir(),this.getWorkingDir(),this.getName());
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
  commManager.waitUntilWorkersDebugInfoGenerated();
  logger.debug("String_Node_Str");
}
Program: 70487
Project: 70487
Buggy source:
@Override public void stop(ShutdownListener sl){
  logger.info("String_Node_Str" + this.getName());
  if (node == null) {
    sl.notifyFailure(new Exception());
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  commManager.shuttingDown(this,c,sl);
  CommandShutdown cmd=new CommandShutdown(null,null);
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
}

Fixed version (ground truth):
@Override public void stop(ShutdownListener sl){
  logger.debug("String_Node_Str" + this.getName());
  if (node == null) {
    sl.notifyFailure(new Exception());
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  commManager.shuttingDown(this,c,sl);
  CommandShutdown cmd=new CommandShutdown(null,null);
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
}
Program: 70488
Project: 70488
Buggy source:
public void processRequests(){
  while (true) {
    Job<?> job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      job.submit();
      if (debug) {
        logger.debug("String_Node_Str" + job.getJobId() + "String_Node_Str");
      }
    }
 catch (    Exception ex) {
      logger.error(SUBMISSION_ERROR + job.getJobId(),ex);
      job.getListener().jobFailed(job,Job.JobListener.JobEndStatus.SUBMISSION_FAILED);
    }
  }
}

Fixed version (ground truth):
public void processRequests(){
  while (true) {
    Job<?> job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      job.submit();
      if (debug) {
        logger.debug("String_Node_Str" + job.getJobId() + "String_Node_Str");
      }
    }
 catch (    Exception ex) {
      logger.error(SUBMISSION_ERROR + job.getJobId(),ex);
      job.getListener().jobFailed(job,Job.JobListener.JobEndStatus.SUBMISSION_FAILED);
    }
  }
  logger.debug("String_Node_Str");
}
Program: 70489
Project: 70489
Buggy source:
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new WSJob(taskId,taskParams,impl,res,listener);
}

Fixed version (ground truth):
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new WSJob<COMPSsWorker>(taskId,taskParams,impl,res,listener);
}
Program: 70490
Project: 70490
Buggy source:
public static void init() throws Exception {
  if (callerQueue == null) {
    callerQueue=new RequestQueue<WSJob>();
  }
 else {
    callerQueue.clear();
  }
  caller=new WSCaller(callerQueue);
  callerPool=new ThreadPool(POOL_SIZE,POOL_NAME,caller);
  try {
    callerPool.startThreads();
  }
 catch (  Exception e) {
    logger.error(THREAD_POOL_ERR,e);
    throw e;
  }
}

Fixed version (ground truth):
public static void init() throws Exception {
  if (callerQueue == null) {
    callerQueue=new RequestQueue<WSJob<?>>();
  }
 else {
    callerQueue.clear();
  }
  caller=new WSCaller(callerQueue);
  callerPool=new ThreadPool(POOL_SIZE,POOL_NAME,caller);
  try {
    callerPool.startThreads();
  }
 catch (  Exception e) {
    logger.error(THREAD_POOL_ERR,e);
    throw e;
  }
}
Program: 70491
Project: 70491
Buggy source:
public WSCaller(RequestQueue<WSJob> queue){
  super(queue);
}

Fixed version (ground truth):
public WSCaller(RequestQueue<WSJob<?>> queue){
  super(queue);
}
Program: 70492
Project: 70492
Buggy source:
public void processRequests(){
  while (true) {
    WSJob job=null;
    job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      ArrayList<Object> input=new ArrayList<Object>();
      TaskParams taskParams=job.taskParams;
      ServiceImplementation service=(ServiceImplementation)job.impl;
      Parameter[] parameters=taskParams.getParameters();
      for (int i=0; i < taskParams.getParameters().length; i++) {
        if (parameters[i].getDirection() == ParamDirection.IN) {
switch (parameters[i].getType()) {
case OBJECT_T:
case SCO_T:
case PSCO_T:
            DependencyParameter dp=(DependencyParameter)parameters[i];
          Object o=getObjectValue(dp);
        input.add(o);
      break;
case FILE_T:
    break;
default :
  BasicTypeParameter btParB=(BasicTypeParameter)parameters[i];
input.add(btParB.getValue());
}
}
}
ServiceInstance si=(ServiceInstance)job.getResourceNode();
String portName=service.getRequirements().getPort();
String operationName=service.getOperation();
if (operationName.compareTo("String_Node_Str") == 0) {
operationName=taskParams.getName();
}
Client client=getClient(si,portName);
ClientCallback cb=new ClientCallback();
client.invoke(cb,operationName,input.toArray());
Object[] result=cb.get();
if (result.length > 0) {
job.returnValue=result[0];
}
job.listener.jobCompleted(job);
}
 catch (Exception e) {
job.listener.jobFailed(job,JobEndStatus.EXECUTION_FAILED);
logger.error(SUBMIT_ERROR,e);
return;
}
}
}

Fixed version (ground truth):
public void processRequests(){
  while (true) {
    WSJob<?> job=null;
    job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      ArrayList<Object> input=new ArrayList<Object>();
      TaskParams taskParams=job.taskParams;
      ServiceImplementation service=(ServiceImplementation)job.impl;
      Parameter[] parameters=taskParams.getParameters();
      for (int i=0; i < taskParams.getParameters().length; i++) {
        if (parameters[i].getDirection() == ParamDirection.IN) {
switch (parameters[i].getType()) {
case OBJECT_T:
case SCO_T:
case PSCO_T:
            DependencyParameter dp=(DependencyParameter)parameters[i];
          Object o=getObjectValue(dp);
        input.add(o);
      break;
case FILE_T:
    break;
default :
  BasicTypeParameter btParB=(BasicTypeParameter)parameters[i];
input.add(btParB.getValue());
}
}
}
ServiceInstance si=(ServiceInstance)job.getResourceNode();
String portName=service.getRequirements().getPort();
String operationName=service.getOperation();
if (operationName.compareTo("String_Node_Str") == 0) {
operationName=taskParams.getName();
}
Client client=getClient(si,portName);
ClientCallback cb=new ClientCallback();
client.invoke(cb,operationName,input.toArray());
Object[] result=cb.get();
if (result.length > 0) {
job.returnValue=result[0];
}
job.listener.jobCompleted(job);
}
 catch (Exception e) {
job.listener.jobFailed(job,JobEndStatus.EXECUTION_FAILED);
logger.error(SUBMIT_ERROR,e);
return;
}
}
}
Program: 70493
Project: 70493
Buggy source:
@Override public void reduceDynamic(ResourceDescription rd){
}

Fixed version (ground truth):
@Override public ResourceDescription reduceDynamic(ResourceDescription rd){
  return null;
}
Program: 70494
Project: 70494
Buggy source:
private static void testImmutableObjects(){
  Integer i=ObjectTestImpl.createInteger(5);
  String s=ObjectTestImpl.createString("String_Node_Str");
  System.out.println("String_Node_Str" + i);
  System.out.println("String_Node_Str" + s);
  ObjectTestImpl.printObjects(i,s);
}

Fixed version (ground truth):
private static void testImmutableObjects(){
  Integer i=ObjectTestImpl.createInteger(5);
  String s=ObjectTestImpl.createString("String_Node_Str");
  System.out.println("String_Node_Str" + i);
  System.out.println("String_Node_Str" + s);
  ObjectTestImpl.printContent(i,s);
}
Program: 70495
Project: 70495
Buggy source:
public static void printObjects(Integer i,String s){
  System.out.println("String_Node_Str" + i);
  System.out.println("String_Node_Str" + s);
}

Fixed version (ground truth):
public static void printObjects(A a,B b){
  System.out.println("String_Node_Str" + a.getIntField());
  System.out.println("String_Node_Str" + b.getStringField());
}
Program: 70496
Project: 70496
Buggy source:
@Method(declaringClass="String_Node_Str") void printObjects(@Parameter(type=Type.OBJECT,direction=Direction.IN) Integer i,@Parameter(type=Type.OBJECT,direction=Direction.IN) String s);

Fixed version (ground truth):
@Method(declaringClass="String_Node_Str") void printObjects(@Parameter(type=Type.OBJECT,direction=Direction.IN) A a,@Parameter(type=Type.OBJECT,direction=Direction.IN) B b);
Program: 70497
Project: 70497
Buggy source:
public AbstractCustomCardWithType(String id,String name,String img,String bgTexture,String bgTexture_p,int cost,String rawDescription,CardType type,CardColor color,CardRarity rarity,CardTarget target,int cardPool,CardColorType damageType,boolean willApplyPowers){
  super(id,name,img,bgTexture,bgTexture_p,cost,rawDescription,type,color,rarity,target,cardPool);
  colorType=damageType;
  this.willApplyPowers=willApplyPowers;
}

Fixed version (ground truth):
public AbstractCustomCardWithType(String id,String name,String img,String bgTexture,String bgTexture_p,int cost,String rawDescription,CardType type,CardColor color,CardRarity rarity,CardTarget target,int cardPool,CardColorType damageType,boolean willApplyPowers){
  super(id,name,img,bgTexture,bgTexture_p,cost,rawDescription,type,color,rarity,target,cardPool);
  colorType=damageType;
  this.willApplyPowers=willApplyPowers;
  assignOrbTexture();
}
Program: 70498
Project: 70498
Buggy source:
public ShadowStrike(){
  super(ID,NAME,IMG,BG_IMG,BG_IMG_P,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1);
  this.baseDamage=ATK_DMG;
}

Fixed version (ground truth):
public ShadowStrike(){
  super(ID,NAME,IMG,BG_IMG,BG_IMG_P,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
  this.baseDamage=ATK_DMG;
}
Program: 70499
Project: 70499
Buggy source:
public ShadowWall(){
  super(ID,NAME,IMG,BG_IMG,BG_IMG_P,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1);
  this.baseDamage=ATK_DMG;
  this.baseBlock=BLOCK;
}

Fixed version (ground truth):
public ShadowWall(){
  super(ID,NAME,IMG,BG_IMG,BG_IMG_P,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
  this.baseDamage=ATK_DMG;
  this.baseBlock=BLOCK;
}
Program: 70501
Project: 70501
Buggy source:
public RemoveDebuffAction(AbstractCreature target,AbstractCreature owner,int debuffsRemoved){
  for (int i=0; i < debuffsRemoved; i++) {
    ArrayList<AbstractPower> debuffs=new ArrayList<AbstractPower>();
    for (    AbstractPower p : target.powers) {
      if (p.type == AbstractPower.PowerType.DEBUFF) {
        debuffs.add(p);
      }
    }
    if (!debuffs.isEmpty()) {
      AbstractPower randDebuff=debuffs.get((new Random()).random(debuffs.size()));
      randDebuff.flash();
      AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(target,target,randDebuff.ID));
    }
  }
}

Fixed version (ground truth):
public RemoveDebuffAction(AbstractCreature target,AbstractCreature owner,int debuffsRemoved){
  for (int i=0; i < debuffsRemoved; i++) {
    ArrayList<AbstractPower> debuffs=new ArrayList<AbstractPower>();
    for (    AbstractPower p : target.powers) {
      if (p.type == AbstractPower.PowerType.DEBUFF) {
        debuffs.add(p);
      }
    }
    if (!debuffs.isEmpty()) {
      AbstractPower randDebuff=debuffs.get((new Random()).random(debuffs.size() - 1));
      randDebuff.flash();
      AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(target,target,randDebuff.ID));
    }
  }
}
Program: 70502
Project: 70502
Buggy source:
public Cauterize(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,POOL);
  this.isInnate=true;
  tips=new ArrayList<TooltipInfo>();
  tips.add(new TooltipInfo("String_Node_Str","String_Node_Str"));
  this.exhaust=true;
}

Fixed version (ground truth):
public Cauterize(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,POOL);
  tips=new ArrayList<TooltipInfo>();
  tips.add(new TooltipInfo("String_Node_Str","String_Node_Str"));
  this.exhaust=true;
}
Program: 70503
Project: 70503
Buggy source:
public void upgrade(){
  if (!this.upgraded) {
    this.upgradeName();
    this.exhaust=false;
    this.EXHAUST_TEXT="String_Node_Str";
  }
}

Fixed version (ground truth):
public void upgrade(){
  if (!this.upgraded) {
    this.upgradeName();
    this.exhaust=false;
    this.rawDescription="String_Node_Str";
    this.initializeDescription();
  }
}
Program: 70504
Project: 70504
Buggy source:
@Override public void use(AbstractPlayer p,AbstractMonster arg1){
  AbstractDungeon.actionManager.addToBottom(new GainEnergyAction(magicNumber));
}

Fixed version (ground truth):
@Override public void use(AbstractPlayer p,AbstractMonster arg1){
  if (p.hasPower("String_Node_Str"))   AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p,p,"String_Node_Str"));
  if (p.hasPower("String_Node_Str"))   AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p,p,"String_Node_Str"));
  BlackMageMod.resetOrbColor((CustomPlayer)p);
  AbstractDungeon.actionManager.addToBottom(new GainEnergyAction(magicNumber));
}
Program: 70505
Project: 70505
Buggy source:
@Override public void use(AbstractPlayer p,AbstractMonster m){
  AbstractDungeon.actionManager.addToBottom(new DiscardAction(p,p,1,false));
  AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p,m,new WeakPower(m,magicNumber,false),magicNumber));
}

Fixed version (ground truth):
@Override public void use(AbstractPlayer p,AbstractMonster m){
  AbstractDungeon.actionManager.addToBottom(new DiscardAction(p,p,1,false));
  AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m,p,new WeakPower(m,magicNumber,false),magicNumber));
}
Program: 70506
Project: 70506
Buggy source:
public HotCoals(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
  this.baseMagicNumber=MAGIC;
  this.magicNumber=MAGIC;
}

Fixed version (ground truth):
public HotCoals(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
  this.baseMagicNumber=MAGIC;
  this.magicNumber=MAGIC;
  this.bonus=0;
}
Program: 70507
Project: 70507
Buggy source:
@Override public void upgrade(){
  if (!upgraded) {
    this.upgradeName();
    this.upgradeBaseCost(0);
  }
}

Fixed version (ground truth):
@Override public void upgrade(){
  if (!upgraded) {
    this.upgradeName();
    bonus=1;
  }
}
Program: 70508
Project: 70508
Buggy source:
@Override public void use(AbstractPlayer p,AbstractMonster m){
  if (p.hasPower("String_Node_Str")) {
    int amt=p.getPower("String_Node_Str").amount;
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p,p,new GainAshNextTurnPower(p,amt),amt));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p,p,"String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void use(AbstractPlayer p,AbstractMonster m){
  if (p.hasPower("String_Node_Str")) {
    int amt=p.getPower("String_Node_Str").amount + bonus;
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p,p,new GainAshNextTurnPower(p,amt),amt));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p,p,"String_Node_Str"));
  }
}
Program: 70509
Project: 70509
Buggy source:
public SheerCold(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
}

Fixed version (ground truth):
public SheerCold(){
  super(ID,NAME,IMG,COST,DESCRIPTION,TYPE,COLOR,RARITY,TARGET,1,COLOR_TYPE);
  this.exhaust=true;
}
Program: 70510
Project: 70510
Buggy source:
public static CharSelectInfo getLoadout(){
  CharSelectInfo selectInfo=new CharSelectInfo("String_Node_Str","String_Node_Str",START_HP,START_HP,1,99,5,EnumPatch.BLACK_MAGE_CLASS,getStartingRelics(),getStartingDeck(),false);
  return selectInfo;
}

Fixed version (ground truth):
public static CharSelectInfo getLoadout(){
  CharSelectInfo selectInfo=new CharSelectInfo("String_Node_Str","String_Node_Str",START_HP,START_HP,2,99,5,EnumPatch.BLACK_MAGE_CLASS,getStartingRelics(),getStartingDeck(),false);
  return selectInfo;
}
Program: 70511
Project: 70511
Buggy source:
public void stackPower(int stackAmount){
  this.amount+=stackAmount;
  if (this.amount >= 5) {
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new DamageRandomEnemyAction(new DamageInfo(owner,5,DamageInfo.DamageType.THORNS),AttackEffect.FIRE));
    this.amount=1;
  }
}

Fixed version (ground truth):
public void stackPower(int stackAmount){
  this.amount+=stackAmount;
  if (this.amount >= cap) {
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new DamageRandomEnemyAction(new DamageInfo(owner,5,DamageInfo.DamageType.THORNS),AttackEffect.FIRE));
    this.amount=1;
  }
}
Program: 70512
Project: 70512
Buggy source:
@Override public void updateDescription(){
  if (this.amount > 0) {
    this.description=("String_Node_Str" + DESCRIPTIONS[0] + this.amount+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void updateDescription(){
  if (this.amount > 0) {
    this.description=("String_Node_Str" + DESCRIPTIONS[0] + this.amount+ "String_Node_Str"+ cap+ "String_Node_Str");
  }
}