Program: 172429
Project: 172429
Buggy source:
private WriteResponse.CHOICE getWriteResult(FcModelNode modelNode,Data mmsData){
  WriteResponse.CHOICE writeResponse=new WriteResponse.CHOICE();
  Fc fc=modelNode.getFc();
  if (fc == Fc.ST || fc == Fc.MX || fc == Fc.OR || fc == Fc.EX) {
    writeResponse.setFailure(new DataAccessError(3L));
    return writeResponse;
  }
  if (fc == Fc.CO) {
    String nodeName=modelNode.getName();
    if (nodeName.equals("String_Node_Str")) {
      FcModelNode cdcParent=(FcModelNode)modelNode.getParent();
      ModelNode ctlModelNode=serverModel.findModelNode(cdcParent.getReference(),Fc.CF).getChild("String_Node_Str");
      if (ctlModelNode == null || !(ctlModelNode instanceof BdaInt8)) {
        logger.warn("String_Node_Str");
        writeResponse.setFailure(new DataAccessError(3L));
        return writeResponse;
      }
      int ctlModel=((BdaInt8)ctlModelNode).getValue();
      if (ctlModel == 1) {
        return null;
      }
 else       if (ctlModel == 2) {
        if (cdcParent.isSelectedBy(this)) {
          return null;
        }
 else {
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else {
        logger.warn("String_Node_Str" + ctlModel);
        writeResponse.setFailure(new DataAccessError(9L));
        return writeResponse;
      }
    }
 else {
      logger.warn("String_Node_Str" + modelNode.getName());
      writeResponse.setFailure(new DataAccessError(9L));
      return writeResponse;
    }
  }
 else   if (fc == Fc.RP) {
    if (modelNode instanceof Rcb) {
      writeResponse.setFailure(new DataAccessError(3L));
      return writeResponse;
    }
    FcModelNode fcModelNodeCopy=(FcModelNode)modelNode.copy();
    try {
      fcModelNodeCopy.setValueFromMmsDataObj(mmsData);
    }
 catch (    ServiceError e) {
      WriteResponse.CHOICE writeResponseChoice=new WriteResponse.CHOICE();
      writeResponseChoice.setFailure(new DataAccessError(serviceErrorToMmsError(e)));
      return writeResponseChoice;
    }
    Urcb urcb=(Urcb)modelNode.getParent();
    String nodeName=modelNode.getName();
synchronized (urcb) {
      if (nodeName.equals("String_Node_Str")) {
        BdaBoolean rptEnaNode=(BdaBoolean)fcModelNodeCopy;
        if (rptEnaNode.getValue()) {
          if (urcb.dataSet == null) {
            logger.info("String_Node_Str");
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
          if (urcb.reserved == null) {
            urcb.reserved=this;
            urcb.enable();
            rsvdURCBs.add(urcb);
            ((BdaBoolean)modelNode).setValue(true);
            return writeSuccess;
          }
 else           if (urcb.reserved == this) {
            urcb.enable();
            ((BdaBoolean)modelNode).setValue(true);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          if (urcb.reserved == this) {
            urcb.disable();
            ((BdaBoolean)modelNode).setValue(false);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        BdaBoolean rptResvNode=(BdaBoolean)fcModelNodeCopy;
        if (rptResvNode.getValue()) {
          if (urcb.reserved == null) {
            urcb.reserved=this;
            urcb.getResv().setValue(true);
            rsvdURCBs.add(urcb);
            return writeSuccess;
          }
 else           if (urcb.reserved == this) {
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          if (urcb.reserved == this) {
            urcb.reserved=null;
            urcb.getResv().setValue(false);
            rsvdURCBs.remove(urcb);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          String dataSetRef=((BdaVisibleString)fcModelNodeCopy).getStringValue();
          if (dataSetRef.isEmpty()) {
            urcb.dataSet=null;
            ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
            return writeSuccess;
          }
 else {
            DataSet dataSet=serverModel.getDataSet(dataSetRef);
            if (dataSet != null) {
              urcb.dataSet=dataSet;
              ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
              return writeSuccess;
            }
 else {
              logger.info("String_Node_Str");
              writeResponse.setFailure(new DataAccessError(3L));
              return writeResponse;
            }
          }
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          if (!((BdaOptFlds)modelNode).isBufferOverflow() && !((BdaOptFlds)modelNode).isConfigRevision() && !((BdaOptFlds)modelNode).isDataReference()&& !((BdaOptFlds)modelNode).isEntryId()) {
            ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
            return writeSuccess;
          }
 else {
            logger.info("String_Node_Str");
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == this) && urcb.enabled && ((BdaTriggerConditions)urcb.getChild("String_Node_Str")).isGeneralInterrogation()) {
          urcb.generalInterrogation();
          return writeSuccess;
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")|| nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
          return writeSuccess;
        }
 else {
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else {
        writeResponse.setFailure(new DataAccessError(3L));
        return writeResponse;
      }
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private WriteResponse.CHOICE getWriteResult(FcModelNode modelNode,Data mmsData){
  WriteResponse.CHOICE writeResponse=new WriteResponse.CHOICE();
  Fc fc=modelNode.getFc();
  if (fc == Fc.ST || fc == Fc.MX || fc == Fc.OR || fc == Fc.EX) {
    writeResponse.setFailure(new DataAccessError(3L));
    return writeResponse;
  }
  if (fc == Fc.CO) {
    String nodeName=modelNode.getName();
    if (nodeName.equals("String_Node_Str")) {
      FcModelNode cdcParent=(FcModelNode)modelNode.getParent();
      ModelNode ctlModelNode=serverModel.findModelNode(cdcParent.getReference(),Fc.CF).getChild("String_Node_Str");
      if (ctlModelNode == null || !(ctlModelNode instanceof BdaInt8)) {
        logger.warn("String_Node_Str");
        writeResponse.setFailure(new DataAccessError(3L));
        return writeResponse;
      }
      int ctlModel=((BdaInt8)ctlModelNode).getValue();
      if (ctlModel == 1) {
        return null;
      }
 else       if (ctlModel == 2) {
        if (cdcParent.isSelectedBy(this)) {
          return null;
        }
 else {
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else {
        logger.warn("String_Node_Str" + ctlModel);
        writeResponse.setFailure(new DataAccessError(9L));
        return writeResponse;
      }
    }
 else {
      logger.warn("String_Node_Str" + modelNode.getName());
      writeResponse.setFailure(new DataAccessError(9L));
      return writeResponse;
    }
  }
 else   if (fc == Fc.RP) {
    if (modelNode instanceof Rcb) {
      writeResponse.setFailure(new DataAccessError(3L));
      return writeResponse;
    }
    FcModelNode fcModelNodeCopy=(FcModelNode)modelNode.copy();
    try {
      fcModelNodeCopy.setValueFromMmsDataObj(mmsData);
    }
 catch (    ServiceError e) {
      WriteResponse.CHOICE writeResponseChoice=new WriteResponse.CHOICE();
      writeResponseChoice.setFailure(new DataAccessError(serviceErrorToMmsError(e)));
      return writeResponseChoice;
    }
    Urcb urcb=(Urcb)modelNode.getParent();
    String nodeName=modelNode.getName();
synchronized (urcb) {
      if (nodeName.equals("String_Node_Str")) {
        BdaBoolean rptEnaNode=(BdaBoolean)fcModelNodeCopy;
        if (rptEnaNode.getValue()) {
          if (urcb.dataSet == null) {
            logger.info("String_Node_Str");
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
          if (urcb.reserved == null) {
            urcb.reserved=this;
            urcb.enable();
            rsvdURCBs.add(urcb);
            ((BdaBoolean)modelNode).setValue(true);
            return writeSuccess;
          }
 else           if (urcb.reserved == this) {
            urcb.enable();
            ((BdaBoolean)modelNode).setValue(true);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          if (urcb.reserved == this) {
            urcb.disable();
            ((BdaBoolean)modelNode).setValue(false);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        BdaBoolean rptResvNode=(BdaBoolean)fcModelNodeCopy;
        if (rptResvNode.getValue()) {
          if (urcb.reserved == null) {
            urcb.reserved=this;
            urcb.getResv().setValue(true);
            rsvdURCBs.add(urcb);
            return writeSuccess;
          }
 else           if (urcb.reserved == this) {
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          if (urcb.reserved == this) {
            urcb.reserved=null;
            urcb.getResv().setValue(false);
            rsvdURCBs.remove(urcb);
            return writeSuccess;
          }
 else {
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          String dataSetRef=((BdaVisibleString)fcModelNodeCopy).getStringValue().replace('$','.');
          if (dataSetRef.isEmpty()) {
            urcb.dataSet=null;
            ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
            return writeSuccess;
          }
 else {
            DataSet dataSet=serverModel.getDataSet(dataSetRef);
            if (dataSet == null) {
              dataSet=nonPersistentDataSets.get(dataSetRef);
            }
            if (dataSet != null) {
              urcb.dataSet=dataSet;
              ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
              return writeSuccess;
            }
 else {
              logger.info("String_Node_Str");
              writeResponse.setFailure(new DataAccessError(3L));
              return writeResponse;
            }
          }
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          if (!((BdaOptFlds)modelNode).isBufferOverflow() && !((BdaOptFlds)modelNode).isConfigRevision() && !((BdaOptFlds)modelNode).isDataReference()&& !((BdaOptFlds)modelNode).isEntryId()) {
            ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
            return writeSuccess;
          }
 else {
            logger.info("String_Node_Str");
            writeResponse.setFailure(new DataAccessError(3L));
            return writeResponse;
          }
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == this) && urcb.enabled && ((BdaTriggerConditions)urcb.getChild("String_Node_Str")).isGeneralInterrogation()) {
          urcb.generalInterrogation();
          return writeSuccess;
        }
 else {
          logger.info("String_Node_Str");
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else       if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")|| nodeName.equals("String_Node_Str")) {
        if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) {
          ((BasicDataAttribute)modelNode).setValueFrom((BasicDataAttribute)fcModelNodeCopy);
          return writeSuccess;
        }
 else {
          writeResponse.setFailure(new DataAccessError(3L));
          return writeResponse;
        }
      }
 else {
        writeResponse.setFailure(new DataAccessError(3L));
        return writeResponse;
      }
    }
  }
 else {
    return null;
  }
}