Program: 118536
Project: 118536
Buggy source:
protected void saveNode(TalendFileFactory fileFact,ProcessType process,EList nList,EList cList,Node node,MetadataEmfFactory factory){
  NodeType nType;
  List<Connection> connList;
  Connection connec;
  ConnectionType cType;
  List<? extends IElementParameter> paramList;
  List<IMetadataTable> listMetaData;
  EList listParamType;
  EList listMetaType;
  IMetadataTable metaData;
  nType=createNodeType(fileFact,process,nList,node);
  nType.setComponentVersion(node.getComponent().getVersion());
  nType.setComponentName(node.getComponent().getName());
  nType.setPosX(node.getLocation().x);
  nType.setPosY(node.getLocation().y);
  nType.setOffsetLabelX(node.getNodeLabel().getOffset().x);
  nType.setOffsetLabelY(node.getNodeLabel().getOffset().y);
  if ((node.getSize().width != Node.DEFAULT_SIZE) || (node.getSize().height != Node.DEFAULT_SIZE)) {
    nType.setSizeX(node.getSize().width);
    nType.setSizeY(node.getSize().height);
  }
  if (node.getExternalNode() != null) {
    nType.setNodeData(node.getExternalNode().getExternalEmfData());
  }
  listParamType=nType.getElementParameter();
  paramList=node.getElementParameters();
  IComponent component=node.getComponent();
  if (EComponentType.GENERIC.equals(component.getComponentType())) {
    generic=true;
  }
  saveElementParameters(fileFact,paramList,listParamType,process);
  listMetaType=nType.getMetadata();
  listMetaData=node.getMetadataList();
  for (int j=0; j < listMetaData.size(); j++) {
    metaData=listMetaData.get(j);
    factory.setMetadataTable(metaData);
    listMetaType.add(factory.getMetadataType());
  }
  List<? extends IConnection> outgoingConnections=node.getOutgoingConnections();
  connList=new ArrayList<Connection>();
  for (  IConnection connection : outgoingConnections) {
    if (connection instanceof Connection) {
      connList.add((Connection)connection);
    }
  }
  for (int j=0; j < connList.size(); j++) {
    connec=connList.get(j);
    cType=fileFact.createConnectionType();
    cType.setSource(node.getUniqueName());
    INode jTarget=connec.getTarget();
    String targetUniqueName=jTarget.getUniqueName();
    if (jTarget instanceof Node) {
      Node jn=(Node)jTarget.getJobletNode();
      if (jn != null) {
        targetUniqueName=jn.getUniqueName();
      }
    }
    cType.setTarget(targetUniqueName);
    cType.setLabel(connec.getName());
    cType.setLineStyle(connec.getLineStyleId());
    cType.setConnectorName(connec.getConnectorName());
    cType.setOffsetLabelX(connec.getConnectionLabel().getOffset().x);
    cType.setOffsetLabelY(connec.getConnectionLabel().getOffset().y);
    cType.setMetaname(connec.getMetaName());
    int id=connec.getOutputId();
    if (id >= 0) {
      cType.setOutputId(id);
    }
    INode connTarget=connec.getTarget();
    if (connTarget.getJobletNode() != null) {
      connTarget=connTarget.getJobletNode();
    }
    if (connTarget.getComponent().useMerge()) {
      cType.setMergeOrder(connec.getInputId());
    }
    listParamType=cType.getElementParameter();
    paramList=connec.getElementParameters();
    saveElementParameters(fileFact,paramList,listParamType,process);
    cList.add(cType);
  }
  if (node.getExternalNode() != null && node.getExternalNode().getScreenshot() != null) {
    byte[] saveImageToData=ImageUtils.saveImageToData(node.getExternalNode().getScreenshot());
    process.getScreenshots().put(node.getUniqueName(),saveImageToData);
  }
}

Fixed version (ground truth):
protected void saveNode(TalendFileFactory fileFact,ProcessType process,EList nList,EList cList,Node node,MetadataEmfFactory factory){
  NodeType nType;
  List<Connection> connList;
  Connection connec;
  ConnectionType cType;
  List<? extends IElementParameter> paramList;
  List<IMetadataTable> listMetaData;
  EList listParamType;
  EList listMetaType;
  IMetadataTable metaData;
  nType=createNodeType(fileFact,process,nList,node);
  nType.setComponentVersion(node.getComponent().getVersion());
  nType.setComponentName(node.getComponent().getName());
  nType.setPosX(node.getLocation().x);
  nType.setPosY(node.getLocation().y);
  nType.setOffsetLabelX(node.getNodeLabel().getOffset().x);
  nType.setOffsetLabelY(node.getNodeLabel().getOffset().y);
  if ((node.getSize().width != Node.DEFAULT_SIZE) || (node.getSize().height != Node.DEFAULT_SIZE)) {
    nType.setSizeX(node.getSize().width);
    nType.setSizeY(node.getSize().height);
  }
  if (node.getExternalNode() != null) {
    nType.setNodeData(node.getExternalNode().getExternalEmfData());
  }
  listParamType=nType.getElementParameter();
  paramList=node.getElementParameters();
  saveElementParameters(fileFact,paramList,listParamType,process);
  listMetaType=nType.getMetadata();
  listMetaData=node.getMetadataList();
  for (int j=0; j < listMetaData.size(); j++) {
    metaData=listMetaData.get(j);
    factory.setMetadataTable(metaData);
    listMetaType.add(factory.getMetadataType());
  }
  List<? extends IConnection> outgoingConnections=node.getOutgoingConnections();
  connList=new ArrayList<Connection>();
  for (  IConnection connection : outgoingConnections) {
    if (connection instanceof Connection) {
      connList.add((Connection)connection);
    }
  }
  for (int j=0; j < connList.size(); j++) {
    connec=connList.get(j);
    cType=fileFact.createConnectionType();
    cType.setSource(node.getUniqueName());
    INode jTarget=connec.getTarget();
    String targetUniqueName=jTarget.getUniqueName();
    if (jTarget instanceof Node) {
      Node jn=(Node)jTarget.getJobletNode();
      if (jn != null) {
        targetUniqueName=jn.getUniqueName();
      }
    }
    cType.setTarget(targetUniqueName);
    cType.setLabel(connec.getName());
    cType.setLineStyle(connec.getLineStyleId());
    cType.setConnectorName(connec.getConnectorName());
    cType.setOffsetLabelX(connec.getConnectionLabel().getOffset().x);
    cType.setOffsetLabelY(connec.getConnectionLabel().getOffset().y);
    cType.setMetaname(connec.getMetaName());
    int id=connec.getOutputId();
    if (id >= 0) {
      cType.setOutputId(id);
    }
    INode connTarget=connec.getTarget();
    if (connTarget.getJobletNode() != null) {
      connTarget=connTarget.getJobletNode();
    }
    if (connTarget.getComponent().useMerge()) {
      cType.setMergeOrder(connec.getInputId());
    }
    listParamType=cType.getElementParameter();
    paramList=connec.getElementParameters();
    saveElementParameters(fileFact,paramList,listParamType,process);
    cList.add(cType);
  }
  if (node.getExternalNode() != null && node.getExternalNode().getScreenshot() != null) {
    byte[] saveImageToData=ImageUtils.saveImageToData(node.getExternalNode().getScreenshot());
    process.getScreenshots().put(node.getUniqueName(),saveImageToData);
  }
}