Program: 122386
Project: 122386
Buggy source:
@Override public void execute(){
  propagateInput();
  if (!oldMetaDataList.isEmpty() && !newMetaDataList.isEmpty() && !oldMetaDataList.get(0).sameMetadataAs(newMetaDataList.get(0))) {
    node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
  }
  metadataOutputChanges.clear();
  List<IConnection> initTraceList=new ArrayList<IConnection>();
  for (  IConnection connection : node.getOutgoingConnections()) {
    if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
      IODataComponent dataComponent=inAndOut.getDataComponent(connection);
      if (!connection.getMetadataTable().sameMetadataAs(dataComponent.getTable())) {
        IMetadataTable table=connection.getMetadataTable();
        if (table == null || table.getListColumns().isEmpty()) {
          initTraceList.add(connection);
        }
        INode connTar=connection.getTarget();
        boolean openDialog=false;
        Map<String,Boolean> jobletMap=new HashMap<String,Boolean>();
        if (isForTemlate()) {
          openDialog=true;
        }
 else {
          openDialog=getPropagate(connection,jobletMap);
        }
        if (openDialog) {
          IElementParameter schemaParam=null;
          if (connection != null) {
            IMetadataTable connTable=connection.getMetadataTable();
            IMetadataTable dataTable=dataComponent.getTable();
            for (            IElementParameter param : ((Node)connection.getTarget()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && param.getContext().equals(connection.getConnectorName())) {
                schemaParam=param;
                break;
              }
            }
            if (schemaParam != null) {
              ChangeMetadataCommand cmd=new ChangeMetadataCommand((Node)connection.getTarget(),schemaParam,connTable,dataTable);
              cmd.execute(true);
              metadataOutputChanges.add(cmd);
            }
            for (            IElementParameter param : ((Node)connection.getSource()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && param.getContext().equals(connection.getConnectorName())) {
                schemaParam=param;
                break;
              }
            }
            if (schemaParam != null) {
              ChangeMetadataCommand cmd=new ChangeMetadataCommand((Node)connection.getSource(),schemaParam,connTable,dataTable);
              cmd.execute(true);
              metadataOutputChanges.add(cmd);
            }
            if (((Node)connTar).isJoblet()) {
              IElementParameter param=connTar.getElementParameter(connection.getTarget().getUniqueName());
              if (param != null) {
                IMetadataTable originaleOutputTable=connTar.getMetadataFromConnector(param.getContext());
                if (originaleOutputTable != null) {
                  MetadataToolHelper.copyTable(dataTable,originaleOutputTable);
                }
              }
            }
 else             if (((Node)connTar).getJobletNode() != null) {
              IElementParameter param=((Node)connTar).getJobletNode().getElementParameter(connection.getTarget().getUniqueName());
              if (param != null) {
                IMetadataTable originaleOutputTable=((Node)connTar).getJobletNode().getMetadataFromConnector(param.getContext());
                if (originaleOutputTable != null) {
                  MetadataToolHelper.copyTable(dataTable,originaleOutputTable);
                }
              }
            }
          }
          if (((Node)connTar).isJoblet()) {
            changeCollapsedState(true,jobletMap,connTar);
          }
        }
 else {
          final Node target=(Node)connection.getTarget();
          if (target != null && target.getExternalNode() != null) {
            if (GlobalServiceRegister.getDefault().isServiceRegistered(IXmlMapService.class)) {
              final IXmlMapService service=(IXmlMapService)GlobalServiceRegister.getDefault().getService(IXmlMapService.class);
              if (service.isXmlMapComponent(target.getExternalNode())) {
                IODataComponent output=new IODataComponent(connection,dataComponent.getTable());
                target.metadataInputChanged(output,connection.getUniqueName());
              }
            }
          }
        }
      }
      if (connection instanceof Connection) {
        ((Connection)connection).updateName();
      }
    }
  }
  node.setExternalData(newExternalData);
  List<IMetadataTable> cloneNewMetadata=new ArrayList<IMetadataTable>();
  if (newMetaDataList != null) {
    for (    IMetadataTable t : newMetaDataList) {
      cloneNewMetadata.add(t.clone(true));
    }
  }
  node.setMetadataList(cloneNewMetadata);
  for (  IConnection conn : initTraceList) {
    if (conn instanceof Connection) {
      ((Connection)conn).initTraceParamters();
    }
  }
  for (  Connection connection : connectionsToDelete.keySet()) {
    connection.disconnect();
    INode prevNode=connection.getSource();
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=prevNode.getConnectorFromType(connection.getLineStyle());
    nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() - 1);
    INode nextNode=connection.getTarget();
    nodeConnectorTarget=nextNode.getConnectorFromType(connection.getLineStyle());
    nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() - 1);
    inAndOut.getOuputs().remove(connectionsToDelete.get(connection));
  }
  ((Process)node.getProcess()).checkProcess();
  if (!isMetaLanguage) {
    refreshCodeView();
    ComponentSettings.switchToCurComponentSettingsView();
  }
}

