Program: 188659
Project: 188659
Buggy source:
public static SolrInputDocument riskToSolrDocument(Risk risk){
  SolrInputDocument doc=new SolrInputDocument();
  doc.addField(RodaConstants.RISK_ID,risk.getId());
  doc.addField(RodaConstants.RISK_NAME,risk.getName());
  doc.addField(RodaConstants.RISK_DESCRIPTION,risk.getDescription());
  doc.addField(RodaConstants.RISK_IDENTIFIED_ON,risk.getIdentifiedOn());
  doc.addField(RodaConstants.RISK_IDENTIFIED_BY,risk.getIdentifiedBy());
  doc.addField(RodaConstants.RISK_CATEGORY,risk.getCategory());
  doc.addField(RodaConstants.RISK_NOTES,risk.getNotes());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_PROBABILITY,risk.getPreMitigationProbability());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_IMPACT,risk.getPreMitigationImpact());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_SEVERITY,risk.getPreMitigationSeverity());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_SEVERITY_LEVEL,risk.getPreMitigationSeverityLevel().toString());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_NOTES,risk.getPreMitigationNotes());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_PROBABILITY,risk.getPosMitigationProbability());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_IMPACT,risk.getPosMitigationImpact());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_SEVERITY,risk.getPosMitigationSeverity());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_SEVERITY_LEVEL,risk.getPosMitigationSeverityLevel().toString());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_NOTES,risk.getPosMitigationNotes());
  doc.addField(RodaConstants.RISK_MITIGATION_STRATEGY,risk.getMitigationStrategy());
  doc.addField(RodaConstants.RISK_MITIGATION_OWNER_TYPE,risk.getMitigationOwnerType());
  doc.addField(RodaConstants.RISK_MITIGATION_OWNER,risk.getMitigationOwner());
  doc.addField(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_TYPE,risk.getMitigationRelatedEventIdentifierType());
  doc.addField(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_VALUE,risk.getMitigationRelatedEventIdentifierValue());
  doc.addField(RodaConstants.RISK_AFFECTED_OBJECTS,JsonUtils.getJsonFromObject(risk.getAffectedObjects()));
  if (risk instanceof IndexedRisk) {
    doc.addField(RodaConstants.RISK_OBJECTS_SIZE,((IndexedRisk)risk).getObjectsSize());
  }
 else {
    doc.addField(RodaConstants.RISK_OBJECTS_SIZE,0);
  }
  return doc;
}

Fixed version (ground truth):
public static SolrInputDocument riskToSolrDocument(Risk risk){
  SolrInputDocument doc=new SolrInputDocument();
  doc.addField(RodaConstants.RISK_ID,risk.getId());
  doc.addField(RodaConstants.RISK_NAME,risk.getName());
  doc.addField(RodaConstants.RISK_DESCRIPTION,risk.getDescription());
  doc.addField(RodaConstants.RISK_IDENTIFIED_ON,risk.getIdentifiedOn());
  doc.addField(RodaConstants.RISK_IDENTIFIED_BY,risk.getIdentifiedBy());
  doc.addField(RodaConstants.RISK_CATEGORY,risk.getCategory());
  doc.addField(RodaConstants.RISK_NOTES,risk.getNotes());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_PROBABILITY,risk.getPreMitigationProbability());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_IMPACT,risk.getPreMitigationImpact());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_SEVERITY,risk.getPreMitigationSeverity());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_SEVERITY_LEVEL,risk.getPreMitigationSeverityLevel().toString());
  doc.addField(RodaConstants.RISK_PRE_MITIGATION_NOTES,risk.getPreMitigationNotes());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_PROBABILITY,risk.getPosMitigationProbability());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_IMPACT,risk.getPosMitigationImpact());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_SEVERITY,risk.getPosMitigationSeverity());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_SEVERITY_LEVEL,risk.getPosMitigationSeverityLevel().toString());
  doc.addField(RodaConstants.RISK_POS_MITIGATION_NOTES,risk.getPosMitigationNotes());
  doc.addField(RodaConstants.RISK_MITIGATION_STRATEGY,risk.getMitigationStrategy());
  doc.addField(RodaConstants.RISK_MITIGATION_OWNER_TYPE,risk.getMitigationOwnerType());
  doc.addField(RodaConstants.RISK_MITIGATION_OWNER,risk.getMitigationOwner());
  doc.addField(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_TYPE,risk.getMitigationRelatedEventIdentifierType());
  doc.addField(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_VALUE,risk.getMitigationRelatedEventIdentifierValue());
  if (risk instanceof IndexedRisk) {
    doc.addField(RodaConstants.RISK_OBJECTS_SIZE,((IndexedRisk)risk).getObjectsSize());
  }
 else {
    doc.addField(RodaConstants.RISK_OBJECTS_SIZE,0);
  }
  return doc;
}