Program: 20076
Project: 20076
Buggy source:
/** 
 * @see org.easysoa.registry.rest.integration.EndpointStateService#getSlaOrOlaIndicators(String,String,Date,Date,int,int)
 */
@Override public SlaOrOlaIndicators getSlaOrOlaIndicators(String endpointId,String slaOrOlaName,String periodStart,String periodEnd,int pageSize,int pageStart) throws Exception {
  DirectoryService directoryService=Framework.getService(DirectoryService.class);
  Session session=directoryService.open(org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE);
  if (session == null) {
    throw new Exception("String_Node_Str" + org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE + "String_Node_Str");
  }
  Map<String,Serializable> parameters=new HashMap<String,Serializable>();
  if (endpointId != null && !"String_Node_Str".equals(endpointId)) {
    parameters.put("String_Node_Str",endpointId);
  }
  if (slaOrOlaName != null && !"String_Node_Str".equals(slaOrOlaName)) {
    parameters.put("String_Node_Str",slaOrOlaName);
  }
  SlaOrOlaIndicators slaOrOlaIndicators=new SlaOrOlaIndicators();
  try {
    Map<String,String> orderByParams=new HashMap<String,String>();
    Set<String> fullTextSearchParams=new HashSet<String>();
    SimpleDateFormat dateFormater=new SimpleDateFormat("String_Node_Str");
    Calendar calendarFrom=new GregorianCalendar();
    Calendar calendarTo=new GregorianCalendar();
    Calendar currentDate=new GregorianCalendar();
    if (periodEnd == null && periodStart == null) {
      calendarTo.clear();
      calendarTo.set(currentDate.get(Calendar.YEAR),currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH),23,59,59);
    }
 else     if (periodEnd == null && periodStart != null) {
      calendarTo.setTime(currentDate.getTime());
    }
 else {
      calendarTo.setTime(dateFormater.parse(periodEnd));
    }
    if (periodStart != null) {
      calendarFrom.setTime(dateFormater.parse(periodStart));
    }
 else {
      calendarFrom.clear();
      calendarFrom.set(currentDate.get(Calendar.YEAR) - 1,currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH));
    }
    SQLBetweenFilter dateRangeFilter=new SQLBetweenFilter(calendarFrom,calendarTo);
    parameters.put("String_Node_Str",dateRangeFilter);
    DocumentModelList soaNodeModelList=session.query(parameters,fullTextSearchParams,orderByParams,false,pageSize,pageStart * pageSize);
    SlaOrOlaIndicator indicator;
    for (    DocumentModel model : soaNodeModelList) {
      indicator=new SlaOrOlaIndicator();
      indicator.setEndpointId((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_ENDPOINT_ID));
      indicator.setType(model.getType());
      indicator.setServiceLevelHealth(ServiceLevelHealth.valueOf((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_HEALTH)));
      indicator.setServiceLevelViolation((Boolean)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_VIOLATION));
      indicator.setSlaOrOlaName((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SLA_OR_OLA_NAME));
      GregorianCalendar calendar=(GregorianCalendar)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_TIMESTAMP);
      indicator.setTimestamp(calendar.getTime());
      slaOrOlaIndicators.getSlaOrOlaIndicatorList().add(indicator);
    }
  }
 catch (  ClientException ex) {
    ex.printStackTrace();
    throw ex;
  }
  return slaOrOlaIndicators;
}

Fixed version (ground truth):
/** 
 * @see org.easysoa.registry.rest.integration.EndpointStateService#getSlaOrOlaIndicators(String,String,Date,Date,int,int)
 */
@Override public SlaOrOlaIndicators getSlaOrOlaIndicators(String endpointId,String slaOrOlaName,String periodStart,String periodEnd,int pageSize,int pageStart) throws Exception {
  DirectoryService directoryService=Framework.getService(DirectoryService.class);
  Session session=directoryService.open(org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE);
  if (session == null) {
    throw new Exception("String_Node_Str" + org.easysoa.registry.types.SlaOrOlaIndicator.DOCTYPE + "String_Node_Str");
  }
  Map<String,Serializable> parameters=new HashMap<String,Serializable>();
  if (endpointId != null && !"String_Node_Str".equals(endpointId)) {
    parameters.put("String_Node_Str",endpointId);
  }
  if (slaOrOlaName != null && !"String_Node_Str".equals(slaOrOlaName)) {
    parameters.put("String_Node_Str",slaOrOlaName);
  }
  SlaOrOlaIndicators slaOrOlaIndicators=new SlaOrOlaIndicators();
  try {
    Map<String,String> orderByParams=new HashMap<String,String>();
    Set<String> fullTextSearchParams=new HashSet<String>();
    SimpleDateFormat dateFormater=new SimpleDateFormat("String_Node_Str");
    Calendar calendarFrom=new GregorianCalendar();
    Calendar calendarTo=new GregorianCalendar();
    Calendar currentDate=new GregorianCalendar();
    if (periodEnd == null && periodStart == null) {
      calendarTo.clear();
      calendarTo.set(currentDate.get(Calendar.YEAR),currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH),23,59,59);
    }
 else     if (periodEnd == null && periodStart != null) {
      calendarTo.setTime(currentDate.getTime());
    }
 else {
      calendarTo.setTime(dateFormater.parse(periodEnd));
    }
    if (periodStart != null) {
      calendarFrom.setTime(dateFormater.parse(periodStart));
    }
 else {
      calendarFrom.clear();
      calendarFrom.set(currentDate.get(Calendar.YEAR),currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH));
    }
    SQLBetweenFilter dateRangeFilter=new SQLBetweenFilter(calendarFrom,calendarTo);
    parameters.put("String_Node_Str",dateRangeFilter);
    DocumentModelList soaNodeModelList=session.query(parameters,fullTextSearchParams,orderByParams,false,pageSize,pageStart * pageSize);
    SlaOrOlaIndicator indicator;
    for (    DocumentModel model : soaNodeModelList) {
      indicator=new SlaOrOlaIndicator();
      indicator.setEndpointId((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_ENDPOINT_ID));
      indicator.setType(model.getType());
      indicator.setServiceLevelHealth(ServiceLevelHealth.valueOf((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_HEALTH)));
      indicator.setServiceLevelViolation((Boolean)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SERVICE_LEVEL_VIOLATION));
      indicator.setSlaOrOlaName((String)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_SLA_OR_OLA_NAME));
      GregorianCalendar calendar=(GregorianCalendar)model.getPropertyValue(org.easysoa.registry.types.SlaOrOlaIndicator.XPATH_TIMESTAMP);
      indicator.setTimestamp(calendar.getTime());
      slaOrOlaIndicators.getSlaOrOlaIndicatorList().add(indicator);
    }
  }
 catch (  ClientException ex) {
    ex.printStackTrace();
    throw ex;
  }
  return slaOrOlaIndicators;
}