Program: 71264
Project: 71264
Buggy source:
/** 
 * @param cwoa
 */
final SeriesQueries[] getSeriesQueryDefinitions(ChartWithoutAxes cwoa){
  final ArrayList alSeriesQueries=new ArrayList(4);
  EList elSD=cwoa.getSeriesDefinitions();
  if (elSD.size() != 1) {
    return (SeriesQueries[])alSeriesQueries.toArray(new SeriesQueries[alSeriesQueries.size()]);
  }
  SeriesDefinition sd=(SeriesDefinition)elSD.get(0);
  final Series seBase=sd.getDesignTimeSeries();
  EList elBaseSeries=seBase.getDataDefinition();
  int[] bDataIndex=getValidationIndex(seBase);
  Query[] qua=new Query[bDataIndex.length];
  SeriesQueries sqd=new SeriesQueries(BASE_SERIES,qua);
  for (int i=0; i < bDataIndex.length; i++) {
    if (i < elBaseSeries.size()) {
      qua[i]=(Query)elBaseSeries.get(bDataIndex[i]);
    }
 else {
      qua[i]=QueryImpl.create("String_Node_Str");
    }
  }
  alSeriesQueries.add(sqd);
  Series seOrthogonal;
  EList elOrthogonalSeries;
  elSD=sd.getSeriesDefinitions();
  for (int k=0; k < elSD.size(); k++) {
    sd=(SeriesDefinition)elSD.get(k);
    seOrthogonal=sd.getDesignTimeSeries();
    elOrthogonalSeries=seOrthogonal.getDataDefinition();
    int[] oDataIndex=getValidationIndex(seOrthogonal);
    qua=new Query[oDataIndex.length];
    sqd=new SeriesQueries(ORTHOGONAL_SERIES,qua);
    for (int i=0; i < oDataIndex.length; i++) {
      if (oDataIndex[i] < elOrthogonalSeries.size()) {
        qua[i]=(Query)elOrthogonalSeries.get(oDataIndex[i]);
      }
 else {
        qua[i]=QueryImpl.create("String_Node_Str");
      }
    }
    alSeriesQueries.add(sqd);
  }
  return (SeriesQueries[])alSeriesQueries.toArray(new SeriesQueries[alSeriesQueries.size()]);
}

Fixed version (ground truth):
/** 
 * @param cwoa
 */
final SeriesQueries[] getSeriesQueryDefinitions(ChartWithoutAxes cwoa){
  final ArrayList<SeriesQueries> alSeriesQueries=new ArrayList<SeriesQueries>(4);
  EList elSD=cwoa.getSeriesDefinitions();
  if (elSD.size() != 1) {
    return alSeriesQueries.toArray(new SeriesQueries[alSeriesQueries.size()]);
  }
  SeriesDefinition sd=(SeriesDefinition)elSD.get(0);
  final Series seBase=sd.getDesignTimeSeries();
  EList elBaseSeries=seBase.getDataDefinition();
  int[] bDataIndex=getValidationIndex(seBase);
  Query[] qua=new Query[bDataIndex.length];
  SeriesQueries sqd=new SeriesQueries(BASE_SERIES,qua);
  for (int i=0; i < bDataIndex.length; i++) {
    if (i < elBaseSeries.size()) {
      qua[i]=(Query)elBaseSeries.get(bDataIndex[i]);
    }
 else {
      qua[i]=QueryImpl.create("String_Node_Str");
    }
  }
  alSeriesQueries.add(sqd);
  Series seOrthogonal;
  EList elOrthogonalSeries;
  elSD=sd.getSeriesDefinitions();
  for (int k=0; k < elSD.size(); k++) {
    sd=(SeriesDefinition)elSD.get(k);
    seOrthogonal=sd.getDesignTimeSeries();
    elOrthogonalSeries=seOrthogonal.getDataDefinition();
    int[] oDataIndex=getValidationIndex(seOrthogonal);
    qua=new Query[oDataIndex.length];
    sqd=new SeriesQueries(ORTHOGONAL_SERIES,qua);
    for (int i=0; i < oDataIndex.length; i++) {
      if (oDataIndex[i] < elOrthogonalSeries.size()) {
        qua[i]=(Query)elOrthogonalSeries.get(oDataIndex[i]);
      }
 else {
        qua[i]=QueryImpl.create("String_Node_Str");
      }
    }
    alSeriesQueries.add(sqd);
  }
  return alSeriesQueries.toArray(new SeriesQueries[alSeriesQueries.size()]);
}