Program: 138026
Project: 138026
Buggy source:
@Override protected void handleAddElement(ModelElementChangeRightTarget addElement){
  EObject rightElement=addElement.getRightElement();
  TdColumn columnSetSwitch=SwitchHelpers.COLUMN_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    ColumnSet columnSet=null;
    if (selectedObj instanceof DBColumnFolderRepNode) {
      DBColumnFolderRepNode columnFolderRepNode=(DBColumnFolderRepNode)selectedObj;
      columnSet=columnFolderRepNode.getColumnSet();
    }
 else     if (selectedObj instanceof ColumnSet) {
      columnSet=(ColumnSet)selectedObj;
    }
    ColumnSetHelper.addColumn(columnSetSwitch,columnSet);
    PrimaryKey primaryKey=ColumnHelper.getPrimaryKey(columnSetSwitch);
    if (primaryKey != null) {
      TableHelper.addPrimaryKey((TdTable)columnSet,primaryKey);
      PrimaryKey newPrimaryKey=TableHelper.addPrimaryKey((TdTable)columnSet,primaryKey);
      columnSetSwitch.getUniqueKey().remove(primaryKey);
      columnSetSwitch.getUniqueKey().add(newPrimaryKey);
    }
    Set<ForeignKey> foreignKeySet=ColumnHelper.getForeignKey(columnSetSwitch);
    for (    ForeignKey foreignKey : foreignKeySet) {
      if (foreignKey != null) {
        ForeignKey newForeignKey=TableHelper.addForeignKey((TdTable)columnSet,foreignKey);
        columnSetSwitch.getKeyRelationship().remove(foreignKey);
        columnSetSwitch.getKeyRelationship().add(newForeignKey);
      }
    }
    return;
  }
  TdExpression addedExpression=DataqualitySwitchHelper.TDEXPRESSION_SWITCH.doSwitch(rightElement);
  if (addedExpression != null) {
    TdColumn parentColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(addElement.getLeftParent());
    if (parentColumn != null) {
      parentColumn.setInitialValue(addedExpression);
    }
  }
}

Fixed version (ground truth):
@Override protected void handleAddElement(ModelElementChangeRightTarget addElement){
  EObject rightElement=addElement.getRightElement();
  TdColumn columnSetSwitch=SwitchHelpers.COLUMN_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    ColumnSet columnSet=null;
    if (selectedObj instanceof DBColumnFolderRepNode) {
      DBColumnFolderRepNode columnFolderRepNode=(DBColumnFolderRepNode)selectedObj;
      columnSet=columnFolderRepNode.getColumnSet();
    }
 else     if (selectedObj instanceof ColumnSet) {
      columnSet=(ColumnSet)selectedObj;
    }
    ColumnSetHelper.addColumn(columnSetSwitch,columnSet);
    PrimaryKey primaryKey=ColumnHelper.getPrimaryKey(columnSetSwitch);
    if (primaryKey != null) {
      TableHelper.addPrimaryKey((TdTable)columnSet,columnSetSwitch);
    }
    Set<ForeignKey> foreignKeySet=ColumnHelper.getForeignKey(columnSetSwitch);
    for (    ForeignKey foreignKey : foreignKeySet) {
      if (foreignKey != null) {
        TableHelper.addForeignKey((TdTable)columnSet,foreignKey,columnSetSwitch);
      }
    }
    return;
  }
  TdExpression addedExpression=DataqualitySwitchHelper.TDEXPRESSION_SWITCH.doSwitch(rightElement);
  if (addedExpression != null) {
    TdColumn parentColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(addElement.getLeftParent());
    if (parentColumn != null) {
      parentColumn.setInitialValue(addedExpression);
    }
  }
}