Program: 73024
Project: 73024
Buggy source:
public CompatibilityStatus checkCompatibility(){
  if (getCrosstab().compStatus < 0) {
    ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
    Map illegalContents=exhandle.getIllegalContents();
    if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
      List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
      if (detailInfoList.size() > 0) {
        IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
        ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
        if (oldDetail != null) {
          CompatibilityStatus status=new CompatibilityStatus();
          try {
            status.setStatusType(CompatibilityStatus.CONVERT_COMPATIBILITY_TYPE);
            ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
            handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
            List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
            for (int i=0; i < contents.size(); i++) {
              ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
            }
          }
 catch (          SemanticException e) {
            List errorList=new ArrayList(1);
            errorList.add(e);
            status.setErrors(errorList);
          }
          return status;
        }
      }
    }
  }
  return COMP_OK_STATUS;
}

Fixed version (ground truth):
public CompatibilityStatus checkCompatibility(){
  CrosstabReportItemHandle crosstab=getCrosstab();
  if (crosstab.compStatus < 0) {
    ExtendedItemHandle exhandle=(ExtendedItemHandle)getModelHandle();
    Map illegalContents=exhandle.getIllegalContents();
    if (illegalContents.containsKey(IMeasureViewConstants.DETAIL_PROP)) {
      List detailInfoList=(List)illegalContents.get(IMeasureViewConstants.DETAIL_PROP);
      if (detailInfoList.size() > 0) {
        IllegalContentInfo detailInfo=(IllegalContentInfo)detailInfoList.get(0);
        ExtendedItemHandle oldDetail=(ExtendedItemHandle)detailInfo.getContent();
        if (oldDetail != null) {
          CompatibilityStatus status=new CompatibilityStatus();
          try {
            status.setStatusType(CompatibilityStatus.CONVERT_COMPATIBILITY_TYPE);
            ExtendedItemHandle newDetail=CrosstabExtendedItemFactory.createAggregationCell(getModuleHandle());
            handle.getPropertyHandle(DETAIL_PROP).setValue(newDetail);
            LevelHandle rowLevel=getInnerestLevel(crosstab,ROW_AXIS_TYPE);
            LevelHandle columnLevel=getInnerestLevel(crosstab,COLUMN_AXIS_TYPE);
            if (rowLevel != null) {
              newDetail.setProperty(IAggregationCellConstants.AGGREGATION_ON_ROW_PROP,rowLevel);
            }
            if (columnLevel != null) {
              newDetail.setProperty(IAggregationCellConstants.AGGREGATION_ON_COLUMN_PROP,columnLevel);
            }
            List contents=oldDetail.getContents(ICrosstabCellConstants.CONTENT_PROP);
            for (int i=0; i < contents.size(); i++) {
              ((DesignElementHandle)contents.get(i)).moveTo(newDetail,IAggregationCellConstants.CONTENT_PROP);
            }
          }
 catch (          SemanticException e) {
            List errorList=new ArrayList(1);
            errorList.add(e);
            status.setErrors(errorList);
          }
          return status;
        }
      }
    }
  }
  return COMP_OK_STATUS;
}