Program: 70065
Project: 70065
Buggy source:
/** 
 * Received Data
 * @param c
 * @param t
 */
public void receivedData(Connection c,Transfer t){
  String dataId=ongoingTransfers.remove(c);
  if (dataId == null) {
    return;
  }
  if (DEBUG) {
    LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId);
  }
  releaseReceiveSlot();
  List<DataRequest> requests=dataToRequests.remove(dataId);
  boolean isBindingType=requests.get(0).getType().equals(DataType.BINDING_OBJECT_T);
  Map<String,List<DataRequest>> byTarget=new HashMap<>();
  for (  DataRequest req : requests) {
    LOGGER.debug(DBG_PREFIX + "String_Node_Str" + req.getTarget()+ "String_Node_Str"+ dataId+ "String_Node_Str");
    List<DataRequest> sameTarget=byTarget.get(req.getTarget());
    if (sameTarget == null) {
      sameTarget=new LinkedList<DataRequest>();
      byTarget.put(req.getTarget(),sameTarget);
    }
    sameTarget.add(req);
  }
  if (NIOTracer.isActivated()) {
    int tag=abs(dataId.hashCode());
    NIOTracer.emitDataTransferEvent(dataId);
    NIOTracer.emitCommEvent(false,connection2Partner.get(c),tag,t.getSize());
    connection2Partner.remove(c);
  }
  if (byTarget.size() == 1) {
    String targetName=requests.get(0).getTarget();
    if (DEBUG) {
      LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ targetName);
    }
    if (t.isFile() || t.isObject()) {
      if (!isPersistentEnabled() && isBindingType) {
        receivedBindingObjectAsFile(t.getFileName(),targetName);
      }
      receivedValue(t.getDestination(),targetName,t.getObject(),requests);
    }
 else     if (t.isByteBuffer()) {
      BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getSource().getFirstURI().getPath());
      NIOBindingDataManager.setByteArray(bo.getName(),t.getByteBuffer(),bo.getType(),bo.getElements());
      receivedValue(t.getDestination(),targetName,bo.toString(),requests);
    }
 else {
      BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getSource().getFirstURI().getPath());
      receivedValue(t.getDestination(),targetName,bo.toString(),requests);
    }
  }
 else {
    if (DEBUG) {
      LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
    }
    if (t.isFile()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ t.getFileName());
      }
      List<DataRequest> reqs;
      if (!isPersistentEnabled() && isBindingType) {
        BindingObject bo=getTargetBindingObject(t.getFileName(),requests.get(0).getTarget());
        reqs=byTarget.remove(bo.toString());
        receivedBindingObjectAsFile(t.getFileName(),reqs.get(0).getTarget());
      }
 else {
        reqs=byTarget.remove(t.getFileName());
      }
      receivedValue(t.getDestination(),t.getFileName(),t.getObject(),reqs);
    }
 else     if (t.isObject()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
      }
      receivedValue(t.getDestination(),dataId,t.getObject(),byTarget.remove(dataId));
    }
 else     if (t.isByteBuffer()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
      }
      BindingObject bo=getTargetBindingObject(dataId,requests.get(0).getSource().getFirstURI().getPath());
      NIOBindingDataManager.setByteArray(bo.getName(),t.getByteBuffer(),bo.getType(),bo.getElements());
      receivedValue(t.getDestination(),dataId,bo.toString(),byTarget.remove(dataId));
    }
 else {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
      }
      BindingObject bo=getTargetBindingObject(dataId,requests.get(0).getSource().getFirstURI().getPath());
      receivedValue(t.getDestination(),dataId,bo.toString(),byTarget.remove(dataId));
    }
    for (    Entry<String,List<DataRequest>> entry : byTarget.entrySet()) {
      String targetName=entry.getKey();
      List<DataRequest> reqs=entry.getValue();
      try {
        if (DEBUG) {
          LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ targetName);
        }
        if (t.isFile()) {
          if (!isPersistentEnabled() && reqs.get(0).getType().equals(DataType.BINDING_OBJECT_T)) {
            receivedBindingObjectAsFile(t.getFileName(),targetName);
          }
 else {
            Files.copy((new File(t.getFileName())).toPath(),(new File(targetName)).toPath());
          }
          receivedValue(t.getDestination(),targetName,t.getObject(),byTarget.remove(targetName));
        }
 else         if (t.isObject()) {
          Object o=Serializer.deserialize(t.getArray());
          receivedValue(t.getDestination(),targetName,o,reqs);
        }
 else {
          BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getSource().getFirstURI().getPath());
          NIOBindingDataManager.copyCachedData(dataId,targetName);
          receivedValue(t.getDestination(),targetName,bo.toString(),byTarget.remove(targetName));
        }
      }
 catch (      IOException|ClassNotFoundException e) {
        LOGGER.warn("String_Node_Str",e);
      }
    }
  }
  requestTransfers();
  if (finish == true && !hasPendingTransfers()) {
    shutdown(closingConnection);
  }
}

Fixed version (ground truth):
/** 
 * Received Data
 * @param c
 * @param t
 */
