Program: 85970
Project: 85970
Buggy source:
/** 
 * Convert a Document Revision to a JSON Builder. This will be used if and only if the DocumentRevision has not been indexed in elastic search.
 * @param doc           Document to pass to JSON
 * @param contentInputs Map of binary resources content
 * @return A JSON Builder to index
 */
protected static Map<String,Object> docIterationMap(DocumentIteration doc,Map<String,String> contentInputs){
  Map<String,Object> params=new HashMap<>();
  setParam(params,WORKSPACEID_KEY,doc.getWorkspaceId(),0.6f);
  setParam(params,"String_Node_Str",doc.getDocumentRevision().getDocumentMasterId(),4.75f);
  setParam(params,"String_Node_Str",doc.getDocumentRevision().getTitle(),5f);
  setParam(params,VERSION_KEY,doc.getDocumentVersion(),0.10f);
  setParam(params,"String_Node_Str","String_Node_Str" + doc.getIteration(),0.10f);
  if (doc.getAuthor() != null) {
    Map<String,Object> authorParams=new HashMap<>();
    params.put(AUTHOR_KEY,authorParams);
    setParam(authorParams,AUTHOR_LOGIN_KEY,doc.getAuthor().getLogin(),0.6f);
    setParam(authorParams,AUTHOR_NAME_KEY,doc.getAuthor().getName(),0.6f);
  }
  setParam(params,TYPE_KEY,doc.getDocumentRevision().getDocumentMaster().getType(),2f);
  setParam(params,CREATION_DATE_KEY,doc.getDocumentRevision().getCreationDate(),0.4f);
  setParam(params,MODIFICATION_DATE_KEY,doc.getModificationDate(),0.4f);
  setParam(params,"String_Node_Str",doc.getDocumentRevision().getDescription(),2f);
  setParam(params,"String_Node_Str",doc.getRevisionNote(),0.5f);
  setParam(params,"String_Node_Str",doc.getDocumentRevision().getWorkflow(),0.5f);
  setParam(params,"String_Node_Str",doc.getDocumentRevision().getLocation().getShortName(),0.5f);
  if (!doc.getDocumentRevision().getTags().isEmpty()) {
    params.put("String_Node_Str",doc.getDocumentRevision().getTags().toArray());
  }
  if (!doc.getInstanceAttributes().isEmpty()) {
    Map<String,Object> attrParams=new HashMap<>();
    params.put("String_Node_Str",attrParams);
    Collection<InstanceAttribute> listAttr=doc.getInstanceAttributes();
    for (    InstanceAttribute attr : listAttr) {
      setParam(attrParams,attr.getNameWithoutWhiteSpace(),"String_Node_Str" + attr.getValue(),0.6f);
    }
  }
  if (!doc.getAttachedFiles().isEmpty()) {
    Map<String,Object> filesParams=new HashMap<>();
    params.put("String_Node_Str",filesParams);
    for (    Map.Entry<String,String> contentInput : contentInputs.entrySet()) {
      Map<String,Object> map=new HashMap<>();
      filesParams.put(contentInput.getKey(),map);
      setParam(map,AUTHOR_NAME_KEY,contentInput.getKey(),0.8f);
      setParam(map,"String_Node_Str",contentInput.getValue(),0.6f);
    }
  }
  return params;
}

Fixed version (ground truth):
/** 
 * Convert a Document Revision to a JSON Builder. This will be used if and only if the DocumentRevision has not been indexed in elastic search.
 * @param doc           Document to pass to JSON
 * @param contentInputs Map of binary resources content
 * @return A JSON Builder to index
 */
protected static Map<String,Object> docIterationMap(DocumentIteration doc,Map<String,String> contentInputs){
  Map<String,Object> params=new HashMap<>();
  setParam(params,WORKSPACE_ID_KEY,doc.getWorkspaceId(),0.6f);
  setParam(params,DOCUMENT_ID_KEY,doc.getDocumentRevision().getDocumentMasterId(),4.75f);
  setParam(params,TITLE_KEY,doc.getDocumentRevision().getTitle(),5f);
  setParam(params,VERSION_KEY,doc.getDocumentVersion(),0.10f);
  setParam(params,ITERATION_KEY,"String_Node_Str" + doc.getIteration(),0.10f);
  if (doc.getAuthor() != null) {
    Map<String,Object> authorParams=new HashMap<>();
    params.put(AUTHOR_KEY,authorParams);
    setParam(authorParams,AUTHOR_LOGIN_KEY,doc.getAuthor().getLogin(),0.6f);
    setParam(authorParams,AUTHOR_NAME_KEY,doc.getAuthor().getName(),0.6f);
  }
  setParam(params,TYPE_KEY,doc.getDocumentRevision().getDocumentMaster().getType(),2f);
  setParam(params,CREATION_DATE_KEY,doc.getDocumentRevision().getCreationDate(),0.4f);
  setParam(params,MODIFICATION_DATE_KEY,doc.getModificationDate(),0.4f);
  setParam(params,DESCRIPTION_KEY,doc.getDocumentRevision().getDescription(),2f);
  setParam(params,REVISION_NOTE_KEY,doc.getRevisionNote(),0.5f);
  setParam(params,WORKFLOW_KEY,doc.getDocumentRevision().getWorkflow(),0.5f);
  setParam(params,FOLDER_KEY,doc.getDocumentRevision().getLocation().getShortName(),0.5f);
  if (!doc.getDocumentRevision().getTags().isEmpty()) {
    List<String> labels=new ArrayList<>();
    for (    Tag tag : doc.getDocumentRevision().getTags()) {
      labels.add(tag.getLabel());
    }
    params.put(TAGS_KEY,labels);
  }
  if (!doc.getInstanceAttributes().isEmpty()) {
    Map<String,Object> attrParams=new HashMap<>();
    params.put(ATTRIBUTES_KEY,attrParams);
    Collection<InstanceAttribute> listAttr=doc.getInstanceAttributes();
    for (    InstanceAttribute attr : listAttr) {
      setParam(attrParams,attr.getNameWithoutWhiteSpace(),"String_Node_Str" + attr.getValue(),0.6f);
    }
  }
  if (!doc.getAttachedFiles().isEmpty()) {
    Map<String,Object> filesParams=new HashMap<>();
    params.put(FILES_KEY,filesParams);
    for (    Map.Entry<String,String> contentInput : contentInputs.entrySet()) {
      Map<String,Object> map=new HashMap<>();
      filesParams.put(contentInput.getKey(),map);
      setParam(map,AUTHOR_NAME_KEY,contentInput.getKey(),0.8f);
      setParam(map,CONTENT_KEY,contentInput.getValue(),0.6f);
    }
  }
  return params;
}