Program: 79838
Project: 79838
Buggy source:
public static Conversation convertToEntity(RfRequestDTO rfRequestDTO,RfResponseDTO responseDTO){
  Conversation conversation=new Conversation();
  RfRequest rfRequest=new RfRequest();
  if (rfRequestDTO != null) {
    rfRequest.setApiUrlString(rfRequestDTO.getApiUrl());
    rfRequest.setMethodType(rfRequestDTO.getMethodType());
    List<FormDataDTO> formDataDTOs=rfRequestDTO.getFormParams();
    List<FormParam> formParams=new ArrayList<FormParam>();
    if (rfRequestDTO.getBasicAuthDTO() != null) {
      BasicAuth basicAuth=new BasicAuth();
      basicAuth.setUsername(rfRequestDTO.getBasicAuthDTO().getUsername());
      basicAuth.setPassword(rfRequestDTO.getBasicAuthDTO().getPassword());
      rfRequest.setBasicAuth(basicAuth);
    }
    if (rfRequestDTO.getDigestAuthDTO() != null) {
      DigestAuth digestAuth=new DigestAuth();
      digestAuth.setUsername(rfRequestDTO.getDigestAuthDTO().getUsername());
      digestAuth.setPassword(rfRequestDTO.getDigestAuthDTO().getPassword());
      rfRequest.setDigestAuth(digestAuth);
    }
    if (rfRequestDTO.getApiBody() != null) {
      rfRequest.setApiBody(rfRequestDTO.getApiBody().getBytes());
    }
 else     if (formDataDTOs != null && !formDataDTOs.isEmpty()) {
      FormParam formParam=null;
      for (      FormDataDTO formDataDTO : formDataDTOs) {
        formParam=new FormParam();
        formParam.setParamKey(formDataDTO.getKey());
        formParam.setValueString(formDataDTO.getValue());
        formParams.add(formParam);
      }
      rfRequest.setFormParams(formParams);
    }
    List<UrlParamDTO> urlParamDTOs=rfRequestDTO.getUrlParams();
    List<UrlParam> urlParams=new ArrayList<UrlParam>();
    if (urlParamDTOs != null && !urlParamDTOs.isEmpty()) {
      UrlParam urlParam=null;
      for (      UrlParamDTO urlParamDTO : urlParamDTOs) {
        urlParam=new UrlParam();
        urlParam.setParamKey(urlParamDTO.getKey());
        urlParam.setParamValue(urlParamDTO.getValue());
        urlParams.add(urlParam);
      }
      rfRequest.setUrlParams(urlParams);
    }
    List<RfHeaderDTO> headerDTOs=rfRequestDTO.getHeaders();
    List<RfHeader> headers=new ArrayList<RfHeader>();
    RfHeader header=null;
    if (headerDTOs != null && !headerDTOs.isEmpty()) {
      for (      RfHeaderDTO rfHeaderDTO : headerDTOs) {
        header=new RfHeader();
        header.setHeaderName(rfHeaderDTO.getHeaderName());
        header.setHeaderValueString(rfHeaderDTO.getHeaderValue());
        headers.add(header);
      }
      rfRequest.setRfHeaders(headers);
    }
  }
  conversation.setRfRequest(rfRequest);
  RfResponse response=new RfResponse();
  conversation.setRfResponse(response);
  if (responseDTO == null && !rfRequestDTO.getApiUrl().isEmpty()) {
    response.setBodyString("String_Node_Str" + rfRequestDTO.getApiUrl());
  }
 else {
    if (responseDTO.getBody() != null && !responseDTO.getBody().isEmpty()) {
      response.setBody(responseDTO.getBody().getBytes());
    }
    AssertionDTO assertionDTO=rfRequestDTO.getAssertionDTO();
    if (assertionDTO != null) {
      if (assertionDTO != null && assertionDTO.getBodyAssertDTOs() != null) {
        List<BodyAssertDTO> bodyAssertDTOs=assertionDTO.getBodyAssertDTOs();
        List<BodyAssert> bodyAsserts=new ArrayList<BodyAssert>();
        for (        BodyAssertDTO bodyAssertDTO : bodyAssertDTOs) {
          BodyAssert bodyAssert=new BodyAssert();
          bodyAssert.setComparator(bodyAssertDTO.getComparator());
          bodyAssert.setExpectedValue(bodyAssertDTO.getExpectedValue());
          bodyAssert.setPropertyName(bodyAssertDTO.getPropertyName());
          bodyAssert.setActualValue(bodyAssertDTO.getActualValue());
          bodyAssert.setSuccess(bodyAssertDTO.isSuccess());
          bodyAsserts.add(bodyAssert);
        }
        Assertion assertion=new Assertion();
        response.setAssertion(assertion);
      }
    }
    List<RfHeaderDTO> headerDTOs=responseDTO.getHeaders();
    List<RfHeader> headers=new ArrayList<RfHeader>();
    RfHeader header=null;
    if (headerDTOs != null && !headerDTOs.isEmpty()) {
      for (      RfHeaderDTO rfHeaderDTO : headerDTOs) {
        header=new RfHeader();
        header.setHeaderName(rfHeaderDTO.getHeaderName());
        header.setHeaderValueString(rfHeaderDTO.getHeaderValue());
        headers.add(header);
      }
      response.setRfHeaders(headers);
    }
  }
  return conversation;
}

