Program: 71494
Project: 71494
Buggy source:
protected void handleGroupAction(){
  SeriesDefinition sdBackup=(SeriesDefinition)EcoreUtil.copy(seriesdefinition);
  GroupSortingDialog groupDialog=createGroupSortingDialog(sdBackup);
  if (groupDialog.open() == Window.OK) {
    if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
      seriesdefinition.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
    }
 else {
      seriesdefinition.setSorting(sdBackup.getSorting());
    }
    ChartAdapter.beginIgnoreNotifications();
    List sds=ChartUIUtil.getAllOrthogonalSeriesDefinitions(context.getModel());
    for (int i=0; i < sds.size(); i++) {
      if (i != 0) {
        SeriesDefinition sdf=(SeriesDefinition)sds.get(i);
        if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
          sdf.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
        }
 else {
          sdf.setSorting(sdBackup.getSorting());
        }
      }
    }
    ChartAdapter.endIgnoreNotifications();
    seriesdefinition.setSortKey(sdBackup.getSortKey());
    seriesdefinition.getSortKey().eAdapters().addAll(seriesdefinition.eAdapters());
    if (seriesdefinition.getQuery() != null) {
      if (sdBackup.getQuery().getGrouping() == null) {
        return;
      }
      seriesdefinition.getQuery().setGrouping(sdBackup.getQuery().getGrouping());
      seriesdefinition.getQuery().getGrouping().eAdapters().addAll(seriesdefinition.getQuery().eAdapters());
      ChartUIUtil.checkGroupType(context,context.getModel());
    }
  }
}

Fixed version (ground truth):
protected void handleGroupAction(){
  SeriesDefinition sdBackup=(SeriesDefinition)EcoreUtil.copy(seriesdefinition);
  GroupSortingDialog groupDialog=createGroupSortingDialog(sdBackup);
  if (groupDialog.open() == Window.OK) {
    if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
      seriesdefinition.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
    }
 else {
      seriesdefinition.setSorting(sdBackup.getSorting());
    }
    ChartAdapter.beginIgnoreNotifications();
    List<?> sds=ChartUIUtil.getAllOrthogonalSeriesDefinitions(context.getModel());
    for (int i=0; i < sds.size(); i++) {
      if (i != 0) {
        SeriesDefinition sdf=(SeriesDefinition)sds.get(i);
        if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {
          sdf.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());
        }
 else {
          sdf.setSorting(sdBackup.getSorting());
        }
      }
    }
    ChartAdapter.endIgnoreNotifications();
    seriesdefinition.setSortKey(sdBackup.getSortKey());
    seriesdefinition.getSortKey().eAdapters().addAll(seriesdefinition.eAdapters());
    if (seriesdefinition.getQuery() != null) {
      if (sdBackup.getQuery().getGrouping() == null) {
        return;
      }
      seriesdefinition.getQuery().setGrouping(sdBackup.getQuery().getGrouping());
      seriesdefinition.getQuery().getGrouping().eAdapters().addAll(seriesdefinition.getQuery().eAdapters());
      ChartAdapter.beginIgnoreNotifications();
      for (int i=0; i < sds.size(); i++) {
        if (i != 0) {
          SeriesDefinition sdf=(SeriesDefinition)sds.get(i);
          sdf.getQuery().setGrouping((SeriesGrouping)EcoreUtil.copy(seriesdefinition.getQuery().getGrouping()));
          sdf.getQuery().getGrouping().eAdapters().addAll(sdf.getQuery().eAdapters());
        }
      }
      ChartAdapter.endIgnoreNotifications();
      ChartUIUtil.checkGroupType(context,context.getModel());
    }
  }
}