nus-yam/ex-repair huggingface dataset:
Program: 70307
Project: 70307
Buggy source:
@Override public void run(){
  try {
    final byte[] buffer=new byte[BUFFER_SIZE];
    int nRead;
    while ((nRead=in.read(buffer,0,buffer.length)) != -1) {
      byte[] readData=new byte[nRead];
      System.arraycopy(buffer,0,readData,0,nRead);
      out.print(new String(readData));
    }
  }
 catch (  IOException ioe) {
    logger.error("String_Node_Str",ioe);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException ioe) {
        logger.warn("String_Node_Str",ioe);
      }
    }
    if (out != null) {
      out.flush();
      out.close();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  logger.debug("String_Node_Str");
  try {
    final byte[] buffer=new byte[BUFFER_SIZE];
    int nRead;
    while ((nRead=in.read(buffer,0,buffer.length)) != -1) {
      byte[] readData=new byte[nRead];
      System.arraycopy(buffer,0,readData,0,nRead);
      out.print(new String(readData));
      out.flush();
    }
  }
 catch (  IOException ioe) {
    logger.error("String_Node_Str",ioe);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException ioe) {
        logger.warn("String_Node_Str",ioe);
      }
    }
    if (out != null) {
      out.flush();
    }
  }
}
Program: 70308
Project: 70308
Buggy source:
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
  for (  Resource r : loc.getHosts()) {
switch (loc.getType()) {
case PRIVATE:
      r.addLogicalData(this);
    break;
case SHARED:
  SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
}

Fixed version (ground truth):
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
switch (loc.getType()) {
case PRIVATE:
    for (    Resource r : loc.getHosts()) {
      r.addLogicalData(this);
    }
  break;
case SHARED:
SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
Program: 70309
Project: 70309
Buggy source:
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null)   return;
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  for (  DataLocation loc : ld.getLocations()) {
    if (loc.getProtocol().equals(Protocol.PERSISTENT_URI)) {
      orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
      return;
    }
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName());
  }
  orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
}

Fixed version (ground truth):
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null) {
    return;
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  if (ld.getId() != null) {
    orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
  }
 else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + ld.getName());
    }
    orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
  }
}
Program: 70310
Project: 70310
Buggy source:
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,Comm.getAppHost().getName());
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}

Fixed version (ground truth):
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,targetHostname);
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}
Program: 70311
Project: 70311
Buggy source:
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
  for (  Resource r : loc.getHosts()) {
switch (loc.getType()) {
case PRIVATE:
      r.addLogicalData(this);
    break;
case SHARED:
  SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
}

Fixed version (ground truth):
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
switch (loc.getType()) {
case PRIVATE:
    for (    Resource r : loc.getHosts()) {
      r.addLogicalData(this);
    }
  break;
case SHARED:
SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
Program: 70312
Project: 70312
Buggy source:
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null)   return;
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  for (  DataLocation loc : ld.getLocations()) {
    if (loc.getProtocol().equals(Protocol.PERSISTENT_URI)) {
      orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
      return;
    }
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName());
  }
  orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
}

Fixed version (ground truth):
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null) {
    return;
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  if (ld.getId() != null) {
    orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
  }
 else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + ld.getName());
    }
    orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
  }
}
Program: 70313
Project: 70313
Buggy source:
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,Comm.getAppHost().getName());
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}

Fixed version (ground truth):
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,targetHostname);
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}
Program: 70314
Project: 70314
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.taskId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.jobId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}
Program: 70315
Project: 70315
Buggy source:
/** 
 * New task result from a given set of   {@code params}
 * @param taskId
 * @param params
 */
public NIOTaskResult(int taskId,LinkedList<NIOParam> params){
  this.taskId=taskId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}

Fixed version (ground truth):
/** 
 * New task result from a given set of   {@code params}
 * @param jobId
 * @param params
 */
public NIOTaskResult(int jobId,LinkedList<NIOParam> params){
  this.jobId=jobId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}
Program: 70316
Project: 70316
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.taskId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.jobId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}
Program: 70317
Project: 70317
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(this.taskId).append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  DataType param : this.paramTypes) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Object param : this.paramValues) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(this.jobId).append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  DataType param : this.paramTypes) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Object param : this.paramValues) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 70318
Project: 70318
Buggy source:
public static void reduceWholeWorker(MethodWorker worker){
  ResourceUpdate<MethodResourceDescription> modification=new PendingReduction<>(worker.getDescription());
  resourceUser.updatedResource(worker,modification);
}

