Program: 37997
Project: 37997
Buggy source:
/** 
 * Gets the response.
 * @param < T > the generic type
 * @param < E > the element type
 * @param response the response
 * @param responseClass the response class
 * @param dependentClass the dependent class
 * @return the response
 */
private <T,E>T getResponse(final HttpResponse response,final Class<T> responseClass,final Class<E> dependentClass){
  T obj=null;
  try {
    _log.info("String_Node_Str" + response.getStatusLine().getStatusCode());
    if (response.getStatusLine().getStatusCode() != HttpStatus.NO_CONTENT.value()) {
      String responseEntity=IoUtils.toString(response.getEntity().getContent());
      _log.info("String_Node_Str" + responseEntity);
      if (!(HttpStatus.valueOf(response.getStatusLine().getStatusCode()).is2xxSuccessful() && response.getEntity() != null)) {
        String errorMessage=null;
        try {
          if (responseEntity.startsWith("String_Node_Str")) {
            responseEntity=responseEntity.replaceFirst("String_Node_Str","String_Node_Str").trim();
          }
          if (responseEntity.endsWith("String_Node_Str")) {
            responseEntity=responseEntity.replace("String_Node_Str","String_Node_Str").trim();
          }
          errorMessage=mapper.readValue(responseEntity,ErrorMessage.class).getMessage();
        }
 catch (        Exception e) {
          if (response.getStatusLine().getStatusCode() == HttpStatus.UNAUTHORIZED.value()) {
            throw new UnauthorizedException(HttpError.UNAUTHORIZED.getMessage());
          }
          _log.error("String_Node_Str",e);
          errorMessage=authPropertyService.getError(IAuthConstants.Code.RESPONSE_PARSING_FAIL_ERROR).getMessage();
          throw new RestCallFailedException(errorMessage);
        }
        _log.error("String_Node_Str" + responseEntity);
        throw new ExternalSystemException(response.getStatusLine().getStatusCode(),errorMessage);
      }
 else {
        if (dependentClass == null) {
          obj=mapper.readValue(responseEntity,responseClass);
        }
 else {
          obj=mapper.readValue(responseEntity,TypeFactory.defaultInstance().constructCollectionLikeType(responseClass,dependentClass));
        }
      }
    }
  }
 catch (  IOException e) {
    throw new RestCallFailedException(e.getMessage());
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Gets the response.
 * @param < T > the generic type
 * @param < E > the element type
 * @param response the response
 * @param responseClass the response class
 * @param dependentClass the dependent class
 * @return the response
 */
private <T,E>T getResponse(final HttpResponse response,final Class<T> responseClass,final Class<E> dependentClass){
  T obj=null;
  try {
    LOGGER.info("String_Node_Str" + response.getStatusLine().getStatusCode());
    if (response.getStatusLine().getStatusCode() != HttpStatus.NO_CONTENT.value()) {
      String responseEntity=IoUtil.toString(response.getEntity().getContent());
      LOGGER.info("String_Node_Str" + responseEntity);
      if (!(HttpStatus.valueOf(response.getStatusLine().getStatusCode()).is2xxSuccessful() && response.getEntity() != null)) {
        String errorMessage=null;
        try {
          if (responseEntity.startsWith("String_Node_Str")) {
            responseEntity=responseEntity.replaceFirst("String_Node_Str","String_Node_Str").trim();
          }
          if (responseEntity.endsWith("String_Node_Str")) {
            responseEntity=responseEntity.replace("String_Node_Str","String_Node_Str").trim();
          }
          errorMessage=mapper.readValue(responseEntity,ErrorMessage.class).getMessage();
        }
 catch (        Exception e) {
          if (response.getStatusLine().getStatusCode() == HttpStatus.UNAUTHORIZED.value()) {
            throw new UnauthorizedException(HttpError.UNAUTHORIZED.getMessage());
          }
          LOGGER.error("String_Node_Str",e);
          errorMessage=authPropertyService.getError(IAuthConstants.Code.RESPONSE_PARSING_FAIL_ERROR).getMessage();
          throw new RestCallFailedException(errorMessage);
        }
        LOGGER.error("String_Node_Str" + responseEntity);
        throw new ExternalSystemException(response.getStatusLine().getStatusCode(),errorMessage);
      }
 else {
        if (dependentClass == null) {
          obj=mapper.readValue(responseEntity,responseClass);
        }
 else {
          obj=mapper.readValue(responseEntity,TypeFactory.defaultInstance().constructCollectionLikeType(responseClass,dependentClass));
        }
      }
    }
  }
 catch (  IOException e) {
    throw new RestCallFailedException(e.getMessage());
  }
  return obj;
}