Program: 65236
Project: 65236
Buggy source:
public Object load(){
  ReportItemHandle element=getReportItemHandle();
  int type=element.getDataBindingType();
  List referenceList=getAvailableDataBindingReferenceList(element);
  String[] references=new String[referenceList.size() + 1];
  references[0]=NONE;
  for (int i=0; i < referenceList.size(); i++) {
    references[i + 1]=((ReportItemHandle)referenceList.get(i)).getQualifiedName();
  }
  setReferences(references);
  Object value;
switch (type) {
case ReportItemHandle.DATABINDING_TYPE_DATA:
    DataSetHandle dataset=ChartReportItemHelper.instance().getBindingDataSetHandle(element);
  CubeHandle cube=ChartReportItemHelper.instance().getBindingCubeHandle(element);
if (dataset == null && cube == null) value=NONE;
 else if (dataset != null) value=dataset.getQualifiedName();
 else value=cube.getName();
break;
case ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF:
ReportItemHandle reference=element.getDataBindingReference();
if (reference == null) value=NONE;
 else value=reference.getQualifiedName();
break;
default :
value=NONE;
}
BindingInfo info=new BindingInfo(type,value);
if (ChartReportItemUtil.isChildOfMultiViewsHandle(getReportItemHandle())) {
Object name=element.getContainer().getContainer().getQualifiedName();
info.setBindingType(ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF);
name=(name == null) ? NONE : name;
info.setBindingValue(name);
info.setReadOnly(true);
}
if (ChartCubeUtil.isPlotChart(element) || ChartCubeUtil.isAxisChart(element)) {
info.setBindingType(ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF);
info.setReadOnly(true);
}
return info;
}

Fixed version (ground truth):
public Object load(){
  ReportItemHandle element=getReportItemHandle();
  boolean isNotDataModel=false;
  ;
  int type=element.getDataBindingType();
  List referenceList=getAvailableDataBindingReferenceList(element);
  String[] references=new String[referenceList.size() + 1];
  references[0]=NONE;
  for (int i=0; i < referenceList.size(); i++) {
    references[i + 1]=((ReportItemHandle)referenceList.get(i)).getQualifiedName();
  }
  setReferences(references);
  String value;
switch (type) {
case ReportItemHandle.DATABINDING_TYPE_DATA:
    DataSetHandle dataset=ChartReportItemHelper.instance().getBindingDataSetHandle(element);
  CubeHandle cube=ChartReportItemHelper.instance().getBindingCubeHandle(element);
if (dataset == null && cube == null) {
  value=NullDatasetChoice.getBindingValue();
  isNotDataModel=true;
}
 else if (dataset != null) {
  List datasets=element.getModuleHandle().getAllDataSets();
  if (datasets != null) {
    for (int i=0; i < datasets.size(); i++) {
      if (datasets.get(i) == dataset) {
        isNotDataModel=true;
        break;
      }
    }
  }
  value=dataset.getQualifiedName();
}
 else {
  List cubes=element.getModuleHandle().getAllCubes();
  if (cubes != null) {
    for (int i=0; i < cubes.size(); i++) {
      if (cubes.get(i) == cube) {
        isNotDataModel=true;
        break;
      }
    }
  }
  value=cube.getName();
}
break;
case ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF:
ReportItemHandle reference=element.getDataBindingReference();
if (reference == null) value=NONE;
 else value=reference.getQualifiedName();
break;
default :
{
value=NullDatasetChoice.getBindingValue();
isNotDataModel=true;
}
}
BindingInfo info=new BindingInfo(type,value,isNotDataModel);
if (ChartReportItemUtil.isChildOfMultiViewsHandle(getReportItemHandle())) {
String name=element.getContainer().getContainer().getQualifiedName();
info.setBindingType(ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF);
name=(name == null) ? NONE : name;
info.setBindingValue(name);
info.setReadOnly(true);
}
if (ChartCubeUtil.isPlotChart(element) || ChartCubeUtil.isAxisChart(element)) {
info.setBindingType(ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF);
info.setReadOnly(true);
}
return info;
}