Program: 119254
Project: 119254
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);
      boolean sameMetadataAs=connection.getMetadataTable().sameMetadataAs(dataComponent.getTable());
      IMetadataTable tempTable=null;
      boolean isSchemaAutoPropagated=true;
      if (connection.getTarget().getComponent() instanceof EmfComponent) {
        EmfComponent component=(EmfComponent)connection.getTarget().getComponent();
        isSchemaAutoPropagated=component.isSchemaAutoPropagated();
      }
      if (sameMetadataAs || !isSchemaAutoPropagated) {
        for (        IMetadataTable itable : newMetaDataList) {
          if (connection.getMetadataTable().getTableName().equals(itable.getTableName())) {
            sameMetadataAs=connection.getMetadataTable().sameMetadataAs(itable);
            tempTable=itable;
            break;
          }
        }
      }
 else {
        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();
            if (tempTable != null) {
              dataTable=tempTable;
            }
            for (            IElementParameter param : ((Node)connection.getTarget()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)) {
                INodeConnector connector=connection.getTarget().getConnectorFromName(connection.getConnectorName());
                if (connector != null && param.getContext().equals(connector.getBaseSchema())) {
                  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.getSource().getConnectorFromName(connection.getConnectorName()).getBaseSchema())) {
                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());
              }
            }
 else             if (GlobalServiceRegister.getDefault().isServiceRegistered(IDQComponentService.class)) {
              final IDQComponentService service=(IDQComponentService)GlobalServiceRegister.getDefault().getService(IDQComponentService.class);
              service.externalComponentChange(connection,dataComponent.getTable());
            }
          }
        }
      }
      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()).checkStartNodes();
  }
  ((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);
      boolean sameMetadataAs=connection.getMetadataTable().sameMetadataAs(dataComponent.getTable());
      IMetadataTable tempTable=null;
      boolean isSchemaAutoPropagated=true;
      if (connection.getTarget().getComponent() instanceof EmfComponent) {
        EmfComponent component=(EmfComponent)connection.getTarget().getComponent();
        isSchemaAutoPropagated=component.isSchemaAutoPropagated();
      }
      if (sameMetadataAs || !isSchemaAutoPropagated) {
        for (        IMetadataTable itable : newMetaDataList) {
          if (connection.getMetadataTable().getTableName().equals(itable.getTableName())) {
            sameMetadataAs=connection.getMetadataTable().sameMetadataAs(itable);
            tempTable=itable;
            break;
          }
        }
      }
 else {
        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();
            if (tempTable != null) {
              dataTable=tempTable;
            }
            for (            IElementParameter param : ((Node)connection.getTarget()).getElementParameters()) {
              if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)) {
                INodeConnector connector=connection.getTarget().getConnectorFromName(connection.getConnectorName());
                if (connector != null && param.getContext().equals(connector.getBaseSchema())) {
                  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.getSource().getConnectorFromName(connection.getConnectorName()).getBaseSchema())) {
                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 (GlobalServiceRegister.getDefault().isServiceRegistered(IDQComponentService.class)) {
              final IDQComponentService service=(IDQComponentService)GlobalServiceRegister.getDefault().getService(IDQComponentService.class);
              service.externalComponentChange(connection,dataComponent.getTable());
            }
          }
        }
      }
      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()).checkStartNodes();
  }
  ((Process)node.getProcess()).checkProcess();
  if (!isMetaLanguage) {
    refreshCodeView();
    ComponentSettings.switchToCurComponentSettingsView();
  }
}