Program: 74678
Project: 74678
Buggy source:
private void _addPoint(int dataset,double x,double y,double yLowEB,double yHighEB,boolean connected,boolean errorBar){
  _plotImage=null;
  _checkDatasetIndex(dataset);
  if (_xlog) {
    if (x <= 0.0) {
      System.err.println("String_Node_Str" + "String_Node_Str" + x);
      return;
    }
    x=Math.log(x) * _LOG10SCALE;
  }
  if (_ylog) {
    if (y <= 0.0) {
      System.err.println("String_Node_Str" + "String_Node_Str" + y);
      return;
    }
    y=Math.log(y) * _LOG10SCALE;
    if (errorBar) {
      if ((yLowEB <= 0.0) || (yHighEB <= 0.0)) {
        System.err.println("String_Node_Str" + "String_Node_Str" + y);
        return;
      }
      yLowEB=Math.log(yLowEB) * _LOG10SCALE;
      yHighEB=Math.log(yHighEB) * _LOG10SCALE;
    }
  }
  Vector pts=(Vector)_points.elementAt(dataset);
  if (_xPersistence > 0.0) {
    int numToDelete=0;
    while (numToDelete < pts.size()) {
      PlotPoint old=(PlotPoint)(pts.elementAt(numToDelete));
      if ((x - old.originalx) <= _xPersistence) {
        break;
      }
      numToDelete++;
    }
    for (int i=0; i < numToDelete; i++) {
      erasePoint(dataset,0);
    }
  }
  int size=pts.size();
  PlotPoint pt=new PlotPoint();
  pt.originalx=x;
  if (_wrap) {
    double width=_wrapHigh - _wrapLow;
    if (x < _wrapLow) {
      x+=(width * Math.floor(1.0 + ((_wrapLow - x) / width)));
    }
 else     if (x > _wrapHigh) {
      x-=(width * Math.floor(1.0 + ((x - _wrapHigh) / width)));
      if (x == _wrapLow) {
        x=_wrapHigh;
      }
    }
  }
  if (x < _xBottom) {
    _xBottom=x;
  }
  if (x > _xTop) {
    _xTop=x;
  }
  if (y < _yBottom) {
    _yBottom=y;
  }
  if (y > _yTop) {
    _yTop=y;
  }
  pt.x=x;
  pt.y=y;
  pt.connected=connected && _isConnected(dataset);
  if (errorBar) {
    if (yLowEB < _yBottom) {
      _yBottom=yLowEB;
    }
    if (yLowEB > _yTop) {
      _yTop=yLowEB;
    }
    if (yHighEB < _yBottom) {
      _yBottom=yHighEB;
    }
    if (yHighEB > _yTop) {
      _yTop=yHighEB;
    }
    pt.yLowEB=yLowEB;
    pt.yHighEB=yHighEB;
    pt.errorBar=true;
  }
  if (size == 0) {
    pt.connected=false;
  }
 else   if (_wrap) {
    PlotPoint old=(PlotPoint)(pts.elementAt(size - 1));
    if (old.x > x) {
      pt.connected=false;
    }
  }
  pts.addElement(pt);
  if (_pointsPersistence > 0) {
    if (size > _pointsPersistence) {
      erasePoint(dataset,0);
    }
  }
  Graphics graphics=getGraphics();
  if (_showing && (graphics != null)) {
    if (((_pointsPersistence > 0) || (_xPersistence > 0.0)) && isDoubleBuffered()) {
      setDoubleBuffered(false);
      Component parent=getParent();
      while (parent != null) {
        if (parent instanceof JComponent) {
          ((JComponent)parent).setDoubleBuffered(false);
        }
        parent=parent.getParent();
      }
    }
    _drawPlotPoint(graphics,dataset,pts.size() - 1);
  }
  if (_wrap && (Math.abs(x - _wrapHigh)) < 0.00001) {
    _addPoint(dataset,_wrapLow,y,yLowEB,yHighEB,false,errorBar);
  }
}

