Program: 188660
Project: 188660
Buggy source:
public static IndexedRisk solrDocumentToRisk(SolrDocument doc){
  IndexedRisk risk=new IndexedRisk();
  risk.setId(objectToString(doc.get(RodaConstants.RISK_ID)));
  risk.setName(objectToString(doc.get(RodaConstants.RISK_NAME)));
  risk.setDescription(objectToString(doc.get(RodaConstants.RISK_DESCRIPTION)));
  risk.setIdentifiedOn(objectToDate(doc.get(RodaConstants.RISK_IDENTIFIED_ON)));
  risk.setIdentifiedBy(objectToString(doc.get(RodaConstants.RISK_IDENTIFIED_BY)));
  risk.setCategory(objectToString(doc.get(RodaConstants.RISK_CATEGORY)));
  risk.setNotes(objectToString(doc.get(RodaConstants.RISK_NOTES)));
  risk.setPreMitigationProbability(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_PROBABILITY),0));
  risk.setPreMitigationImpact(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_IMPACT),0));
  risk.setPreMitigationSeverity(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_SEVERITY),0));
  risk.setPreMitigationSeverityLevel(Risk.SEVERITY_LEVEL.valueOf(objectToString(doc.get(RodaConstants.RISK_PRE_MITIGATION_SEVERITY_LEVEL))));
  risk.setPreMitigationNotes(objectToString(doc.get(RodaConstants.RISK_PRE_MITIGATION_NOTES)));
  risk.setPosMitigationProbability(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_PROBABILITY),0));
  risk.setPosMitigationImpact(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_IMPACT),0));
  risk.setPosMitigationSeverity(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_SEVERITY),0));
  risk.setPosMitigationSeverityLevel(Risk.SEVERITY_LEVEL.valueOf(objectToString(doc.get(RodaConstants.RISK_POS_MITIGATION_SEVERITY_LEVEL))));
  risk.setPosMitigationNotes(objectToString(doc.get(RodaConstants.RISK_POS_MITIGATION_NOTES)));
  risk.setMitigationStrategy(objectToString(doc.get(RodaConstants.RISK_MITIGATION_STRATEGY)));
  risk.setMitigationOwnerType(objectToString(doc.get(RodaConstants.RISK_MITIGATION_OWNER_TYPE)));
  risk.setMitigationOwner(objectToString(doc.get(RodaConstants.RISK_MITIGATION_OWNER)));
  risk.setMitigationRelatedEventIdentifierType(objectToString(doc.get(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_TYPE)));
  risk.setMitigationRelatedEventIdentifierValue(objectToString(doc.get(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_VALUE)));
  risk.setObjectsSize(objectToInteger(doc.get(RodaConstants.RISK_OBJECTS_SIZE),0));
  risk.setAffectedObjects(JsonUtils.getMapFromJson(objectToString(doc.get(RodaConstants.RISK_AFFECTED_OBJECTS))));
  return risk;
}

Fixed version (ground truth):
public static IndexedRisk solrDocumentToRisk(SolrDocument doc){
  IndexedRisk risk=new IndexedRisk();
  risk.setId(objectToString(doc.get(RodaConstants.RISK_ID)));
  risk.setName(objectToString(doc.get(RodaConstants.RISK_NAME)));
  risk.setDescription(objectToString(doc.get(RodaConstants.RISK_DESCRIPTION)));
  risk.setIdentifiedOn(objectToDate(doc.get(RodaConstants.RISK_IDENTIFIED_ON)));
  risk.setIdentifiedBy(objectToString(doc.get(RodaConstants.RISK_IDENTIFIED_BY)));
  risk.setCategory(objectToString(doc.get(RodaConstants.RISK_CATEGORY)));
  risk.setNotes(objectToString(doc.get(RodaConstants.RISK_NOTES)));
  risk.setPreMitigationProbability(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_PROBABILITY),0));
  risk.setPreMitigationImpact(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_IMPACT),0));
  risk.setPreMitigationSeverity(objectToInteger(doc.get(RodaConstants.RISK_PRE_MITIGATION_SEVERITY),0));
  risk.setPreMitigationSeverityLevel(Risk.SEVERITY_LEVEL.valueOf(objectToString(doc.get(RodaConstants.RISK_PRE_MITIGATION_SEVERITY_LEVEL))));
  risk.setPreMitigationNotes(objectToString(doc.get(RodaConstants.RISK_PRE_MITIGATION_NOTES)));
  risk.setPosMitigationProbability(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_PROBABILITY),0));
  risk.setPosMitigationImpact(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_IMPACT),0));
  risk.setPosMitigationSeverity(objectToInteger(doc.get(RodaConstants.RISK_POS_MITIGATION_SEVERITY),0));
  risk.setPosMitigationSeverityLevel(Risk.SEVERITY_LEVEL.valueOf(objectToString(doc.get(RodaConstants.RISK_POS_MITIGATION_SEVERITY_LEVEL))));
  risk.setPosMitigationNotes(objectToString(doc.get(RodaConstants.RISK_POS_MITIGATION_NOTES)));
  risk.setMitigationStrategy(objectToString(doc.get(RodaConstants.RISK_MITIGATION_STRATEGY)));
  risk.setMitigationOwnerType(objectToString(doc.get(RodaConstants.RISK_MITIGATION_OWNER_TYPE)));
  risk.setMitigationOwner(objectToString(doc.get(RodaConstants.RISK_MITIGATION_OWNER)));
  risk.setMitigationRelatedEventIdentifierType(objectToString(doc.get(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_TYPE)));
  risk.setMitigationRelatedEventIdentifierValue(objectToString(doc.get(RodaConstants.RISK_MITIGATION_RELATED_EVENT_IDENTIFIER_VALUE)));
  risk.setObjectsSize(objectToInteger(doc.get(RodaConstants.RISK_OBJECTS_SIZE),0));
  return risk;
}