Program: 69109
Project: 69109
Buggy source:
/** 
 * @param measureList
 * @param functionList
 * @param levelView
 * @return
 * @throws SemanticException
 */
CrosstabCellHandle addSubTotal(List<MeasureViewHandle> measureList,List<String> functionList,boolean needTransaction) throws SemanticException {
  if (focus == null || !isValidParameters(functionList,measureList))   return null;
  verifyTotalMeasureFunctions(focus.getAxisType(),functionList,measureList);
  if (focus.isInnerMost()) {
    focus.getLogger().log(Level.WARNING,"String_Node_Str" + focus.getModelHandle().getName() + "String_Node_Str");
    return null;
  }
  if (focus.getAggregationHeader() != null) {
    focus.getLogger().log(Level.INFO,"String_Node_Str");
  }
  CommandStack stack=null;
  if (needTransaction) {
    stack=focus.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
  }
  try {
    if (focus.getAggregationHeader() == null)     focus.getAggregationHeaderProperty().add(CrosstabExtendedItemFactory.createCrosstabCell(focus.getModuleHandle()));
    if (crosstab != null && measureList != null) {
      boolean isVerticalMeasure=MEASURE_DIRECTION_VERTICAL.equals(crosstab.getMeasureDirection());
      boolean needCheckCounterAxis=((isVerticalMeasure && focus.getAxisType() == COLUMN_AXIS_TYPE) || (!isVerticalMeasure && focus.getAxisType() == ROW_AXIS_TYPE));
      addMeasureAggregations(focus,measureList,functionList,needCheckCounterAxis);
      addTotalMeasureHeader(focus.getAxisType(),focus,measureList);
    }
    validateCrosstab();
  }
 catch (  SemanticException e) {
    focus.getLogger().log(Level.WARNING,e.getMessage(),e);
    if (needTransaction) {
      stack.rollback();
    }
    throw e;
  }
  if (needTransaction) {
    stack.commit();
  }
  return focus.getAggregationHeader();
}

Fixed version (ground truth):
/** 
 * @param measureList
 * @param functionList
 * @param levelView
 * @return
 * @throws SemanticException
 */
CrosstabCellHandle addSubTotal(List<MeasureViewHandle> measureList,List<String> functionList,boolean needTransaction) throws SemanticException {
  if (focus == null || !isValidParameters(functionList,measureList))   return null;
  verifyTotalMeasureFunctions(focus.getAxisType(),functionList,measureList);
  if (focus.isInnerMost()) {
    focus.getLogger().log(Level.WARNING,"String_Node_Str" + focus.getModelHandle().getName() + "String_Node_Str");
    return null;
  }
  if (focus.getAggregationHeader() != null) {
    focus.getLogger().log(Level.INFO,"String_Node_Str");
  }
  CommandStack stack=null;
  if (needTransaction) {
    stack=focus.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
  }
  try {
    if (focus.getAggregationHeader() == null)     focus.getAggregationHeaderProperty().add(CrosstabExtendedItemFactory.createCrosstabCell(focus.getModuleHandle()));
    if (crosstab != null && measureList != null) {
      boolean isVerticalMeasure=MEASURE_DIRECTION_VERTICAL.equals(crosstab.getMeasureDirection());
      boolean needCheckCounterAxis=((isVerticalMeasure && focus.getAxisType() == COLUMN_AXIS_TYPE) || (!isVerticalMeasure && focus.getAxisType() == ROW_AXIS_TYPE));
      addMeasureAggregations(focus,measureList,functionList,needCheckCounterAxis);
      addTotalMeasureHeader(focus.getAxisType(),focus,measureList);
    }
    validateCrosstab();
    if (measureList != null && functionList != null) {
      for (int i=0; i < measureList.size(); i++) {
        MeasureViewHandle mv=measureList.get(i);
        String func=functionList.get(i);
        setAggregationFunction(mv,func);
      }
    }
  }
 catch (  SemanticException e) {
    focus.getLogger().log(Level.WARNING,e.getMessage(),e);
    if (needTransaction) {
      stack.rollback();
    }
    throw e;
  }
  if (needTransaction) {
    stack.commit();
  }
  return focus.getAggregationHeader();
}