Program: 122591
Project: 122591
Buggy source:
public void undo(){
  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)) {
      boolean builtInNewSource=newSource.getConnectorFromName(connectorName).isMultiSchema();
      boolean builtInOldSource=oldSource.getConnectorFromName(connectorName).isMultiSchema();
      if ((!builtInNewSource) && (!builtInOldSource)) {
        setSchemaToNotBuiltInNode(newSource,oldSource,oldMetadataTable);
        connection.setMetaName(oldSource.getUniqueName());
      }
 else {
        if (!builtInNewSource) {
          oldSource.getMetadataList().add(oldMetadataTable);
          connection.setMetaName(oldMetadataTable.getTableName());
        }
        if (!builtInOldSource) {
          int num=0;
          for (int i=0; i < newSource.getMetadataList().size(); i++) {
            IMetadataTable meta=newSource.getMetadataList().get(i);
            if (meta.getTableName().equals(connection.getUniqueName())) {
              num=i;
            }
          }
          newSource.getMetadataList().remove(num);
          setSchemaToNotBuiltInNode(newSource,oldSource,oldMetadataTable);
          connection.setMetaName(oldSource.getUniqueName());
        }
        if ((builtInOldSource) && (builtInNewSource)) {
          int num=0;
          for (int i=0; i < newSource.getMetadataList().size(); i++) {
            IMetadataTable meta=newSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          newSource.getMetadataList().remove(num);
          oldSource.getMetadataList().add(oldMetadataTable);
        }
      }
      if (newSourceSchemaType != null) {
        for (        ChangeMetadataCommand cmd : metadataChanges) {
          cmd.undo();
        }
        newSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),newSourceSchemaType);
      }
      if (oldSourceSchemaType != null) {
        oldSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),oldSourceSchemaType);
      }
    }
 else {
      connection.setMetaName(oldSource.getUniqueName());
    }
  }
 else   if (newTarget != null) {
    INodeConnector connector=oldTarget.getConnectorFromType(oldLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() + 1);
    connector=newTarget.getConnectorFromType(newLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() - 1);
    if (newTargetSchemaType != null) {
      for (      ChangeMetadataCommand cmd : metadataChanges) {
        cmd.undo();
      }
      newTarget.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),newTargetSchemaType);
    }
  }
  connection.reconnect(oldSource,oldTarget,oldLineStyle);
  connection.updateName();
  ((Process)oldSource.getProcess()).checkStartNodes();
  ((Process)oldSource.getProcess()).checkProcess();
}

Fixed version (ground truth):
@Override public void undo(){
  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)) {
      boolean builtInNewSource=newSource.getConnectorFromName(connectorName).isMultiSchema();
      boolean builtInOldSource=oldSource.getConnectorFromName(connectorName).isMultiSchema();
      if ((!builtInNewSource) && (!builtInOldSource)) {
        setSchemaToNotBuiltInNode(newSource,oldSource,oldMetadataTable);
        connection.setMetaName(oldSource.getUniqueName());
      }
 else {
        if (!builtInNewSource) {
          oldSource.getMetadataList().add(oldMetadataTable);
          connection.setMetaName(oldMetadataTable.getTableName());
        }
        if (!builtInOldSource) {
          int num=0;
          for (int i=0; i < newSource.getMetadataList().size(); i++) {
            IMetadataTable meta=newSource.getMetadataList().get(i);
            if (meta.getTableName().equals(connection.getUniqueName())) {
              num=i;
            }
          }
          newSource.getMetadataList().remove(num);
          setSchemaToNotBuiltInNode(newSource,oldSource,oldMetadataTable);
          connection.setMetaName(oldSource.getUniqueName());
        }
        if ((builtInOldSource) && (builtInNewSource)) {
          int num=0;
          for (int i=0; i < newSource.getMetadataList().size(); i++) {
            IMetadataTable meta=newSource.getMetadataList().get(i);
            if (meta.getTableName().equals(oldMetadataTable.getTableName())) {
              num=i;
            }
          }
          newSource.getMetadataList().remove(num);
          oldSource.getMetadataList().add(oldMetadataTable);
        }
      }
      if (newSourceSchemaType != null) {
        for (        ChangeMetadataCommand cmd : metadataChanges) {
          cmd.undo();
        }
        newSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),newSourceSchemaType);
      }
      if (oldSourceSchemaType != null) {
        oldSource.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),oldSourceSchemaType);
      }
    }
 else {
      connection.setMetaName(oldSource.getUniqueName());
    }
  }
 else   if (newTarget != null) {
    INodeConnector connector=oldTarget.getConnectorFromType(oldLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() + 1);
    connector=newTarget.getConnectorFromType(newLineStyle);
    connector.setCurLinkNbInput(connector.getCurLinkNbInput() - 1);
    if (newTargetSchemaType != null) {
      for (      ChangeMetadataCommand cmd : metadataChanges) {
        cmd.undo();
      }
      newTarget.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),newTargetSchemaType);
    }
  }
  connection.reconnect(oldSource,oldTarget,oldLineStyle);
  connection.updateName();
  ((Process)oldSource.getProcess()).checkStartNodes();
  ((Process)oldSource.getProcess()).checkProcess();
}