Program: 68097
Project: 68097
Buggy source:
/** 
 * Inserts a level handle into a dimension view. This method will add the aggregations and data-item automatically.
 * @param dimensionView
 * @param levelHandle
 * @param index
 * @return
 * @throws SemanticException
 */
public LevelViewHandle insertLevel(LevelHandle levelHandle,int index) throws SemanticException {
  if (levelHandle != null) {
    if (!levelHandle.getContainer().getContainer().getQualifiedName().equals(dimensionView.getCubeDimensionName())) {
      dimensionView.getLogger().log(Level.WARNING,"String_Node_Str");
      return null;
    }
    if (dimensionView.getLevel(levelHandle.getQualifiedName()) != null) {
      dimensionView.getLogger().log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_LEVEL,levelHandle.getQualifiedName());
      throw new CrosstabException(dimensionView.getModelHandle().getElement(),new String[]{levelHandle.getQualifiedName(),dimensionView.getModelHandle().getElement().getIdentifier()},MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_LEVEL);
    }
  }
  CommandStack stack=dimensionView.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  LevelViewHandle levelView=null;
  try {
    ExtendedItemHandle extendedItemHandle=CrosstabExtendedItemFactory.createLevelView(dimensionView.getModuleHandle(),levelHandle);
    if (extendedItemHandle != null) {
      dimensionView.getLevelsProperty().add(extendedItemHandle,index);
      levelView=(LevelViewHandle)CrosstabUtil.getReportItem(extendedItemHandle,LEVEL_VIEW_EXTENSION_NAME);
      if (levelHandle != null && crosstab != null) {
        doPostInsert(levelView);
      }
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return levelView;
}

Fixed version (ground truth):
/** 
 * Inserts a level handle into a dimension view. This method will add the aggregations and data-item automatically.
 * @param dimensionView
 * @param levelHandle
 * @param index
 * @return
 * @throws SemanticException
 */
public LevelViewHandle insertLevel(LevelHandle levelHandle,int index) throws SemanticException {
  if (levelHandle != null) {
    if (!levelHandle.getContainer().getContainer().getQualifiedName().equals(dimensionView.getCubeDimensionName())) {
      dimensionView.getLogger().log(Level.WARNING,"String_Node_Str");
      return null;
    }
    if (dimensionView.getLevel(levelHandle.getQualifiedName()) != null) {
      dimensionView.getLogger().log(Level.SEVERE,MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_LEVEL,levelHandle.getQualifiedName());
      throw new CrosstabException(dimensionView.getModelHandle().getElement(),Messages.getString(MessageConstants.CROSSTAB_EXCEPTION_DUPLICATE_LEVEL,levelHandle.getQualifiedName()));
    }
  }
  CommandStack stack=dimensionView.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  LevelViewHandle levelView=null;
  try {
    ExtendedItemHandle extendedItemHandle=CrosstabExtendedItemFactory.createLevelView(dimensionView.getModuleHandle(),levelHandle);
    if (extendedItemHandle != null) {
      dimensionView.getLevelsProperty().add(extendedItemHandle,index);
      levelView=(LevelViewHandle)CrosstabUtil.getReportItem(extendedItemHandle,LEVEL_VIEW_EXTENSION_NAME);
      if (levelHandle != null && crosstab != null) {
        doPostInsert(levelView);
      }
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
  return levelView;
}