Program: 166410
Project: 166410
Buggy source:
@GET @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public ServicePolicies getServicePoliciesIfUpdated(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") Long lastKnownVersion,@QueryParam("String_Node_Str") String pluginId,@Context HttpServletRequest request) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str");
  }
  ServicePolicies ret=null;
  int httpCode=HttpServletResponse.SC_OK;
  String logMsg=null;
  if (serviceUtil.isValidateHttpsAuthentication(serviceName,request)) {
    try {
      ret=svcStore.getServicePoliciesIfUpdated(serviceName,lastKnownVersion);
      if (ret == null) {
        httpCode=HttpServletResponse.SC_NOT_MODIFIED;
        logMsg="String_Node_Str";
      }
 else {
        httpCode=HttpServletResponse.SC_OK;
        logMsg="String_Node_Str" + (ret.getPolicies() != null ? ret.getPolicies().size() : 0) + "String_Node_Str"+ ret.getPolicyVersion();
      }
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str",excp);
      httpCode=HttpServletResponse.SC_BAD_REQUEST;
      logMsg=excp.getMessage();
    }
 finally {
      createPolicyDownloadAudit(serviceName,lastKnownVersion,pluginId,ret,httpCode,request);
    }
    if (httpCode != HttpServletResponse.SC_OK) {
      boolean logError=httpCode != HttpServletResponse.SC_NOT_MODIFIED;
      throw restErrorUtil.createRESTException(httpCode,logMsg,logError);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str"+ ((ret == null || ret.getPolicies() == null) ? 0 : ret.getPolicies().size()));
  }
  return ret;
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public ServicePolicies getServicePoliciesIfUpdated(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") Long lastKnownVersion,@QueryParam("String_Node_Str") String pluginId,@Context HttpServletRequest request) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str");
  }
  ServicePolicies ret=null;
  int httpCode=HttpServletResponse.SC_OK;
  String logMsg=null;
  if (serviceUtil.isValidateHttpsAuthentication(serviceName,request)) {
    if (lastKnownVersion == null) {
      lastKnownVersion=new Long(-1);
    }
    try {
      ret=svcStore.getServicePoliciesIfUpdated(serviceName,lastKnownVersion);
      if (ret == null) {
        httpCode=HttpServletResponse.SC_NOT_MODIFIED;
        logMsg="String_Node_Str";
      }
 else {
        httpCode=HttpServletResponse.SC_OK;
        logMsg="String_Node_Str" + (ret.getPolicies() != null ? ret.getPolicies().size() : 0) + "String_Node_Str"+ ret.getPolicyVersion();
      }
    }
 catch (    Exception excp) {
      LOG.error("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str",excp);
      httpCode=HttpServletResponse.SC_BAD_REQUEST;
      logMsg=excp.getMessage();
    }
 finally {
      createPolicyDownloadAudit(serviceName,lastKnownVersion,pluginId,ret,httpCode,request);
    }
    if (httpCode != HttpServletResponse.SC_OK) {
      boolean logError=httpCode != HttpServletResponse.SC_NOT_MODIFIED;
      throw restErrorUtil.createRESTException(httpCode,logMsg,logError);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceName + "String_Node_Str"+ lastKnownVersion+ "String_Node_Str"+ ((ret == null || ret.getPolicies() == null) ? 0 : ret.getPolicies().size()));
  }
  return ret;
}