public void receivedData(Connection c,Transfer t){
  String dataId=ongoingTransfers.remove(c);
  if (dataId == null) {
    return;
  }
  if (DEBUG) {
    LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId);
  }
  releaseReceiveSlot();
  List<DataRequest> requests=dataToRequests.remove(dataId);
  boolean isBindingType=requests.get(0).getType().equals(DataType.BINDING_OBJECT_T);
  Map<String,List<DataRequest>> byTarget=new HashMap<>();
  for (  DataRequest req : requests) {
    LOGGER.debug(DBG_PREFIX + "String_Node_Str" + req.getTarget()+ "String_Node_Str"+ dataId+ "String_Node_Str");
    List<DataRequest> sameTarget=byTarget.get(req.getTarget());
    if (sameTarget == null) {
      sameTarget=new LinkedList<DataRequest>();
      byTarget.put(req.getTarget(),sameTarget);
    }
    sameTarget.add(req);
  }
  if (NIOTracer.isActivated()) {
    int tag=abs(dataId.hashCode());
    NIOTracer.emitDataTransferEvent(dataId);
    NIOTracer.emitCommEvent(false,connection2Partner.get(c),tag,t.getSize());
    connection2Partner.remove(c);
  }
  if (byTarget.size() == 1) {
    String targetName=requests.get(0).getTarget();
    if (DEBUG) {
      LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ targetName);
    }
    if (t.isFile() || t.isObject()) {
      if (!isPersistentEnabled() && isBindingType) {
        receivedBindingObjectAsFile(t.getFileName(),targetName);
      }
      receivedValue(t.getDestination(),targetName,t.getObject(),requests);
    }
 else     if (t.isByteBuffer()) {
      BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getSource().getFirstURI().getPath());
      NIOBindingDataManager.setByteArray(bo.getName(),t.getByteBuffer(),bo.getType(),bo.getElements());
      receivedValue(t.getDestination(),targetName,bo.toString(),requests);
    }
 else {
      BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getSource().getFirstURI().getPath());
      receivedValue(t.getDestination(),targetName,bo.toString(),requests);
    }
  }
 else {
    String workingDir=getWorkingDir();
    if (!workingDir.endsWith(File.separator)) {
      workingDir=workingDir + File.separator;
    }
    if (DEBUG) {
      LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
    }
    if (t.isFile()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ t.getFileName());
      }
      List<DataRequest> reqs;
      if (!isPersistentEnabled() && isBindingType) {
        BindingObject bo=getTargetBindingObject(t.getFileName(),requests.get(0).getTarget());
        reqs=byTarget.remove(bo.toString());
        receivedBindingObjectAsFile(t.getFileName(),reqs.get(0).getTarget());
      }
 else {
        reqs=byTarget.remove(t.getFileName());
      }
      receivedValue(t.getDestination(),t.getFileName(),t.getObject(),reqs);
    }
 else     if (t.isObject()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ dataId);
      }
      receivedValue(t.getDestination(),dataId,t.getObject(),byTarget.remove(dataId));
    }
 else     if (t.isByteBuffer()) {
      BindingObject bo=getTargetBindingObject(workingDir + dataId,requests.get(0).getTarget());
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ bo.toString()+ "String_Node_Str"+ dataId);
      }
      NIOBindingDataManager.setByteArray(bo.getName(),t.getByteBuffer(),bo.getType(),bo.getElements());
      receivedValue(t.getDestination(),dataId,bo.toString(),byTarget.remove(bo.toString()));
    }
 else {
      BindingObject bo=getTargetBindingObject(workingDir + dataId,requests.get(0).getTarget());
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ bo.toString()+ "String_Node_Str"+ dataId);
      }
      receivedValue(t.getDestination(),dataId,bo.toString(),byTarget.remove(bo.toString()));
    }
    for (    Entry<String,List<DataRequest>> entry : byTarget.entrySet()) {
      String targetName=entry.getKey();
      List<DataRequest> reqs=entry.getValue();
      try {
        if (DEBUG) {
          LOGGER.debug(DBG_PREFIX + "String_Node_Str" + dataId+ "String_Node_Str"+ targetName);
        }
        if (t.isFile()) {
          if (!isPersistentEnabled() && isBindingType) {
            BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getTarget());
            receivedBindingObjectAsFile(t.getFileName(),targetName);
            receivedValue(t.getDestination(),bo.getName(),bo.toString(),byTarget.remove(targetName));
          }
 else {
            Files.copy((new File(t.getFileName())).toPath(),(new File(targetName)).toPath());
            receivedValue(t.getDestination(),targetName,t.getObject(),byTarget.remove(targetName));
          }
        }
 else         if (t.isObject()) {
          Object o=Serializer.deserialize(t.getArray());
          receivedValue(t.getDestination(),targetName,o,reqs);
        }
 else {
          BindingObject bo=getTargetBindingObject(targetName,requests.get(0).getTarget());
          NIOBindingDataManager.copyCachedData(dataId,bo.getName());
          receivedValue(t.getDestination(),bo.getName(),bo.toString(),byTarget.remove(targetName));
        }
      }
 catch (      IOException|ClassNotFoundException e) {
        LOGGER.warn("String_Node_Str",e);
      }
    }
  }
  requestTransfers();
  if (finish == true && !hasPendingTransfers()) {
    shutdown(closingConnection);
  }
}