Fixed version (ground truth):
public static Conversation convertToEntity(RfRequestDTO rfRequestDTO,RfResponseDTO responseDTO){
  Conversation conversation=new Conversation();
  RfRequest rfRequest=new RfRequest();
  if (rfRequestDTO != null) {
    rfRequest.setApiUrlString(rfRequestDTO.getApiUrl());
    rfRequest.setMethodType(rfRequestDTO.getMethodType());
    List<FormDataDTO> formDataDTOs=rfRequestDTO.getFormParams();
    List<FormParam> formParams=new ArrayList<FormParam>();
    if (rfRequestDTO.getBasicAuthDTO() != null) {
      BasicAuth basicAuth=new BasicAuth();
      basicAuth.setUsername(rfRequestDTO.getBasicAuthDTO().getUsername());
      basicAuth.setPassword(rfRequestDTO.getBasicAuthDTO().getPassword());
      rfRequest.setBasicAuth(basicAuth);
    }
    if (rfRequestDTO.getDigestAuthDTO() != null) {
      DigestAuth digestAuth=new DigestAuth();
      digestAuth.setUsername(rfRequestDTO.getDigestAuthDTO().getUsername());
      digestAuth.setPassword(rfRequestDTO.getDigestAuthDTO().getPassword());
      rfRequest.setDigestAuth(digestAuth);
    }
    if (rfRequestDTO.getApiBody() != null) {
      rfRequest.setApiBody(rfRequestDTO.getApiBody().getBytes());
    }
 else     if (formDataDTOs != null && !formDataDTOs.isEmpty()) {
      FormParam formParam=null;
      for (      FormDataDTO formDataDTO : formDataDTOs) {
        formParam=new FormParam();
        formParam.setParamKey(formDataDTO.getKey());
        formParam.setValueString(formDataDTO.getValue());
        formParams.add(formParam);
      }
      rfRequest.setFormParams(formParams);
    }
    List<UrlParamDTO> urlParamDTOs=rfRequestDTO.getUrlParams();
    List<UrlParam> urlParams=new ArrayList<UrlParam>();
    if (urlParamDTOs != null && !urlParamDTOs.isEmpty()) {
      UrlParam urlParam=null;
      for (      UrlParamDTO urlParamDTO : urlParamDTOs) {
        urlParam=new UrlParam();
        urlParam.setParamKey(urlParamDTO.getKey());
        urlParam.setParamValue(urlParamDTO.getValue());
        urlParams.add(urlParam);
      }
      rfRequest.setUrlParams(urlParams);
    }
    List<RfHeaderDTO> headerDTOs=rfRequestDTO.getHeaders();
    List<RfHeader> headers=new ArrayList<RfHeader>();
    RfHeader header=null;
    if (headerDTOs != null && !headerDTOs.isEmpty()) {
      for (      RfHeaderDTO rfHeaderDTO : headerDTOs) {
        header=new RfHeader();
        header.setHeaderName(rfHeaderDTO.getHeaderName());
        header.setHeaderValueString(rfHeaderDTO.getHeaderValue());
        headers.add(header);
      }
      rfRequest.setRfHeaders(headers);
    }
  }
  conversation.setRfRequest(rfRequest);
  RfResponse response=new RfResponse();
  conversation.setRfResponse(response);
  if (responseDTO == null && !rfRequestDTO.getApiUrl().isEmpty()) {
    response.setBodyString("String_Node_Str" + rfRequestDTO.getApiUrl());
  }
 else {
    if (responseDTO.getBody() != null && !responseDTO.getBody().isEmpty()) {
      response.setBody(responseDTO.getBody().getBytes());
    }
    AssertionDTO assertionDTO=rfRequestDTO != null ? rfRequestDTO.getAssertionDTO() : null;
    if (assertionDTO != null && assertionDTO.getBodyAssertDTOs() != null) {
      List<BodyAssertDTO> bodyAssertDTOs=assertionDTO.getBodyAssertDTOs();
      List<BodyAssert> bodyAsserts=new ArrayList<BodyAssert>();
      for (      BodyAssertDTO bodyAssertDTO : bodyAssertDTOs) {
        BodyAssert bodyAssert=new BodyAssert();
        bodyAssert.setComparator(bodyAssertDTO.getComparator());
        bodyAssert.setExpectedValue(bodyAssertDTO.getExpectedValue());
        bodyAssert.setPropertyName(bodyAssertDTO.getPropertyName());
        bodyAssert.setActualValue(bodyAssertDTO.getActualValue());
        bodyAssert.setSuccess(bodyAssertDTO.isSuccess());
        bodyAsserts.add(bodyAssert);
      }
      Assertion assertion=new Assertion();
      response.setAssertion(assertion);
    }
    List<RfHeaderDTO> headerDTOs=responseDTO.getHeaders();
    List<RfHeader> headers=new ArrayList<RfHeader>();
    RfHeader header=null;
    if (headerDTOs != null && !headerDTOs.isEmpty()) {
      for (      RfHeaderDTO rfHeaderDTO : headerDTOs) {
        header=new RfHeader();
        header.setHeaderName(rfHeaderDTO.getHeaderName());
        header.setHeaderValueString(rfHeaderDTO.getHeaderValue());
        headers.add(header);
      }
      response.setRfHeaders(headers);
    }
  }
  return conversation;
}