Program: 71139
Project: 71139
Buggy source:
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;
}

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);
            for (Iterator itr=oldDetail.getPropertyIterator(); itr.hasNext(); ) {
              PropertyHandle propHandle=(PropertyHandle)itr.next();
              String propName=propHandle.getPropertyDefn().getName();
              if (!propHandle.isLocal() || IDesignElementModel.NAME_PROP.equals(propName) || IDesignElementModel.EXTENDS_PROP.equals(propName)|| IExtendedItemModel.EXTENSION_NAME_PROP.equals(propName)|| IExtendedItemModel.EXTENSION_VERSION_PROP.equals(propName)|| ICrosstabCellConstants.CONTENT_PROP.equals(propName)) {
                continue;
              }
              try {
                oldDetail.copyPropertyTo(propName,newDetail);
              }
 catch (              Exception e) {
                logger.log(Level.WARNING,"String_Node_Str" + propName + "String_Node_Str");
              }
            }
            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;
}