Program: 20107
Project: 20107
Buggy source:
/** 
 * @see org.easysoa.registry.rest.integration.EndpointStateService#updateSlaOlaIndicators(SlaOrOlaIndicator[])
 */
@Override public void updateSlaOlaIndicators(SlaOrOlaIndicators slaOrOlaIndicators) throws Exception {
  DirectoryService directoryService=Framework.getService(DirectoryService.class);
  if (slaOrOlaIndicators != null) {
    Session session=directoryService.open("String_Node_Str");
    if (session == null) {
      throw new Exception("String_Node_Str");
    }
    try {
      for (      SlaOrOlaIndicator indicator : slaOrOlaIndicators.getSlaOrOlaIndicatorList()) {
        Map<String,Serializable> parameters=new HashMap<String,Serializable>();
        parameters.put("String_Node_Str",indicator.getSlaOrOlaName());
        parameters.put("String_Node_Str",indicator.getEndpointId());
        DocumentModelList documentModelList=session.query(parameters);
        DocumentModel indicatorModel;
        if (documentModelList != null) {
          indicatorModel=documentModelList.get(0);
          indicatorModel.setPropertyValue("String_Node_Str",indicator.getServiceLevelHealth());
          indicatorModel.setPropertyValue("String_Node_Str",indicator.isServiceLevelViolation());
          indicatorModel.setPropertyValue("String_Node_Str",indicator.getTimestamp());
          session.updateEntry(indicatorModel);
        }
 else {
          Map<String,Object> properties=new HashMap<String,Object>();
          properties.put("String_Node_Str",indicator.getEndpointId());
          properties.put("String_Node_Str",indicator.getSlaOrOlaName());
          properties.put("String_Node_Str",indicator.getServiceLevelHealth().toString());
          properties.put("String_Node_Str",String.valueOf(indicator.isServiceLevelViolation()));
          Calendar calendar=new GregorianCalendar();
          calendar.setTime(indicator.getTimestamp());
          properties.put("String_Node_Str",calendar);
          session.createEntry(properties);
        }
      }
      session.commit();
      session.close();
    }
 catch (    Exception ex) {
      session.rollback();
      session.close();
      throw new Exception("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.easysoa.registry.rest.integration.EndpointStateService#updateSlaOlaIndicators(SlaOrOlaIndicator[])
 */
@Override public void updateSlaOlaIndicators(SlaOrOlaIndicators slaOrOlaIndicators) throws Exception {
  DirectoryService directoryService=Framework.getService(DirectoryService.class);
  if (slaOrOlaIndicators != null) {
    Session session=directoryService.open("String_Node_Str");
    if (session == null) {
      throw new Exception("String_Node_Str");
    }
    try {
      for (      SlaOrOlaIndicator indicator : slaOrOlaIndicators.getSlaOrOlaIndicatorList()) {
        Map<String,Serializable> parameters=new HashMap<String,Serializable>();
        parameters.put("String_Node_Str",indicator.getSlaOrOlaName());
        parameters.put("String_Node_Str",indicator.getEndpointId());
        DocumentModelList documentModelList=session.query(parameters);
        DocumentModel indicatorModel;
        if (documentModelList != null && documentModelList.size() > 0) {
          indicatorModel=documentModelList.get(0);
          indicatorModel.setPropertyValue("String_Node_Str",indicator.getServiceLevelHealth().toString());
          indicatorModel.setPropertyValue("String_Node_Str",String.valueOf(indicator.isServiceLevelViolation()));
          indicatorModel.setPropertyValue("String_Node_Str",indicator.getTimestamp());
          session.updateEntry(indicatorModel);
        }
 else {
          Map<String,Object> properties=new HashMap<String,Object>();
          properties.put("String_Node_Str",indicator.getEndpointId());
          properties.put("String_Node_Str",indicator.getSlaOrOlaName());
          properties.put("String_Node_Str",indicator.getServiceLevelHealth().toString());
          properties.put("String_Node_Str",indicator.isServiceLevelViolation());
          if (indicator.getTimestamp() != null) {
            GregorianCalendar calendar=new GregorianCalendar();
            calendar.setTime(indicator.getTimestamp());
            properties.put("String_Node_Str",calendar);
          }
          session.createEntry(properties);
        }
      }
      session.commit();
      session.close();
    }
 catch (    Exception ex) {
      session.rollback();
      session.close();
      throw new Exception("String_Node_Str",ex);
    }
  }
}