Fixed version (ground truth):
public static void reduceWholeWorker(MethodWorker worker){
  ResourceUpdate<MethodResourceDescription> modification=new PendingReduction<>(worker.getDescription().copy());
  resourceUser.updatedResource(worker,modification);
}
Program: 70319
Project: 70319
Buggy source:
/** 
 * Selects a subset of the critical set able to execute all the cores
 */
public void defineCriticalSet(){
synchronized (this) {
    int coreCount=CoreManager.getCoreCount();
    boolean[] runnable=new boolean[coreCount];
    for (int coreId=0; coreId < coreCount; coreId++) {
      runnable[coreId]=false;
    }
    String resourceName;
    for (    Worker<? extends WorkerResourceDescription> res : staticSet.values()) {
      List<Integer> cores=res.getExecutableCores();
      for (int i=0; i < cores.size(); i++) {
        runnable[cores.get(i)]=true;
      }
    }
    for (    DynamicMethodWorker resource : criticalOrder) {
      resourceName=resource.getName();
      List<Integer> executableCores=resource.getExecutableCores();
      boolean needed=false;
      for (int i=0; i < executableCores.size() && !needed; i++) {
        needed=needed || !runnable[executableCores.get(i)];
      }
      if (needed) {
        for (int i=0; i < executableCores.size(); i++) {
          runnable[executableCores.get(i)]=true;
        }
      }
 else {
        criticalSet.remove(resourceName);
        criticalOrder.remove(resource);
        nonCriticalSet.put(resourceName,resource);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Selects a subset of the critical set able to execute all the cores
 */
public void defineCriticalSet(){
synchronized (this) {
    int coreCount=CoreManager.getCoreCount();
    boolean[] runnable=new boolean[coreCount];
    for (int coreId=0; coreId < coreCount; coreId++) {
      runnable[coreId]=false;
    }
    String resourceName;
    for (    Worker<? extends WorkerResourceDescription> res : staticSet.values()) {
      List<Integer> cores=res.getExecutableCores();
      for (int i=0; i < cores.size(); i++) {
        runnable[cores.get(i)]=true;
      }
    }
    LinkedList<DynamicMethodWorker> criticalOrderRemovals=new LinkedList();
    for (    DynamicMethodWorker resource : criticalOrder) {
      resourceName=resource.getName();
      List<Integer> executableCores=resource.getExecutableCores();
      boolean needed=false;
      for (int i=0; i < executableCores.size() && !needed; i++) {
        needed=needed || !runnable[executableCores.get(i)];
      }
      if (needed) {
        for (int i=0; i < executableCores.size(); i++) {
          runnable[executableCores.get(i)]=true;
        }
      }
 else {
        criticalSet.remove(resourceName);
        criticalOrderRemovals.add(resource);
        nonCriticalSet.put(resourceName,resource);
      }
    }
    for (    DynamicMethodWorker resource : criticalOrderRemovals) {
      criticalOrder.remove(resource);
    }
  }
}
Program: 70320
Project: 70320
Buggy source:
public static void reduceWholeWorker(MethodWorker worker){
  ResourceUpdate<MethodResourceDescription> modification=new PendingReduction<>(worker.getDescription());
  resourceUser.updatedResource(worker,modification);
}

Fixed version (ground truth):
public static void reduceWholeWorker(MethodWorker worker){
  ResourceUpdate<MethodResourceDescription> modification=new PendingReduction<>(worker.getDescription().copy());
  resourceUser.updatedResource(worker,modification);
}
Program: 70321
Project: 70321
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.taskId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.jobId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}
Program: 70322
Project: 70322
Buggy source:
/** 
 * New task result from a given set of   {@code params}
 * @param taskId
 * @param params
 */
public NIOTaskResult(int taskId,LinkedList<NIOParam> params){
  this.taskId=taskId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}

Fixed version (ground truth):
/** 
 * New task result from a given set of   {@code params}
 * @param jobId
 * @param params
 */
public NIOTaskResult(int jobId,LinkedList<NIOParam> params){
  this.jobId=jobId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}
Program: 70323
Project: 70323
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.taskId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.jobId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}
Program: 70324
Project: 70324
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(this.taskId).append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  DataType param : this.paramTypes) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Object param : this.paramValues) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(this.jobId).append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  DataType param : this.paramTypes) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Object param : this.paramValues) {
    sb.append("String_Node_Str").append(param);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 70326
Project: 70326
Buggy source:
@Override public Object invokeMethod() throws JobExecutionException {
  checkArguments();
  return invokeMPIMethod();
}

Fixed version (ground truth):
@Override public Object invokeMethod() throws JobExecutionException {
  checkArguments();
  return invokeDecafMethod();
}
Program: 70328
Project: 70328
Buggy source:
private static String writeHostfile(File taskSandboxWorkingDir,String workers) throws InvokeExecutionException {
  String filename=taskSandboxWorkingDir.getAbsolutePath() + File.separator + "String_Node_Str";
  BufferedWriter writer=null;
  try {
    writer=new BufferedWriter(new FileWriter(filename));
    writer.write(workers);
  }
 catch (  IOException e) {
    throw new InvokeExecutionException("String_Node_Str",e);
  }
 finally {
    try {
      if (writer != null)       writer.close();
    }
 catch (    IOException e) {
    }
  }
  return filename;
}

Fixed version (ground truth):
private static String writeHostfile(File taskSandboxWorkingDir,String workers) throws InvokeExecutionException {
  String filename=taskSandboxWorkingDir.getAbsolutePath() + File.separator + "String_Node_Str";
  String workersInLines=workers.replace(',','\n');
  BufferedWriter writer=null;
  try {
    writer=new BufferedWriter(new FileWriter(filename));
    writer.write(workersInLines);
  }
 catch (  IOException e) {
    throw new InvokeExecutionException("String_Node_Str",e);
  }
 finally {
    try {
      if (writer != null)       writer.close();
    }
 catch (    IOException e) {
    }
  }
  return filename;
}
Program: 70329
Project: 70329
Buggy source:
public void newCoreElementsDetected(List<Integer> newCores){
  int coreCount=CoreManager.getCoreCount();
  for (  CloudInstanceTypeDescription type : types.values()) {
    int[][] slotsI=new int[coreCount][];
    int[] slotsC=type.getSlotsCore().clone();
    for (int i=0; i < type.getSlotsImplLength(); ++i) {
      int[] slotsImpl=type.getSpecificSlotsImpl(i);
      slotsI[i]=slotsImpl.clone();
    }
    for (    int coreId : newCores) {
      List<Implementation> impls=CoreManager.getCoreImplementations(coreId);
      int implsSize=impls.size();
      slotsI[coreId]=new int[implsSize];
      for (int implId=0; implId < implsSize; ++implId) {
        Implementation impl=impls.get(implId);
        if (impl.getTaskType() == TaskType.METHOD) {
          MethodResourceDescription rd=(MethodResourceDescription)impl.getRequirements();
          Integer into=type.getResourceDescription().canHostSimultaneously(rd);
          slotsC[coreId]=Math.max(slotsC[coreId],into);
          slotsI[coreId][implId]=into;
        }
      }
    }
    type.setSlotsCore(slotsC);
    type.setSlotsImpl(slotsI);
  }
}

Fixed version (ground truth):
public void newCoreElementsDetected(List<Integer> newCores){
  int coreCount=CoreManager.getCoreCount();
  for (  CloudInstanceTypeDescription type : types.values()) {
    int[][] slotsI=new int[coreCount][];
    int[] slotsC=Arrays.copyOf(type.getSlotsCore(),coreCount);
    for (int i=0; i < type.getSlotsImplLength(); ++i) {
      int[] slotsImpl=type.getSpecificSlotsImpl(i);
      slotsI[i]=slotsImpl.clone();
    }
    for (    int coreId : newCores) {
      List<Implementation> impls=CoreManager.getCoreImplementations(coreId);
      int implsSize=impls.size();
      slotsI[coreId]=new int[implsSize];
      for (int implId=0; implId < implsSize; ++implId) {
        Implementation impl=impls.get(implId);
        if (impl.getTaskType() == TaskType.METHOD) {
          MethodResourceDescription rd=(MethodResourceDescription)impl.getRequirements();
          Integer into=type.getResourceDescription().canHostSimultaneously(rd);
          slotsC[coreId]=Math.max(slotsC[coreId],into);
          slotsI[coreId][implId]=into;
        }
      }
    }
    type.setSlotsCore(slotsC);
    type.setSlotsImpl(slotsI);
  }
}
Program: 70330
Project: 70330
Buggy source:
/** 
 * Returns the total slots per per core
 * @return
 */
public static int[] getTotalSlots(){
  int[] counts=new int[CoreManager.getCoreCount()];
  int[] cloudCount=cloudManager.getPendingCoreCounts();
synchronized (pool) {
    for (int i=0; i < counts.length; i++) {
      if (i < cloudCount.length) {
        counts[i]=poolCoreMaxConcurrentTasks[i] + cloudCount[i];
      }
 else {
        counts[i]=poolCoreMaxConcurrentTasks[i];
      }
    }
  }
  return counts;
}

Fixed version (ground truth):
/** 
 * Returns the total slots per per core
 * @return
 */
public static int[] getTotalSlots(){
  int[] counts=new int[CoreManager.getCoreCount()];
  if (CoreManager.getCoreCount() > 0) {
    int[] cloudCount=cloudManager.getPendingCoreCounts();
synchronized (pool) {
      for (int i=0; i < counts.length; i++) {
        if (i < cloudCount.length) {
          counts[i]=poolCoreMaxConcurrentTasks[i] + cloudCount[i];
        }
 else {
          counts[i]=poolCoreMaxConcurrentTasks[i];
        }
      }
    }
  }
  return counts;
}
Program: 70331
Project: 70331
Buggy source:
/** 
 * Updates the coreElement information
 * @param updatedCores
 */
public static void coreElementUpdates(List<Integer> updatedCores){
synchronized (pool) {
    pool.coreElementUpdates(updatedCores);
    cloudManager.newCoreElementsDetected(updatedCores);
  }
}

Fixed version (ground truth):
/** 
 * Updates the coreElement information
 * @param updatedCores
 */
public static void coreElementUpdates(List<Integer> updatedCores){
synchronized (pool) {
    pool.coreElementUpdates(updatedCores);
    cloudManager.newCoreElementsDetected(updatedCores);
    updateMaxConcurrentTasks(updatedCores);
  }
}
Program: 70332
Project: 70332
Buggy source:
public boolean isPreserveSourceData(){
  return readDataVersion.hasPendingLectures();
}

Fixed version (ground truth):
public boolean isPreserveSourceData(){
  return readDataVersion.isOnlyReader();
}
Program: 70333
Project: 70333
Buggy source:
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  LOGGER.info("String_Node_Str" + storageConf);
  try (BufferedReader br=new BufferedReader(new FileReader(storageConf))){
    String line;
    while ((line=br.readLine()) != null) {
      hosts.add(line.trim());
      System.out.println("String_Node_Str" + line.trim() + "String_Node_Str");
    }
  }
 catch (  FileNotFoundException e) {
    throw new StorageException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new StorageException("String_Node_Str",e);
  }
  assert(!hosts.isEmpty());
  System.out.println("String_Node_Str" + MASTER_HOSTNAME);
  System.out.flush();
  try {
    redisClusterConnection=new JedisCluster(new HostAndPort(MASTER_HOSTNAME,REDIS_PORT));
  }
 catch (  JedisDataException e) {
    LOGGER.info("String_Node_Str");
    clusterMode=false;
    redisConnection=new Jedis(MASTER_HOSTNAME,REDIS_PORT);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  LOGGER.info("String_Node_Str" + storageConf);
  try (BufferedReader br=new BufferedReader(new FileReader(storageConf))){
    String line;
    while ((line=br.readLine()) != null) {
      hosts.add(line.trim());
      System.out.println("String_Node_Str" + line.trim() + "String_Node_Str");
    }
  }
 catch (  FileNotFoundException e) {
    throw new StorageException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new StorageException("String_Node_Str",e);
  }
  assert(!hosts.isEmpty());
  try {
    redisClusterConnection=new JedisCluster(new HostAndPort(MASTER_HOSTNAME,REDIS_PORT));
  }
 catch (  JedisDataException e) {
    LOGGER.info("String_Node_Str");
    clusterMode=false;
    redisConnection=new Jedis(MASTER_HOSTNAME,REDIS_PORT);
  }
}
Program: 70334
Project: 70334
Buggy source:
/** 
 * Consolidates all intermediate versions to the final id
 * @param idFinal
 * @throws StorageException
 */
public static void consolidateVersion(String idFinal) throws StorageException {
  LOGGER.info("String_Node_Str" + idFinal);
  idFinal=previousVersion.get(idFinal);
  previousVersion.remove(idFinal);
  while (idFinal != null) {
    removeById(idFinal);
    idFinal=previousVersion.get(idFinal);
    previousVersion.remove(idFinal);
  }
}

Fixed version (ground truth):
/** 
 * Consolidates all intermediate versions to the final id
 * @param idFinal
 * @throws StorageException
 */
public static void consolidateVersion(String idFinal) throws StorageException {
  LOGGER.info("String_Node_Str" + idFinal);
  idFinal=previousVersion.get(idFinal);
  while (idFinal != null) {
    LOGGER.info("String_Node_Str" + idFinal);
    removeById(idFinal);
    String oldId=idFinal;
    idFinal=previousVersion.get(idFinal);
    previousVersion.remove(oldId);
  }
}
Program: 70335
Project: 70335
Buggy source:
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  byte[] serializedObject=clusterMode ? redisClusterConnection.get(id.getBytes()) : redisConnection.get(id.getBytes());
  Object ret=Serializer.deserialize(serializedObject);
  ((StorageObject)ret).setID(id);
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  byte[] serializedObject=clusterMode ? redisClusterConnection.get(id.getBytes()) : redisConnection.get(id.getBytes());
  if (serializedObject == null) {
    throw new StorageException("String_Node_Str" + id + "String_Node_Str");
  }
  Object ret=Serializer.deserialize(serializedObject);
  ((StorageObject)ret).setID(id);
  return ret;
}
Program: 70336
Project: 70336
Buggy source:
/** 
 * Retrieves the result of persistent storage execution
 * @param event
 * @return
 */