Fixed version (ground truth):
private void _addPoint(int dataset,double x,double y,double yLowEB,double yHighEB,boolean connected,boolean errorBar){
  _plotImage=null;
  _checkDatasetIndex(dataset);
  if (_xlog) {
    if (x <= 0.0) {
      System.err.println("String_Node_Str" + "String_Node_Str" + x);
      return;
    }
    x=Math.log(x) * _LOG10SCALE;
  }
  if (_ylog) {
    if (y <= 0.0) {
      System.err.println("String_Node_Str" + "String_Node_Str" + y);
      return;
    }
    y=Math.log(y) * _LOG10SCALE;
    if (errorBar) {
      if ((yLowEB <= 0.0) || (yHighEB <= 0.0)) {
        System.err.println("String_Node_Str" + "String_Node_Str" + y);
        return;
      }
      yLowEB=Math.log(yLowEB) * _LOG10SCALE;
      yHighEB=Math.log(yHighEB) * _LOG10SCALE;
    }
  }
  Vector pts=(Vector)_points.elementAt(dataset);
  if (_xPersistence > 0.0) {
    int numToDelete=0;
    while (numToDelete < pts.size()) {
      PlotPoint old=(PlotPoint)(pts.elementAt(numToDelete));
      if ((x - old.originalx) <= _xPersistence) {
        break;
      }
      numToDelete++;
    }
    for (int i=0; i < numToDelete; i++) {
      erasePoint(dataset,0);
    }
  }
  int size=pts.size();
  PlotPoint pt=new PlotPoint();
  pt.originalx=x;
  if (_wrap) {
    double width=_wrapHigh - _wrapLow;
    if (x < _wrapLow) {
      x+=(width * Math.floor(1.0 + ((_wrapLow - x) / width)));
    }
 else     if (x > _wrapHigh) {
      x-=(width * Math.floor(1.0 + ((x - _wrapHigh) / width)));
      if (Math.abs(x - _wrapLow) < 0.00001) {
        x=_wrapHigh;
      }
    }
  }
  if (x < _xBottom) {
    _xBottom=x;
  }
  if (x > _xTop) {
    _xTop=x;
  }
  if (y < _yBottom) {
    _yBottom=y;
  }
  if (y > _yTop) {
    _yTop=y;
  }
  pt.x=x;
  pt.y=y;
  pt.connected=connected && _isConnected(dataset);
  if (errorBar) {
    if (yLowEB < _yBottom) {
      _yBottom=yLowEB;
    }
    if (yLowEB > _yTop) {
      _yTop=yLowEB;
    }
    if (yHighEB < _yBottom) {
      _yBottom=yHighEB;
    }
    if (yHighEB > _yTop) {
      _yTop=yHighEB;
    }
    pt.yLowEB=yLowEB;
    pt.yHighEB=yHighEB;
    pt.errorBar=true;
  }
  if (size == 0) {
    pt.connected=false;
  }
 else   if (_wrap) {
    PlotPoint old=(PlotPoint)(pts.elementAt(size - 1));
    if (old.x > x) {
      pt.connected=false;
    }
  }
  pts.addElement(pt);
  if (_pointsPersistence > 0) {
    if (size > _pointsPersistence) {
      erasePoint(dataset,0);
    }
  }
  Graphics graphics=getGraphics();
  if (_showing && (graphics != null)) {
    if (((_pointsPersistence > 0) || (_xPersistence > 0.0)) && isDoubleBuffered()) {
      setDoubleBuffered(false);
      Component parent=getParent();
      while (parent != null) {
        if (parent instanceof JComponent) {
          ((JComponent)parent).setDoubleBuffered(false);
        }
        parent=parent.getParent();
      }
    }
    _drawPlotPoint(graphics,dataset,pts.size() - 1);
  }
  if (_wrap && (Math.abs(x - _wrapHigh)) < 0.00001) {
    _addPoint(dataset,_wrapLow,y,yLowEB,yHighEB,false,errorBar);
  }
}