Program: 70047
Project: 70047
Buggy source:
private List getSelectedValueList(){
  if (needRefreshList == false) {
    return selValueList;
  }
  CubeHandle cube=null;
  CrosstabReportItemHandle crosstab=null;
  if (designHandle instanceof ExtendedItemHandle) {
    try {
      Object obj=((ExtendedItemHandle)designHandle).getReportItem();
      if (obj instanceof CrosstabReportItemHandle) {
        crosstab=(CrosstabReportItemHandle)obj;
      }
      crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)designHandle).getReportItem();
      cube=crosstab.getCube();
    }
 catch (    ExtendedElementException e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (cube == null || (!(cube instanceof TabularCubeHandle)) || expressionCombo.getText().length() == 0) {
    return new ArrayList();
  }
  Iterator iter=null;
  ICubeQueryDefinition cubeQueryDefn=null;
  DataRequestSession session=null;
  try {
    session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    cubeQueryDefn=CrosstabUIHelper.createBindingQuery(crosstab);
    iter=session.getCubeQueryUtil().getMemberValueIterator((TabularCubeHandle)cube,expressionCombo.getText(),cubeQueryDefn);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
 finally {
    if (session != null) {
      session.shutdown();
    }
  }
  selValueList=new ArrayList();
  int count=0;
  int MAX_COUNT=PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault(),UIUtil.getCurrentProject()).getInt(CrosstabPlugin.PREFERENCE_FILTER_LIMIT);
  while (iter != null && iter.hasNext()) {
    Object obj=iter.next();
    if (obj != null) {
      if (selValueList.indexOf(obj) < 0) {
        selValueList.add(obj);
        if (++count >= MAX_COUNT) {
          break;
        }
      }
    }
  }
  needRefreshList=false;
  return selValueList;
}

Fixed version (ground truth):
private List getSelectedValueList(){
  if (needRefreshList == false) {
    return selValueList;
  }
  CubeHandle cube=null;
  CrosstabReportItemHandle crosstab=null;
  if (designHandle instanceof ExtendedItemHandle) {
    try {
      Object obj=((ExtendedItemHandle)designHandle).getReportItem();
      if (obj instanceof CrosstabReportItemHandle) {
        crosstab=(CrosstabReportItemHandle)obj;
      }
      crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)designHandle).getReportItem();
      cube=crosstab.getCube();
    }
 catch (    ExtendedElementException e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  if (cube == null || (!(cube instanceof TabularCubeHandle)) || expressionCombo.getText().length() == 0) {
    return new ArrayList();
  }
  Iterator iter=null;
  ICubeQueryDefinition cubeQueryDefn=null;
  DataRequestSession session=null;
  try {
    session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    cubeQueryDefn=CrosstabUIHelper.createBindingQuery(crosstab);
    iter=session.getCubeQueryUtil().getMemberValueIterator((TabularCubeHandle)cube,expressionCombo.getText(),cubeQueryDefn);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
  selValueList=new ArrayList();
  int count=0;
  int MAX_COUNT=PreferenceFactory.getInstance().getPreferences(CrosstabPlugin.getDefault(),UIUtil.getCurrentProject()).getInt(CrosstabPlugin.PREFERENCE_FILTER_LIMIT);
  while (iter != null && iter.hasNext()) {
    Object obj=iter.next();
    if (obj != null) {
      if (selValueList.indexOf(obj) < 0) {
        selValueList.add(obj);
        if (++count >= MAX_COUNT) {
          break;
        }
      }
    }
  }
  needRefreshList=false;
  if (session != null) {
    session.shutdown();
  }
  return selValueList;
}