public static Object getResult(CallbackEvent event) throws StorageException {
  if (true)   throw new StorageException("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieves the result of persistent storage execution
 * @param event
 * @return
 */
public static Object getResult(CallbackEvent event) throws StorageException {
  throw new StorageException("String_Node_Str");
}
Program: 70337
Project: 70337
Buggy source:
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  LOGGER.info("String_Node_Str" + storageConf);
  try (BufferedReader br=new BufferedReader(new FileReader(storageConf))){
    String line;
    while ((line=br.readLine()) != null) {
      hosts.add(line.trim());
      System.out.println("String_Node_Str" + line.trim() + "String_Node_Str");
    }
  }
 catch (  FileNotFoundException e) {
    throw new StorageException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new StorageException("String_Node_Str",e);
  }
  assert(!hosts.isEmpty());
  try {
    redisClusterConnection=new JedisCluster(new HostAndPort(MASTER_HOSTNAME,REDIS_PORT));
  }
 catch (  JedisDataException e) {
    LOGGER.info("String_Node_Str");
    clusterMode=false;
    redisConnection=new Jedis(MASTER_HOSTNAME,REDIS_PORT);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line TODO: What to do with storage conf? StorageItf.init needs different content wrt storage_init.sh
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  LOGGER.info("String_Node_Str" + storageConf);
  try (BufferedReader br=new BufferedReader(new FileReader(storageConf))){
    String line;
    while ((line=br.readLine()) != null) {
      hosts.add(line.trim());
      System.out.println("String_Node_Str" + line.trim() + "String_Node_Str");
    }
  }
 catch (  FileNotFoundException e) {
    throw new StorageException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new StorageException("String_Node_Str",e);
  }
  assert(!hosts.isEmpty());
  try {
    redisClusterConnection=new JedisCluster(new HostAndPort(MASTER_HOSTNAME,REDIS_PORT));
  }
 catch (  JedisDataException e) {
    LOGGER.info("String_Node_Str");
    clusterMode=false;
    redisConnection=new JedisPool(MASTER_HOSTNAME,REDIS_PORT);
  }
}
Program: 70338
Project: 70338
Buggy source:
/** 
 * Removes all the occurrences of a given @id
 * @param id
 */
public static void removeById(String id){
  if (clusterMode) {
    redisClusterConnection.del(id.getBytes());
  }
 else {
    redisConnection.del(id.getBytes());
  }
}

Fixed version (ground truth):
/** 
 * Removes all the occurrences of a given @id
 * @param id
 */
public static void removeById(String id){
  if (clusterMode) {
    redisClusterConnection.del(id.getBytes());
  }
 else {
    redisConnection.getResource().del(id.getBytes());
  }
}
Program: 70339
Project: 70339
Buggy source:
/** 
 * Stores the object @o in the persistent storage with id @id
 * @param o
 * @param id
 * @throws StorageException
 */
public static void makePersistent(Object o,String id) throws StorageException, IOException {
  byte[] serializedObject=Serializer.serialize(o);
  String result=clusterMode ? redisClusterConnection.set(id.getBytes(),serializedObject) : redisConnection.set(id.getBytes(),serializedObject);
  if (!result.equals("String_Node_Str")) {
    throw new StorageException("String_Node_Str" + id);
  }
}

Fixed version (ground truth):
/** 
 * Stores the object @o in the persistent storage with id @id
 * @param o
 * @param id
 * @throws StorageException
 */
public static void makePersistent(Object o,String id) throws StorageException, IOException {
  byte[] serializedObject=Serializer.serialize(o);
  String result=clusterMode ? redisClusterConnection.set(id.getBytes(),serializedObject) : redisConnection.getResource().set(id.getBytes(),serializedObject);
  if (!result.equals("String_Node_Str")) {
    throw new StorageException("String_Node_Str" + id);
  }
}
Program: 70340
Project: 70340
Buggy source:
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  byte[] serializedObject=clusterMode ? redisClusterConnection.get(id.getBytes()) : redisConnection.get(id.getBytes());
  if (serializedObject == null) {
    throw new StorageException("String_Node_Str" + id + "String_Node_Str");
  }
  Object ret=Serializer.deserialize(serializedObject);
  ((StorageObject)ret).setID(id);
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  byte[] serializedObject=clusterMode ? redisClusterConnection.get(id.getBytes()) : redisConnection.getResource().get(id.getBytes());
  if (serializedObject == null) {
    throw new StorageException("String_Node_Str" + id + "String_Node_Str");
  }
  Object ret=Serializer.deserialize(serializedObject);
  ((StorageObject)ret).setID(id);
  return ret;
}
Program: 70341
Project: 70341
Buggy source:
/** 
 * Returns all the valid locations of a given id WARNING: Given that Redis has no immediate mechanisms to retrieve this information, we will return all the nodes instead, because a connection to any of them will grant us that we can retrieve it
 * @param id
 * @return
 * @throws StorageException
 */
public static List<String> getLocations(String id) throws StorageException {
  return hosts;
}

Fixed version (ground truth):
/** 
 * Returns all the valid locations of a given id WARNING: Given that Redis has no immediate mechanisms to retrieve this information, we will return all the nodes instead, because a connection to any of them will grant us that we can retrieve it
 * @param id
 * @return
 * @throws StorageException
 */
public static List<String> getLocations(String id) throws StorageException {
  if (clusterMode) {
    return hosts;
  }
  return hosts;
}
Program: 70342
Project: 70342
Buggy source:
@Override public ResourceDescription getDynamicCommons(ResourceDescription other){
  MethodResourceDescription otherMRD=(MethodResourceDescription)other;
  MethodResourceDescription common=new MethodResourceDescription();
  for (  Processor p : otherMRD.getProcessors()) {
    boolean isProcessorCompatible=false;
    int i=0;
    while (i < this.processors.size() && !isProcessorCompatible) {
      Processor pThis=this.processors.get(i);
      if (checkProcessorCompatibility(pThis,p)) {
        isProcessorCompatible=true;
        common.addProcessor(getDynamicCommonsProcessor(pThis,p));
      }
      i=i + 1;
    }
  }
  if (checkCompatibility(this.memoryType,otherMRD.memoryType)) {
    common.setMemoryType(this.getMemoryType());
    common.setMemorySize(Math.min(this.memorySize,otherMRD.getMemorySize()));
  }
  return common;
}

Fixed version (ground truth):
@Override public ResourceDescription getDynamicCommons(ResourceDescription other){
  MethodResourceDescription otherMRD=(MethodResourceDescription)other;
  MethodResourceDescription common=new MethodResourceDescription();
  for (  Processor p : otherMRD.getProcessors()) {
    boolean isProcessorCompatible=false;
    int i=0;
    while (i < this.processors.size() && !isProcessorCompatible) {
      Processor pThis=this.processors.get(i);
      if (checkProcessorCompatibility(pThis,p)) {
        isProcessorCompatible=true;
        Processor commonProcessor=getDynamicCommonsProcessor(pThis,p);
        if (commonProcessor.getComputingUnits() > 0) {
          common.addProcessor(commonProcessor);
        }
      }
      i=i + 1;
    }
  }
  if (checkCompatibility(this.memoryType,otherMRD.memoryType)) {
    common.setMemoryType(this.getMemoryType());
    common.setMemorySize(Math.min(this.memorySize,otherMRD.getMemorySize()));
  }
  return common;
}
Program: 70343
Project: 70343
Buggy source:
public int getSpecificSlotsImpl(int i,int j){
  return this.slotsImpl[i][j];
}

Fixed version (ground truth):
public int getSpecificSlotsImpl(int coreId,int implId){
  return this.slotsImpl[coreId][implId];
}
Program: 70344
Project: 70344
Buggy source:
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  redisConnection=new Jedis("String_Node_Str",6379);
  hosts=new String[]{"String_Node_Str"};
}

