Program: 76226
Project: 76226
Buggy source:
protected Command createAddCommand(EditPart parent,EditPart child,EditPart after){
  Object parentObj=parent.getModel();
  Object source=child.getModel();
  Object afterObj=after == null ? null : after.getModel();
  Object childParent=child.getParent().getModel();
  if (parentObj instanceof CrosstabCellAdapter && childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    CrosstabCellAdapter parentAdapter=(CrosstabCellAdapter)parentObj;
    if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE) && (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(parentAdapter.getPositionType()) || ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE.equals(parentAdapter.getPositionType()))) {
      if (afterObj != parentAdapter.getFirstDataItem()) {
        afterObj=null;
      }
      return new ChangeAreaCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
    }
 else     if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_MEASURE) && ICrosstabCellAdapterFactory.CELL_MEASURE.equals(parentAdapter.getPositionType())) {
      if (afterObj != parentAdapter.getFirstDataItem()) {
        afterObj=null;
      }
      return new ChangeMeasureOrderCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
    }
  }
  if (childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE) || isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_MEASURE)) {
      return UnexecutableCommand.INSTANCE;
    }
  }
  return new CrosstabPasterCommand((DesignElementHandle)DNDUtil.unwrapToModel(source),(DesignElementHandle)DNDUtil.unwrapToModel(parentObj),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
}

Fixed version (ground truth):
protected Command createAddCommand(EditPart parent,EditPart child,EditPart after){
  Object parentObj=parent.getModel();
  Object source=child.getModel();
  Object afterObj=after == null ? null : after.getModel();
  Object childParent=child.getParent().getModel();
  if (parentObj instanceof CrosstabCellAdapter && childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    CrosstabCellAdapter parentAdapter=(CrosstabCellAdapter)parentObj;
    if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE) && (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(parentAdapter.getPositionType()) || ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE.equals(parentAdapter.getPositionType()))) {
      if (afterObj != parentAdapter.getFirstDataItem()) {
        afterObj=null;
      }
      if (childAdapter.getCrosstabCellHandle().getCrosstab() == parentAdapter.getCrosstabCellHandle().getCrosstab()) {
        return new ChangeAreaCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
      }
 else {
        return UnexecutableCommand.INSTANCE;
      }
    }
 else     if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_MEASURE) && ICrosstabCellAdapterFactory.CELL_MEASURE.equals(parentAdapter.getPositionType())) {
      if (afterObj != parentAdapter.getFirstDataItem()) {
        afterObj=null;
      }
      if (childAdapter.getCrosstabCellHandle().getCrosstab() == parentAdapter.getCrosstabCellHandle().getCrosstab()) {
        return new ChangeMeasureOrderCommand(parentAdapter.getDesignElementHandle(),childAdapter.getDesignElementHandle(),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
      }
 else {
        return UnexecutableCommand.INSTANCE;
      }
    }
  }
  if (childParent instanceof CrosstabCellAdapter) {
    CrosstabCellAdapter childAdapter=(CrosstabCellAdapter)childParent;
    if (isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE) || isFirstDataItem(childAdapter,child.getModel(),ICrosstabCellAdapterFactory.CELL_MEASURE)) {
      return UnexecutableCommand.INSTANCE;
    }
  }
  return new CrosstabPasterCommand((DesignElementHandle)DNDUtil.unwrapToModel(source),(DesignElementHandle)DNDUtil.unwrapToModel(parentObj),(DesignElementHandle)DNDUtil.unwrapToModel(afterObj));
}