Program: 171078
Project: 171078
Buggy source:
protected <T>T callAPIWithResource(APIInfo api,WebResource resource,Object requestObject,GenericType<T> responseType) throws AtlasServiceException {
  ClientResponse clientResponse=null;
  int i=0;
  do {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",api.getMethod(),api.getPath(),requestObject != null ? "String_Node_Str" + requestObject : "String_Node_Str");
    }
    clientResponse=resource.accept(JSON_MEDIA_TYPE).type(JSON_MEDIA_TYPE).method(api.getMethod(),ClientResponse.class,requestObject);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",resource.getURI(),clientResponse.getStatus());
    }
    if (clientResponse.getStatus() == api.getExpectedStatus().getStatusCode()) {
      if (null == responseType) {
        return null;
      }
      try {
        if (responseType.getRawClass() == JSONObject.class) {
          String stringEntity=clientResponse.getEntity(String.class);
          try {
            JSONObject jsonObject=new JSONObject(stringEntity);
            LOG.info("String_Node_Str",jsonObject);
            return (T)jsonObject;
          }
 catch (          JSONException e) {
            throw new AtlasServiceException(api,e);
          }
        }
 else {
          T entity=clientResponse.getEntity(responseType);
          LOG.info("String_Node_Str",AtlasType.toJson(entity));
          return entity;
        }
      }
 catch (      ClientHandlerException e) {
        throw new AtlasServiceException(api,e);
      }
    }
 else     if (clientResponse.getStatus() != ClientResponse.Status.SERVICE_UNAVAILABLE.getStatusCode()) {
      break;
    }
 else {
      LOG.error("String_Node_Str",resource);
      sleepBetweenRetries();
    }
    i++;
  }
 while (i < getNumberOfRetries());
  throw new AtlasServiceException(api,clientResponse);
}

Fixed version (ground truth):
protected <T>T callAPIWithResource(APIInfo api,WebResource resource,Object requestObject,GenericType<T> responseType) throws AtlasServiceException {
  ClientResponse clientResponse=null;
  int i=0;
  do {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",api.getMethod(),api.getPath(),requestObject != null ? "String_Node_Str" + requestObject : "String_Node_Str");
    }
    clientResponse=resource.accept(JSON_MEDIA_TYPE).type(JSON_MEDIA_TYPE).method(api.getMethod(),ClientResponse.class,requestObject);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",resource.getURI(),clientResponse.getStatus());
    }
    if (clientResponse.getStatus() == api.getExpectedStatus().getStatusCode()) {
      if (null == responseType) {
        return null;
      }
      try {
        if (responseType.getRawClass() == JSONObject.class) {
          String stringEntity=clientResponse.getEntity(String.class);
          try {
            JSONObject jsonObject=new JSONObject(stringEntity);
            LOG.info("String_Node_Str",jsonObject);
            return (T)jsonObject;
          }
 catch (          JSONException e) {
            throw new AtlasServiceException(api,e);
          }
        }
 else {
          T entity=clientResponse.getEntity(responseType);
          return entity;
        }
      }
 catch (      ClientHandlerException e) {
        throw new AtlasServiceException(api,e);
      }
    }
 else     if (clientResponse.getStatus() != ClientResponse.Status.SERVICE_UNAVAILABLE.getStatusCode()) {
      break;
    }
 else {
      LOG.error("String_Node_Str",resource);
      sleepBetweenRetries();
    }
    i++;
  }
 while (i < getNumberOfRetries());
  throw new AtlasServiceException(api,clientResponse);
}