Fixed version (ground truth):
/** 
 * Initializes the persistent storage Configuration file must contain all the worker hostnames, one by line
 * @param storageConf Path to the storage configuration File
 * @throws StorageException
 */
public static void init(String storageConf) throws StorageException, IOException {
  System.out.println("String_Node_Str" + storageConf);
  redisConnection=new Jedis("String_Node_Str",6379);
  hosts=new String[]{"String_Node_Str"};
}
Program: 70345
Project: 70345
Buggy source:
/** 
 * Removes all the occurrences of a given @id
 * @param id
 */
public static void removeById(String id){
  LOGGER.debug("String_Node_Str" + id);
  redisConnection.del(id.getBytes());
  LOGGER.debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Removes all the occurrences of a given @id
 * @param id
 */
public static void removeById(String id){
  redisConnection.del(id.getBytes());
}
Program: 70346
Project: 70346
Buggy source:
/** 
 * Stores the object @o in the persistent storage with id @id
 * @param o
 * @param id
 * @throws StorageException
 */
public static void makePersistent(Object o,String id) throws StorageException, IOException {
  LOGGER.debug("String_Node_Str");
  byte[] serializedObject=Serializer.serialize(o);
  LOGGER.debug("String_Node_Str");
  redisConnection.set(id.getBytes(),serializedObject);
  LOGGER.debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Stores the object @o in the persistent storage with id @id
 * @param o
 * @param id
 * @throws StorageException
 */
public static void makePersistent(Object o,String id) throws StorageException, IOException {
  byte[] serializedObject=Serializer.serialize(o);
  String result=redisConnection.set(id.getBytes(),serializedObject);
  if (!result.equals("String_Node_Str")) {
    throw new StorageException("String_Node_Str" + id);
  }
}
Program: 70347
Project: 70347
Buggy source:
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  LOGGER.debug("String_Node_Str");
  byte[] serializedObject=redisConnection.get(id.getBytes());
  LOGGER.debug("String_Node_Str");
  Object ret=Serializer.deserialize(serializedObject);
  LOGGER.debug("String_Node_Str");
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns the object with id @id This function retrieves the object from any location
 * @param id
 * @return
 * @throws StorageException
 */
public static Object getByID(String id) throws StorageException, IOException, ClassNotFoundException {
  byte[] serializedObject=redisConnection.get(id.getBytes());
  Object ret=Serializer.deserialize(serializedObject);
  ((StorageObject)ret).setID(id);
  return ret;
}
Program: 70348
Project: 70348
Buggy source:
/** 
 * Create a new version of the PSCO id @id in the host @hostname Returns the id of the new version
 * @param id
 * @param hostName
 * @return
 * @throws StorageException
 */
public static String newVersion(String id,boolean preserveSource,String hostName) throws StorageException {
  return null;
}

Fixed version (ground truth):
/** 
 * Create a new version of the PSCO id @id in the host @hostname Returns the id of the new version
 * @param id
 * @param hostName
 * @return
 * @throws StorageException
 */
public static String newVersion(String id,boolean preserveSource,String hostName) throws StorageException, IOException, ClassNotFoundException {
  Object obj=getByID(id);
  String new_id=UUID.randomUUID().toString();
  makePersistent(obj,new_id);
  if (!preserveSource) {
    removeById(id);
  }
  return new_id;
}
Program: 70349
Project: 70349
Buggy source:
/** 
 * Sets the ID
 */
protected void setID(String id) throws IOException, StorageException {
  if (this.id != null) {
    StorageItf.removeById(id);
    StorageItf.makePersistent(this,id);
  }
  this.id=id;
}

Fixed version (ground truth):
/** 
 * Sets the ID
 */
protected void setID(String id) throws IOException, StorageException {
  this.id=id;
}
Program: 70350
Project: 70350
Buggy source:
private static String getLsCpuOutput() throws InvalidMapException {
  String cmdOutput=null;
  ProcessBuilder pb=new ProcessBuilder("String_Node_Str");
  try {
    Process process=pb.start();
    process.getOutputStream().close();
    int exitValue=process.waitFor();
    if (exitValue != 0) {
      throw new InvalidMapException("String_Node_Str" + exitValue);
    }
    StringBuilder sb=new StringBuilder();
    try (BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream()))){
      String line=null;
      while ((line=br.readLine()) != null) {
        sb.append(line).append("String_Node_Str");
      }
    }
 catch (    IOException ioe) {
      throw new InvalidMapException("String_Node_Str",ioe);
    }
    cmdOutput=sb.toString();
  }
 catch (  IOException ioe) {
    throw new InvalidMapException("String_Node_Str",ioe);
  }
catch (  InterruptedException ie) {
    throw new InvalidMapException("String_Node_Str",ie);
  }
  return cmdOutput;
}

