Program: 122619
Project: 122619
Buggy source:
@Override public void execute(){
  metadataChanges.clear();
  if (newSource != null) {
    INodeConnector connector=oldSource.getConnectorFromName(connectorName);
    connector.setCurLinkNbOutput(connector.getCurLinkNbOutput() - 1);
    connector=newSource.getConnectorFromName(connectorName);
    connector.setCurLinkNbOutput(connector.getCurLinkNbOutput() + 1);
    if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.FLOW)) {
      newSourceSchemaType=(String)newSource.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
      boolean builtInNewSource=newSource.getConnectorFromName(connectorName).isMultiSchema();
      boolean builtInOldSource=oldSource.getConnectorFromName(connectorName).isMultiSchema();
      if ((!builtInNewSource) && (!builtInOldSource)) {
        setSchemaToNotBuiltInNode(oldSource,newSource,oldMetadataTable);
        connection.setMetaName(newSource.getUniqueName());
      }
 else {
        if (!builtInNewSource) {
          int num=0;
          for (int i=0; i < oldSource.getMetadataList().size(); i++) {
            IMetadataTable meta=oldSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          oldSource.getMetadataList().remove(num);
          setSchemaToNotBuiltInNode(oldSource,newSource,oldMetadataTable);
          connection.setMetaName(newSource.getUniqueName());
        }
        if (!builtInOldSource) {
          IMetadataTable meta=oldMetadataTable.clone();
          meta.setTableName(connection.getUniqueName());
          newSource.getMetadataList().add(meta);
          connection.setMetaName(meta.getTableName());
        }
        if ((builtInOldSource) && (builtInNewSource)) {
          int num=0;
          for (int i=0; i < oldSource.getMetadataList().size(); i++) {
            IMetadataTable meta=oldSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          oldSource.getMetadataList().remove(num);
          newSource.getMetadataList().add(oldMetadataTable);
        }
      }
      if (newSourceSchemaType != null) {
        newSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
      if (oldSourceSchemaType != null) {
        oldSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
    }
 else {
      connection.setMetaName(newSource.getUniqueName());
    }
    connection.reconnect(newSource,oldTarget,newLineStyle);
    connection.updateName();
    if (newSourceSchemaType != null && connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
      IMetadataTable sourceMetadataTable=newSource.getMetadataFromConnector(connector.getName());
      if (oldMetadataTable != null && sourceMetadataTable != null) {
        boolean sameFlag=oldMetadataTable.sameMetadataAs(sourceMetadataTable,IMetadataColumn.OPTIONS_NONE);
        if (!sameFlag && oldTarget.getComponent().isSchemaAutoPropagated() && (oldMetadataTable.getListColumns().isEmpty() || getPropagateDialog())) {
          ChangeMetadataCommand changeMetadataCmd=new ChangeMetadataCommand(oldTarget,null,null,sourceMetadataTable);
          changeMetadataCmd.execute(true);
          metadataChanges.add(changeMetadataCmd);
        }
      }
    }
  }
 else   if (newTarget != null) {
    newTargetSchemaType=(String)newTarget.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    INodeConnector connector=oldTarget.getConnectorFromType(oldLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() - 1);
    connector=newTarget.getConnectorFromType(newLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() + 1);
    connection.reconnect(oldSource,newTarget,newLineStyle);
    connection.updateName();
    if (newTargetSchemaType != null) {
      if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA) && !connection.getLineStyle().equals(EConnectionType.FLOW_REF)) {
        IMetadataTable targetOldMetadataTable=newTarget.getMetadataFromConnector(connector.getName());
        if (oldMetadataTable != null && targetOldMetadataTable != null) {
          boolean sameFlag=oldMetadataTable.sameMetadataAs(targetOldMetadataTable,IMetadataColumn.OPTIONS_NONE);
          if (!sameFlag && newTarget.getComponent().isSchemaAutoPropagated() && (targetOldMetadataTable.getListColumns().isEmpty() || getPropagateDialog())) {
            ChangeMetadataCommand changeMetadataCmd=new ChangeMetadataCommand(newTarget,null,null,oldMetadataTable);
            changeMetadataCmd.execute(true);
            metadataChanges.add(changeMetadataCmd);
          }
        }
      }
      newTarget.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute(){
  metadataChanges.clear();
  if (newSource != null) {
    INodeConnector connector=oldSource.getConnectorFromName(connectorName);
    connector.setCurLinkNbOutput(connector.getCurLinkNbOutput() - 1);
    connector=newSource.getConnectorFromName(connectorName);
    connector.setCurLinkNbOutput(connector.getCurLinkNbOutput() + 1);
    if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.FLOW)) {
      newSourceSchemaType=(String)newSource.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
      boolean builtInNewSource=newSource.getConnectorFromName(connectorName).isMultiSchema();
      boolean builtInOldSource=oldSource.getConnectorFromName(connectorName).isMultiSchema();
      if ((!builtInNewSource) && (!builtInOldSource)) {
        setSchemaToNotBuiltInNode(oldSource,newSource,oldMetadataTable);
        connection.setMetaName(newSource.getUniqueName());
      }
 else {
        if (!builtInNewSource) {
          int num=0;
          for (int i=0; i < oldSource.getMetadataList().size(); i++) {
            IMetadataTable meta=oldSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          oldSource.getMetadataList().remove(num);
          setSchemaToNotBuiltInNode(oldSource,newSource,oldMetadataTable);
          connection.setMetaName(newSource.getUniqueName());
        }
        if (!builtInOldSource) {
          IMetadataTable meta=oldMetadataTable.clone();
          meta.setTableName(connection.getUniqueName());
          newSource.getMetadataList().add(meta);
          connection.setMetaName(meta.getTableName());
        }
        if ((builtInOldSource) && (builtInNewSource)) {
          int num=0;
          for (int i=0; i < oldSource.getMetadataList().size(); i++) {
            IMetadataTable meta=oldSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          oldSource.getMetadataList().remove(num);
          newSource.getMetadataList().add(oldMetadataTable);
        }
      }
      if (newSourceSchemaType != null) {
        newSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
      if (oldSourceSchemaType != null) {
        oldSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
    }
 else {
      connection.setMetaName(newSource.getUniqueName());
    }
    connection.reconnect(newSource,oldTarget,newLineStyle);
    connection.updateName();
    if (newSourceSchemaType != null && connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
      IMetadataTable sourceMetadataTable=newSource.getMetadataFromConnector(connector.getName());
      if (oldMetadataTable != null && sourceMetadataTable != null) {
        boolean sameFlag=oldMetadataTable.sameMetadataAs(sourceMetadataTable,IMetadataColumn.OPTIONS_NONE);
        if (!sameFlag && oldTarget.getComponent().isSchemaAutoPropagated() && (oldMetadataTable.getListColumns().isEmpty() || getPropagateDialog())) {
          ChangeMetadataCommand changeMetadataCmd=new ChangeMetadataCommand(oldTarget,null,null,sourceMetadataTable);
          changeMetadataCmd.execute(true);
          metadataChanges.add(changeMetadataCmd);
        }
      }
    }
  }
 else   if (newTarget != null) {
    newTargetSchemaType=(String)newTarget.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    INodeConnector connector=oldTarget.getConnectorFromType(oldLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() - 1);
    connector=newTarget.getConnectorFromType(newLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() + 1);
    connection.reconnect(oldSource,newTarget,newLineStyle);
    connection.updateName();
    if (newTargetSchemaType != null) {
      if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA) && !connection.getLineStyle().equals(EConnectionType.FLOW_REF)) {
        IMetadataTable targetOldMetadataTable=newTarget.getMetadataFromConnector(connector.getName());
        if (oldMetadataTable != null && targetOldMetadataTable != null) {
          boolean sameFlag=oldMetadataTable.sameMetadataAs(targetOldMetadataTable,IMetadataColumn.OPTIONS_NONE);
          if (!sameFlag && newTarget.getComponent().isSchemaAutoPropagated() && (targetOldMetadataTable.getListColumns().isEmpty())) {
            ChangeMetadataCommand changeMetadataCmd=new ChangeMetadataCommand(newTarget,null,null,oldMetadataTable);
            changeMetadataCmd.execute(true);
            metadataChanges.add(changeMetadataCmd);
          }
        }
      }
      newTarget.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}