Program: 133507
Project: 133507
Buggy source:
/** 
 * This operation completely recreates the trace for the specified series and replaces the current trace with this one.
 * @param series The series to recreate the trace for
 */
private void redrawSeries(ISeries series){
  double[] xValues=getDoubleValue(independentSeries);
  double[] xPlusError=new double[xValues.length];
  double[] xMinusError=new double[xValues.length];
  if (seriesMap.containsKey(independentSeries)) {
    List<ISeries> errors=seriesMap.get(independentSeries);
    if (errors != null && errors.size() > 0) {
      for (      ISeries errSeries : errors) {
        BasicErrorStyle errStyle=(BasicErrorStyle)errSeries.getStyle();
        if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.PLUS)) {
          sumArrays(xPlusError,getDoubleValue(errSeries));
        }
 else         if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.MINUS)) {
          sumArrays(xMinusError,getDoubleValue(errSeries));
        }
 else         if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.BOTH)) {
          sumArrays(xPlusError,getDoubleValue(errSeries));
          sumArrays(xMinusError,getDoubleValue(errSeries));
        }
      }
    }
  }
  Trace trace=configureTrace(series,xValues,xPlusError,xMinusError);
  if (trace != null) {
    XYZSeriesStyle indepStyle=(XYZSeriesStyle)independentSeries.getStyle();
    trace.setXErrorBarType((ErrorBarType)indepStyle.getProperty(XYZSeriesStyle.ERROR_TYPE));
  }
  xyGraph.remove(this.existingTraces.remove(series));
  xyGraph.addTrace(trace);
  existingTraces.put(series,trace);
}

Fixed version (ground truth):
/** 
 * This operation completely recreates the trace for the specified series and replaces the current trace with this one.
 * @param series The series to recreate the trace for
 */
private void redrawSeries(ISeries series){
  double[] xValues=getDoubleValue(independentSeries);
  double[] xPlusError=new double[xValues.length];
  double[] xMinusError=new double[xValues.length];
  if (seriesMap.containsKey(independentSeries)) {
    List<ISeries> errors=seriesMap.get(independentSeries);
    if (errors != null && errors.size() > 0) {
      for (      ISeries errSeries : errors) {
        BasicErrorStyle errStyle=(BasicErrorStyle)errSeries.getStyle();
        if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.PLUS)) {
          sumArrays(xPlusError,getDoubleValue(errSeries));
        }
 else         if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.MINUS)) {
          sumArrays(xMinusError,getDoubleValue(errSeries));
        }
 else         if (errStyle.getProperty(BasicErrorStyle.ERROR_BAR_TYPE).equals(ErrorBarType.BOTH)) {
          sumArrays(xPlusError,getDoubleValue(errSeries));
          sumArrays(xMinusError,getDoubleValue(errSeries));
        }
      }
    }
  }
  Trace trace=configureTrace(series,xValues,xPlusError,xMinusError);
  if (trace != null) {
    XYZSeriesStyle indepStyle=(XYZSeriesStyle)independentSeries.getStyle();
    trace.setXErrorBarType((ErrorBarType)indepStyle.getProperty(XYZSeriesStyle.ERROR_TYPE));
  }
  Trace toRemove=this.existingTraces.remove(series);
  trace.setTraceColor(toRemove.getTraceColor());
  xyGraph.remove(toRemove);
  xyGraph.addTrace(trace);
  existingTraces.put(series,trace);
}