Fixed version (ground truth):
private static String getLsCpuOutput() throws InvalidMapException {
  String cmdOutput=null;
  ProcessBuilder pb=new ProcessBuilder("String_Node_Str");
  try {
    pb.environment().remove(Tracer.LD_PRELOAD);
    Process process=pb.start();
    process.getOutputStream().close();
    int exitValue=process.waitFor();
    if (exitValue != 0) {
      throw new InvalidMapException("String_Node_Str" + exitValue);
    }
    StringBuilder sb=new StringBuilder();
    try (BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream()))){
      String line=null;
      while ((line=br.readLine()) != null) {
        sb.append(line).append("String_Node_Str");
      }
    }
 catch (    IOException ioe) {
      throw new InvalidMapException("String_Node_Str",ioe);
    }
    cmdOutput=sb.toString();
  }
 catch (  IOException ioe) {
    throw new InvalidMapException("String_Node_Str",ioe);
  }
catch (  InterruptedException ie) {
    throw new InvalidMapException("String_Node_Str",ie);
  }
  return cmdOutput;
}
Program: 70351
Project: 70351
Buggy source:
/** 
 * New Core Elements have been detected; the Task Scheduler needs to be notified to modify any internal structure using that information.
 */
public final void coreElementsUpdated(){
  LOGGER.info("String_Node_Str");
  int newCoreCount=CoreManager.getCoreCount();
  SchedulingInformation.updateCoreCount(newCoreCount);
  this.blockedActions.updateCoreCount(newCoreCount);
  this.readyCounts=new int[newCoreCount];
  for (  ResourceScheduler<P,T,I> rs : workers.values()) {
    rs.updatedCoreElements(newCoreCount);
  }
}

