Program: 69786
Project: 69786
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) {
      addMeasureAggregations(focus,measureList,functionList,false);
      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();
  }
 catch (  SemanticException e) {
    focus.getLogger().log(Level.WARNING,e.getMessage(),e);
    if (needTransaction) {
      stack.rollback();
    }
    throw e;
  }
  if (needTransaction) {
    stack.commit();
  }
  return focus.getAggregationHeader();
}