Program: 85965
Project: 85965
Buggy source:
/** 
 * Create the Json for a new Part. This will be used if and only if the PartRevision has not been indexed in elastic search.
 * @param part the PartIteration which was checkin.
 * @return The Json produced contains the PartRevision information and the information of all the iteration.
 */
protected static XContentBuilder partRevisionToJson(PartIteration part){
  try {
    XContentBuilder tmp=XContentFactory.jsonBuilder().startObject();
    setField(tmp,WORKSPACEID_KEY,part.getWorkspaceId(),0.6f);
    setField(tmp,"String_Node_Str",part.getPartNumber(),4.75f);
    setField(tmp,"String_Node_Str",part.getPartRevision().getPartMaster().getName(),5f);
    setField(tmp,TYPE_KEY,part.getPartRevision().getPartMaster().getType(),2f);
    setField(tmp,VERSION_KEY,part.getPartVersion(),0.10f);
    tmp.startArray(ITERATIONS_KEY);
    for (    PartIteration iteration : part.getPartRevision().getPartIterations()) {
      tmp.startObject();
      setField(tmp,"String_Node_Str",iteration.getIteration(),0.10f);
      setField(tmp,"String_Node_Str",iteration.getPartRevision().getPartMaster().isStandardPart(),0.05f);
      if (iteration.getAuthor() != null) {
        tmp.startObject(AUTHOR_KEY);
        setField(tmp,AUTHOR_LOGIN_KEY,iteration.getAuthor().getLogin(),0.6f);
        setField(tmp,AUTHOR_NAME_KEY,iteration.getAuthor().getName(),0.6f);
        tmp.endObject();
      }
      setField(tmp,CREATION_DATE_KEY,iteration.getCreationDate(),0.4f);
      setField(tmp,MODIFICATION_DATE_KEY,iteration.getModificationDate(),0.4f);
      setField(tmp,"String_Node_Str",iteration.getPartRevision().getDescription(),2f);
      setField(tmp,"String_Node_Str",iteration.getIterationNote(),0.5f);
      setField(tmp,"String_Node_Str",iteration.getPartRevision().getWorkflow(),0.5f);
      if (!iteration.getInstanceAttributes().isEmpty()) {
        tmp.startObject("String_Node_Str");
        Collection<InstanceAttribute> listAttr=iteration.getInstanceAttributes();
        for (        InstanceAttribute attr : listAttr) {
          setField(tmp,attr.getNameWithoutWhiteSpace(),"String_Node_Str" + attr.getValue(),0.6f);
        }
        tmp.endObject();
      }
      tmp.endObject();
    }
    tmp.endArray();
    tmp.endObject();
    return tmp;
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"String_Node_Str" + part + "String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Create the Json for a new Part. This will be used if and only if the PartRevision has not been indexed in elastic search.
 * @param part the PartIteration which was checkin.
 * @return The Json produced contains the PartRevision information and the information of all the iteration.
 */
protected static XContentBuilder partRevisionToJson(PartIteration part){
  try {
    XContentBuilder tmp=XContentFactory.jsonBuilder().startObject();
    setField(tmp,WORKSPACE_ID_KEY,part.getWorkspaceId(),0.6f);
    setField(tmp,PART_NUMBER_KEY,part.getPartNumber(),4.75f);
    setField(tmp,PART_NAME_KEY,part.getPartRevision().getPartMaster().getName(),5f);
    setField(tmp,TYPE_KEY,part.getPartRevision().getPartMaster().getType(),2f);
    setField(tmp,VERSION_KEY,part.getPartVersion(),0.10f);
    tmp.startArray(ITERATIONS_KEY);
    for (    PartIteration iteration : part.getPartRevision().getPartIterations()) {
      tmp.startObject();
      setField(tmp,ITERATION_KEY,iteration.getIteration(),0.10f);
      setField(tmp,STANDARD_PART_KEY,iteration.getPartRevision().getPartMaster().isStandardPart(),0.05f);
      if (iteration.getAuthor() != null) {
        tmp.startObject(AUTHOR_KEY);
        setField(tmp,AUTHOR_LOGIN_KEY,iteration.getAuthor().getLogin(),0.6f);
        setField(tmp,AUTHOR_NAME_KEY,iteration.getAuthor().getName(),0.6f);
        tmp.endObject();
      }
      setField(tmp,CREATION_DATE_KEY,iteration.getCreationDate(),0.4f);
      setField(tmp,MODIFICATION_DATE_KEY,iteration.getModificationDate(),0.4f);
      setField(tmp,DESCRIPTION_KEY,iteration.getPartRevision().getDescription(),2f);
      setField(tmp,REVISION_NOTE_KEY,iteration.getIterationNote(),0.5f);
      setField(tmp,WORKFLOW_KEY,iteration.getPartRevision().getWorkflow(),0.5f);
      if (!iteration.getInstanceAttributes().isEmpty()) {
        tmp.startObject(ATTRIBUTES_KEY);
        Collection<InstanceAttribute> listAttr=iteration.getInstanceAttributes();
        for (        InstanceAttribute attr : listAttr) {
          setField(tmp,attr.getNameWithoutWhiteSpace(),"String_Node_Str" + attr.getValue(),0.6f);
        }
        tmp.endObject();
      }
      tmp.endObject();
    }
    tmp.endArray();
    tmp.endObject();
    return tmp;
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"String_Node_Str" + part + "String_Node_Str",e);
    return null;
  }
}