Fixed version (ground truth):
/** 
 * New Core Elements have been detected; the Task Scheduler needs to be notified to modify any internal structure using that information.
 */
public final void coreElementsUpdated(){
  LOGGER.info("String_Node_Str");
  int newCoreCount=CoreManager.getCoreCount();
  SchedulingInformation.updateCoreCount(newCoreCount);
  this.blockedActions.updateCoreCount(newCoreCount);
  this.readyCounts=new int[newCoreCount];
  for (  ResourceScheduler<P,T,I> rs : workers.values()) {
    rs.updatedCoreElements(newCoreCount);
    SchedulingInformation.updateResource(rs);
  }
}
Program: 70352
Project: 70352
Buggy source:
@SuppressWarnings("String_Node_Str") public static <P extends Profile,T extends WorkerResourceDescription,I extends Implementation<T>>void changesOnWorker(ResourceScheduler<P,T,I> ui){
  for (  LinkedList<ResourceScheduler<Profile,WorkerResourceDescription,Implementation<WorkerResourceDescription>>> coreToWorker : coreToWorkers) {
    coreToWorker.remove(ui);
  }
  SchedulingInformation.updateCoreCount(CoreManager.getCoreCount());
  LinkedList<Integer> executableCores=ui.getExecutableCores();
  for (  int coreId : executableCores) {
    coreToWorkers.get(coreId).add((ResourceScheduler<Profile,WorkerResourceDescription,Implementation<WorkerResourceDescription>>)ui);
  }
}

Fixed version (ground truth):
public static <P extends Profile,T extends WorkerResourceDescription,I extends Implementation<T>>void changesOnWorker(ResourceScheduler<P,T,I> ui){
  for (  LinkedList<ResourceScheduler<Profile,WorkerResourceDescription,Implementation<WorkerResourceDescription>>> coreToWorker : coreToWorkers) {
    coreToWorker.remove(ui);
  }
  SchedulingInformation.updateCoreCount(CoreManager.getCoreCount());
  updateResource(ui);
}