Program: 72337
Project: 72337
Buggy source:
private boolean checkTransposed(AggregationCellHandle cell){
  if (ChartXTabUtil.isDetailCell(cell)) {
    if (cell.getAggregationOnColumn() == null) {
      return true;
    }
    MeasureViewHandle mv=(MeasureViewHandle)cell.getContainer();
    for (int i=0; i < mv.getAggregationCount(); i++) {
      AggregationCellHandle otherCell=mv.getAggregationCell(i);
      if (cell.getDimensionView(ICrosstabConstants.ROW_AXIS_TYPE) == otherCell.getDimensionView(ICrosstabConstants.ROW_AXIS_TYPE) && cell.getLevelView(ICrosstabConstants.ROW_AXIS_TYPE) == otherCell.getLevelView(ICrosstabConstants.ROW_AXIS_TYPE)) {
        Object content=ChartXTabUtil.getFirstContent(otherCell);
        if (ChartXTabUtil.isPlotChart((DesignElementHandle)content)) {
          return true;
        }
      }
    }
    Object content=ChartXTabUtil.getFirstContent(cell);
    if (ChartXTabUtil.isPlotChart((DesignElementHandle)content)) {
      return ((ChartWithAxes)ChartXTabUtil.getChartFromHandle((ExtendedItemHandle)content)).isTransposed();
    }
  }
  if (ChartXTabUtil.isAggregationCell(cell)) {
    LevelHandle levelRow=cell.getAggregationOnRow();
    LevelHandle levelColumn=cell.getAggregationOnColumn();
    if (levelRow != null && levelColumn == null) {
      return true;
    }
    if (levelRow == null && levelColumn != null) {
      return false;
    }
    if (levelRow != null && levelColumn != null) {
      return isInSubtotal(cell,ICrosstabConstants.COLUMN_AXIS_TYPE);
    }
    return false;
  }
  List<ExtendedItemHandle> chartInOtherMeasure=ChartXTabUIUtil.findChartInOtherMeasures(cell,true);
  if (!chartInOtherMeasure.isEmpty()) {
    return ((ChartWithAxes)ChartXTabUtil.getChartFromHandle(chartInOtherMeasure.get(0))).isTransposed();
  }
  return cell.getCrosstab().getMeasureDirection().equals(ICrosstabConstants.MEASURE_DIRECTION_HORIZONTAL);
}

Fixed version (ground truth):
private boolean checkTransposed(AggregationCellHandle cell){
  if (ChartXTabUtil.isDetailCell(cell)) {
    if (cell.getAggregationOnColumn() == null) {
      return true;
    }
    if (cell.getAggregationOnRow() == null) {
      return false;
    }
    MeasureViewHandle mv=(MeasureViewHandle)cell.getContainer();
    for (int i=0; i < mv.getAggregationCount(); i++) {
      AggregationCellHandle otherCell=mv.getAggregationCell(i);
      if (cell.getDimensionView(ICrosstabConstants.ROW_AXIS_TYPE) == otherCell.getDimensionView(ICrosstabConstants.ROW_AXIS_TYPE) && cell.getLevelView(ICrosstabConstants.ROW_AXIS_TYPE) == otherCell.getLevelView(ICrosstabConstants.ROW_AXIS_TYPE)) {
        Object content=ChartXTabUtil.getFirstContent(otherCell);
        if (ChartXTabUtil.isPlotChart((DesignElementHandle)content)) {
          return true;
        }
      }
    }
    Object content=ChartXTabUtil.getFirstContent(cell);
    if (ChartXTabUtil.isPlotChart((DesignElementHandle)content)) {
      return ((ChartWithAxes)ChartXTabUtil.getChartFromHandle((ExtendedItemHandle)content)).isTransposed();
    }
  }
  if (ChartXTabUtil.isAggregationCell(cell)) {
    LevelHandle levelRow=cell.getAggregationOnRow();
    LevelHandle levelColumn=cell.getAggregationOnColumn();
    if (levelRow != null && levelColumn == null) {
      return true;
    }
    if (levelRow == null && levelColumn != null) {
      return false;
    }
    if (levelRow != null && levelColumn != null) {
      return isInSubtotal(cell,ICrosstabConstants.COLUMN_AXIS_TYPE);
    }
    return false;
  }
  List<ExtendedItemHandle> chartInOtherMeasure=ChartXTabUIUtil.findChartInOtherMeasures(cell,true);
  if (!chartInOtherMeasure.isEmpty()) {
    return ((ChartWithAxes)ChartXTabUtil.getChartFromHandle(chartInOtherMeasure.get(0))).isTransposed();
  }
  return cell.getCrosstab().getMeasureDirection().equals(ICrosstabConstants.MEASURE_DIRECTION_HORIZONTAL);
}