Fixed version (ground truth):
@Override public void execute(){
  propagateInput();
  if (!oldMetaDataList.isEmpty() && !newMetaDataList.isEmpty() && !oldMetaDataList.get(0).sameMetadataAs(newMetaDataList.get(0))) {
    node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
  }
  metadataOutputChanges.clear();
  List<IConnection> initTraceList=new ArrayList<IConnection>();
  for (  IConnection connection : node.getOutgoingConnections()) {
    if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
      IODataComponent dataComponent=inAndOut.getDataComponent(connection);
      if (!connection.getMetadataTable().sameMetadataAs(dataComponent.getTable())) {
        IMetadataTable table=connection.getMetadataTable();
        if (table == null || table.getListColumns().isEmpty()) {
          initTraceList.add(connection);
        }
        INode connTar=connection.getTarget();
        boolean openDialog=false;
        Map<String,Boolean> jobletMap=new HashMap<String,Boolean>();
        if (isForTemlate()) {
          openDialog=true;
        }
 else {
          openDialog=getPropagate(connection,jobletMap);
        }
        if (openDialog) {
          IElementParameter schemaParam=null;
          if (connection != null) {
            IMetadataTable connTable=connection.getMetadataTable();
            IMetadataTable dataTable=dataComponent.getTable();
            for (            IElementParameter param : ((Node)connection.getTarget()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && param.getContext().equals(connection.getConnectorName())) {
                schemaParam=param;
                break;
              }
            }
            if (schemaParam != null) {
              ChangeMetadataCommand cmd=new ChangeMetadataCommand(connection.getTarget(),schemaParam,connTable,dataTable);
              cmd.execute(true);
              metadataOutputChanges.add(cmd);
            }
            for (            IElementParameter param : ((Node)connection.getSource()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && param.getContext().equals(connection.getConnectorName())) {
                schemaParam=param;
                break;
              }
            }
            if (schemaParam != null) {
              ChangeMetadataCommand cmd=new ChangeMetadataCommand(connection.getSource(),schemaParam,connTable,dataTable);
              cmd.execute(true);
              metadataOutputChanges.add(cmd);
            }
            if (((Node)connTar).isJoblet()) {
              IElementParameter param=connTar.getElementParameter(connection.getTarget().getUniqueName());
              if (param != null) {
                IMetadataTable originaleOutputTable=connTar.getMetadataFromConnector(param.getContext());
                if (originaleOutputTable != null) {
                  MetadataToolHelper.copyTable(dataTable,originaleOutputTable);
                }
              }
            }
 else             if (((Node)connTar).getJobletNode() != null) {
              IElementParameter param=((Node)connTar).getJobletNode().getElementParameter(connection.getTarget().getUniqueName());
              if (param != null) {
                IMetadataTable originaleOutputTable=((Node)connTar).getJobletNode().getMetadataFromConnector(param.getContext());
                if (originaleOutputTable != null) {
                  MetadataToolHelper.copyTable(dataTable,originaleOutputTable);
                }
              }
            }
          }
          if (((Node)connTar).isJoblet()) {
            changeCollapsedState(true,jobletMap,connTar);
          }
        }
 else {
          final Node target=(Node)connection.getTarget();
          if (target != null && target.getExternalNode() != null) {
            if (GlobalServiceRegister.getDefault().isServiceRegistered(IXmlMapService.class)) {
              final IXmlMapService service=(IXmlMapService)GlobalServiceRegister.getDefault().getService(IXmlMapService.class);
              if (service.isXmlMapComponent(target.getExternalNode())) {
                IODataComponent output=new IODataComponent(connection,dataComponent.getTable());
                target.metadataInputChanged(output,connection.getUniqueName());
              }
            }
          }
        }
      }
      if (connection instanceof Connection) {
        ((Connection)connection).updateName();
      }
    }
  }
  node.setExternalData(newExternalData);
  List<IMetadataTable> cloneNewMetadata=new ArrayList<IMetadataTable>();
  if (newMetaDataList != null) {
    for (    IMetadataTable t : newMetaDataList) {
      cloneNewMetadata.add(t.clone(true));
    }
  }
  node.setMetadataList(cloneNewMetadata);
  for (  IConnection conn : initTraceList) {
    if (conn instanceof Connection) {
      ((Connection)conn).initTraceParamters();
    }
  }
  for (  Connection connection : connectionsToDelete.keySet()) {
    connection.disconnect();
    INode prevNode=connection.getSource();
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=prevNode.getConnectorFromType(connection.getLineStyle());
    nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() - 1);
    INode nextNode=connection.getTarget();
    nodeConnectorTarget=nextNode.getConnectorFromType(connection.getLineStyle());
    nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() - 1);
    inAndOut.getOuputs().remove(connectionsToDelete.get(connection));
  }
  ((Process)node.getProcess()).checkProcess();
  if (!isMetaLanguage) {
    refreshCodeView();
    ComponentSettings.switchToCurComponentSettingsView();
  }
}