Program: 78932
Project: 78932
Buggy source:
/** 
 * Locates a design-time series corresponding to a given cloned run-time series.
 * @param seRT
 * @return
 */
private final Series findDesignTimeSeries(Series seRT) throws ChartException {
  final ChartWithAxes cwaRT=(ChartWithAxes)_iun.getRunTimeModel();
  final ChartWithAxes cwaDT=(ChartWithAxes)_iun.getDesignTimeModel();
  Series seDT=null;
  Axis[] axaBase=cwaRT.getPrimaryBaseAxes();
  Axis axBase=axaBase[0];
  Axis[] axaOrthogonal=cwaRT.getOrthogonalAxes(axBase,true);
  EList elSD, elSE;
  SeriesDefinition sd;
  Series se=null;
  int i, j=0, k=0;
  boolean bFound=false;
  for (i=0; i < axaOrthogonal.length; i++) {
    elSD=axaOrthogonal[i].getSeriesDefinitions();
    for (j=0; j < elSD.size(); j++) {
      sd=(SeriesDefinition)elSD.get(j);
      elSE=sd.getSeries();
      for (k=0; k < elSE.size(); k++) {
        se=(Series)elSE.get(k);
        if (seRT == se) {
          bFound=true;
          break;
        }
      }
      if (bFound) {
        break;
      }
    }
    if (bFound) {
      break;
    }
  }
  if (!bFound) {
    throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.OUT_OF_SYNC,"String_Node_Str",new Object[]{seRT},ResourceBundle.getBundle(Messages.DEVICE_EXTENSION,getLocale()));
  }
  axaBase=cwaDT.getPrimaryBaseAxes();
  axBase=axaBase[0];
  axaOrthogonal=cwaDT.getOrthogonalAxes(axBase,true);
  elSD=axaOrthogonal[i].getSeriesDefinitions();
  sd=(SeriesDefinition)elSD.get(j);
  elSE=sd.getSeries();
  seDT=(Series)elSE.get(k);
  return seDT;
}

Fixed version (ground truth):
/** 
 * Locates a design-time series corresponding to a given cloned run-time series.
 * @param seRT
 * @return
 */
private final Series findDesignTimeSeries(Series seRT) throws ChartException {
  Series seDT=null;
  final Chart cmRT=_iun.getRunTimeModel();
  final Chart cmDT=_iun.getDesignTimeModel();
  if (cmDT instanceof ChartWithAxes) {
    final ChartWithAxes cwaRT=(ChartWithAxes)cmRT;
    final ChartWithAxes cwaDT=(ChartWithAxes)cmDT;
    Axis[] axaBase=cwaRT.getPrimaryBaseAxes();
    Axis axBase=axaBase[0];
    Axis[] axaOrthogonal=cwaRT.getOrthogonalAxes(axBase,true);
    EList elSD, elSE;
    SeriesDefinition sd;
    Series se=null;
    int i=-1, j=0, k=0;
    boolean bFound=false;
    elSD=axaBase[0].getSeriesDefinitions();
    for (j=0; j < elSD.size(); j++) {
      sd=(SeriesDefinition)elSD.get(j);
      elSE=sd.getSeries();
      for (k=0; k < elSE.size(); k++) {
        se=(Series)elSE.get(k);
        if (seRT == se) {
          bFound=true;
          break;
        }
      }
      if (bFound) {
        break;
      }
    }
    if (!bFound) {
      for (i=0; i < axaOrthogonal.length; i++) {
        elSD=axaOrthogonal[i].getSeriesDefinitions();
        for (j=0; j < elSD.size(); j++) {
          sd=(SeriesDefinition)elSD.get(j);
          elSE=sd.getSeries();
          for (k=0; k < elSE.size(); k++) {
            se=(Series)elSE.get(k);
            if (seRT == se) {
              bFound=true;
              break;
            }
          }
          if (bFound) {
            break;
          }
        }
        if (bFound) {
          break;
        }
      }
    }
    if (!bFound) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.OUT_OF_SYNC,"String_Node_Str",new Object[]{seRT},ResourceBundle.getBundle(Messages.DEVICE_EXTENSION,getLocale()));
    }
    axaBase=cwaDT.getPrimaryBaseAxes();
    axBase=axaBase[0];
    axaOrthogonal=cwaDT.getOrthogonalAxes(axBase,true);
    if (i == -1) {
      elSD=axaBase[0].getSeriesDefinitions();
    }
 else {
      elSD=axaOrthogonal[i].getSeriesDefinitions();
    }
    sd=(SeriesDefinition)elSD.get(j);
    elSE=sd.getSeries();
    seDT=(Series)elSE.get(k);
  }
 else   if (cmDT instanceof ChartWithoutAxes) {
    final ChartWithoutAxes cwoaRT=(ChartWithoutAxes)cmRT;
    final ChartWithoutAxes cwoaDT=(ChartWithoutAxes)cmDT;
    EList elSD, elSE;
    SeriesDefinition sd;
    Series se=null;
    int i=-1, j=0, k=0;
    boolean bFound=false;
    elSD=cwoaRT.getSeriesDefinitions();
    for (j=0; j < elSD.size(); j++) {
      sd=(SeriesDefinition)elSD.get(j);
      elSE=sd.getSeries();
      for (k=0; k < elSE.size(); k++) {
        se=(Series)elSE.get(k);
        if (seRT == se) {
          bFound=true;
          break;
        }
      }
      if (bFound) {
        break;
      }
    }
    if (!bFound) {
      i=1;
      elSD=((SeriesDefinition)cwoaRT.getSeriesDefinitions().get(0)).getSeriesDefinitions();
      for (j=0; j < elSD.size(); j++) {
        sd=(SeriesDefinition)elSD.get(j);
        elSE=sd.getSeries();
        for (k=0; k < elSE.size(); k++) {
          se=(Series)elSE.get(k);
          if (seRT == se) {
            bFound=true;
            break;
          }
        }
        if (bFound) {
          break;
        }
      }
    }
    if (!bFound) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.OUT_OF_SYNC,"String_Node_Str",new Object[]{seRT},ResourceBundle.getBundle(Messages.DEVICE_EXTENSION,getLocale()));
    }
    if (i == -1) {
      elSD=cwoaDT.getSeriesDefinitions();
    }
 else {
      elSD=((SeriesDefinition)cwoaDT.getSeriesDefinitions().get(0)).getSeriesDefinitions();
    }
    sd=(SeriesDefinition)elSD.get(j);
    elSE=sd.getSeries();
    seDT=(Series)elSE.get(k);
  }
  return seDT;
}