Program: 66925
Project: 66925
Buggy source:
protected void filterTargetChanged(){
  needRefreshList=true;
  String targetString=null;
  if (groupBtn.getSelection()) {
    if (groupLevelList != null && groupLevelList.size() > 0 && groupGroupLevel.indexOf(groupGroupLevel.getText()) > 0 && groupGroupLevel.indexOf(groupGroupLevel.getText()) <= groupLevelList.size()) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
      LevelViewHandle level=(LevelViewHandle)groupLevelList.get(groupGroupLevel.indexOf(groupGroupLevel.getText()) - 1);
      DimensionHandle dimensionHandle=CrosstabAdaptUtil.getDimensionHandle(level.getCubeLevel());
      targetString=ExpressionUtil.createJSDimensionExpression(dimensionHandle.getName(),level.getCubeLevel().getName());
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
      updateMemberValues();
      updateButtons();
      return;
    }
  }
 else   if (measureBtn.getSelection()) {
    if (measureList != null && measureList.size() > 0 && measureGroupLevel.indexOf(measureGroupLevel.getText()) > 0 && measureGroupLevel.indexOf(measureGroupLevel.getText()) <= measureList.size()) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
      MeasureViewHandle measure=(MeasureViewHandle)measureList.get(measureGroupLevel.indexOf(measureGroupLevel.getText()) - 1);
      targetString=measure.getCubeMeasure().getName();
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
      updateMemberValues();
      updateButtons();
      return;
    }
  }
 else   if (detailBtn.getSelection()) {
    if (cubeLevelNameList != null && cubeLevelNameList.size() > 0) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
    }
    updateMemberValues();
    updateButtons();
    return;
  }
  if (targetString != null) {
    ExtendedItemHandle element=(ExtendedItemHandle)designHandle;
    CrosstabReportItemHandle crosstab=null;
    try {
      crosstab=(CrosstabReportItemHandle)element.getReportItem();
    }
 catch (    ExtendedElementException ex) {
      ExceptionUtil.handle(ex);
    }
    ICubeQueryDefinition cubeQueryDefn=null;
    DataRequestSession session=null;
    try {
      session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
      cubeQueryDefn=CrosstabUIHelper.createBindingQuery(crosstab);
      List retList=null;
      if (groupBtn.getSelection()) {
        retList=session.getCubeQueryUtil().getReferableBindings(targetString,cubeQueryDefn,false);
      }
 else       if (measureBtn.getSelection()) {
        retList=session.getCubeQueryUtil().getReferableMeasureBindings(targetString,cubeQueryDefn);
      }
      if (retList.size() > 0) {
        IBindingMetaInfo meta=(IBindingMetaInfo)retList.get(0);
        IExpressionConverter converter=ExpressionButtonUtil.getCurrentExpressionConverter(expressionCCombo);
        expressionCCombo.setText(converter.getCubeBindingExpression(meta.getBindingName()));
      }
    }
 catch (    Exception ex) {
      logger.log(Level.SEVERE,ex.getMessage(),ex);
    }
 finally {
      if (session != null) {
        session.shutdown();
      }
    }
  }
  updateMemberValues();
  updateButtons();
}

Fixed version (ground truth):
protected void filterTargetChanged(){
  needRefreshList=true;
  String targetString=null;
  if (groupBtn.getSelection()) {
    if (groupLevelList != null && groupLevelList.size() > 0 && groupGroupLevel.indexOf(groupGroupLevel.getText()) > 0 && groupGroupLevel.indexOf(groupGroupLevel.getText()) <= groupLevelList.size()) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
      LevelViewHandle level=(LevelViewHandle)groupLevelList.get(groupGroupLevel.indexOf(groupGroupLevel.getText()) - 1);
      DimensionHandle dimensionHandle=CrosstabAdaptUtil.getDimensionHandle(level.getCubeLevel());
      targetString=ExpressionUtil.createJSDimensionExpression(dimensionHandle.getName(),level.getCubeLevel().getName());
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
      updateMemberValues();
      updateButtons();
      return;
    }
  }
 else   if (measureBtn.getSelection()) {
    if (measureList != null && measureList.size() > 0 && measureGroupLevel.indexOf(measureGroupLevel.getText()) > 0 && measureGroupLevel.indexOf(measureGroupLevel.getText()) <= measureList.size()) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
      MeasureViewHandle measure=(MeasureViewHandle)measureList.get(measureGroupLevel.indexOf(measureGroupLevel.getText()) - 1);
      targetString=measure.getCubeMeasure().getName();
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
      updateMemberValues();
      updateButtons();
      return;
    }
  }
 else   if (detailBtn.getSelection()) {
    if (cubeLevelNameList != null && cubeLevelNameList.size() > 0) {
      expressionCCombo.setEnabled(true);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(true);
    }
 else {
      expressionCCombo.setEnabled(false);
      ExpressionButtonUtil.getExpressionButton(expressionCCombo).setEnabled(false);
    }
    updateMemberValues();
    updateButtons();
    return;
  }
  if (targetString != null) {
    ExtendedItemHandle element=(ExtendedItemHandle)designHandle;
    CrosstabReportItemHandle crosstab=null;
    try {
      crosstab=(CrosstabReportItemHandle)element.getReportItem();
    }
 catch (    ExtendedElementException ex) {
      ExceptionUtil.handle(ex);
    }
    ICubeQueryDefinition cubeQueryDefn=null;
    DataRequestSession session=null;
    try {
      session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
      cubeQueryDefn=CrosstabUIHelper.createBindingQuery(crosstab);
      List retList=null;
      if (groupBtn.getSelection()) {
        retList=session.getCubeQueryUtil().getReferableBindings(targetString,cubeQueryDefn,false);
      }
 else       if (measureBtn.getSelection()) {
        retList=session.getCubeQueryUtil().getReferableMeasureBindings(targetString,cubeQueryDefn);
      }
      if (retList != null && retList.size() > 0) {
        IBindingMetaInfo meta=(IBindingMetaInfo)retList.get(0);
        IExpressionConverter converter=ExpressionButtonUtil.getCurrentExpressionConverter(expressionCCombo);
        expressionCCombo.setText(converter.getCubeBindingExpression(meta.getBindingName()));
      }
    }
 catch (    Exception ex) {
      logger.log(Level.SEVERE,ex.getMessage(),ex);
    }
 finally {
      if (session != null) {
        session.shutdown();
      }
    }
  }
  updateMemberValues();
  updateButtons();
}