Program: 71445
Project: 71445
Buggy source:
private boolean processor(List list,List result,boolean doChange) throws SemanticException {
  initializeProviders();
  boolean isRemove=false;
  List temp=new ArrayList(result);
  for (int i=0; i < result.size(); i++) {
    MeasureInfo resultOne=(MeasureInfo)result.get(i);
    MeasureInfo originalOne=getOriMeasureInfo(resultOne,list);
    if (resultOne.isShow() == originalOne.isShow()) {
      MeasureInfo info=(MeasureInfo)result.get(i);
      if (info.isShow() == true && info.getExpectedView() != null && info.getExpectedView().length() != 0) {
        SwitchCellInfo swtichCellInfo=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
        swtichCellInfo.setMeasureInfo(info);
        swtichCellInfo.setIsNew(false);
        providerWrapper.addSwitchInfo(swtichCellInfo);
        needUpdateView=true;
      }
      temp.remove(resultOne);
    }
  }
  CrosstabReportItemHandle reportHandle=measureViewHandle.getCrosstab();
  for (int i=0; i < temp.size(); i++) {
    MeasureInfo info=(MeasureInfo)temp.get(i);
    if (info.isShow()) {
      MeasureHandle measure=reportHandle.getCube().getMeasure(info.getMeasureName());
      MeasureViewHandle measureViewHandle=reportHandle.insertMeasure(measure,reportHandle.getMeasureCount());
      measureViewHandle.addHeader();
      LabelHandle labelHandle=DesignElementFactory.getInstance().newLabel(null);
      labelHandle.setText(info.getMeasureDisplayName());
      needUpdateView=true;
      measureViewHandle.getHeader().addContent(labelHandle);
      if (info.getExpectedView() != null && info.getExpectedView().length() != 0) {
        SwitchCellInfo swtichCellInfo=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
        info.setMeasureName(measureViewHandle.getCubeMeasure().getQualifiedName());
        swtichCellInfo.setMeasureInfo(info);
        swtichCellInfo.setIsNew(true);
        providerWrapper.addSwitchInfo(swtichCellInfo);
      }
    }
 else {
      if (doChange) {
        reportHandle.removeMeasure(info.getMeasureName());
      }
      isRemove=true;
      needUpdateView=true;
    }
  }
  return isRemove;
}

Fixed version (ground truth):
private boolean processor(List list,List result,boolean doChange) throws SemanticException {
  initializeProviders();
  boolean isRemove=false;
  List temp=new ArrayList(result);
  for (int i=0; i < result.size(); i++) {
    MeasureInfo resultOne=(MeasureInfo)result.get(i);
    MeasureInfo originalOne=getOriMeasureInfo(resultOne,list);
    if (resultOne.isShow() == originalOne.isShow()) {
      MeasureInfo info=(MeasureInfo)result.get(i);
      if (info.isShow() == true && info.getExpectedView() != null && info.getExpectedView().length() != 0) {
        SwitchCellInfo swtichCellInfo=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
        swtichCellInfo.setMeasureInfo(info);
        swtichCellInfo.setIsNew(false);
        providerWrapper.addSwitchInfo(swtichCellInfo);
        needUpdateView=true;
      }
      temp.remove(resultOne);
    }
  }
  CrosstabReportItemHandle reportHandle=measureViewHandle.getCrosstab();
  for (int i=0; i < temp.size(); i++) {
    MeasureInfo info=(MeasureInfo)temp.get(i);
    if (info.isShow()) {
      if (!doChange) {
        continue;
      }
      MeasureHandle measure=reportHandle.getCube().getMeasure(info.getMeasureName());
      MeasureViewHandle measureViewHandle=reportHandle.insertMeasure(measure,reportHandle.getMeasureCount());
      measureViewHandle.addHeader();
      LabelHandle labelHandle=DesignElementFactory.getInstance().newLabel(null);
      labelHandle.setText(info.getMeasureDisplayName());
      needUpdateView=true;
      measureViewHandle.getHeader().addContent(labelHandle);
      if (info.getExpectedView() != null && info.getExpectedView().length() != 0) {
        SwitchCellInfo swtichCellInfo=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
        info.setMeasureName(measureViewHandle.getCubeMeasure().getQualifiedName());
        swtichCellInfo.setMeasureInfo(info);
        swtichCellInfo.setIsNew(true);
        providerWrapper.addSwitchInfo(swtichCellInfo);
      }
    }
 else {
      if (doChange) {
        reportHandle.removeMeasure(info.getMeasureName());
      }
      isRemove=true;
      needUpdateView=true;
    }
  }
  return isRemove;
}