Program: 31193
Project: 31193
Buggy source:
@Override public void mouseWheelMoved(MouseWheelEvent e){
  int notches=e.getWheelRotation();
  IAxis xAxis=chart.getAxisX();
  IAxis yAxis=chart.getAxisY();
  double xAxisRange=xAxis.getMax() - xAxis.getMin();
  double yAxisRange=yAxis.getMax() - yAxis.getMin();
  double zoomFactor;
  if (notches > 0) {
    zoomFactor=notches * 1.2;
  }
 else {
    zoomFactor=-notches * 0.8;
  }
  double xSqSize=xAxisRange * zoomFactor;
  double ySqSize=yAxisRange * zoomFactor;
  double xPercent=((double)e.getX() - (double)chart.getXChartStart()) / (double)(chart.getXChartEnd() - chart.getXChartStart());
  double yPercent=((double)e.getY() - (double)chart.getYChartEnd()) / (double)(chart.getYChartStart() - chart.getYChartEnd());
  double xValueUnderCursor=xAxis.translatePxToValue(e.getX());
  double xMin=xValueUnderCursor - xSqSize * xPercent;
  double xMax=xValueUnderCursor + xSqSize * (1 - xPercent);
  double yValueUnderCursor=yAxis.translatePxToValue(e.getY());
  double yMin=yValueUnderCursor - ySqSize * (1 - yPercent);
  double yMax=yValueUnderCursor + ySqSize * yPercent;
  if (Double.isNaN(xMin) || Double.isNaN(xMax) || Double.isNaN(yMin)|| Double.isNaN(yMax)) {
    return;
  }
  chart.zoom(xMin,xMax,yMin,yMax);
  for (int i=0; i < rightYAxis.size(); i++) {
    AAxis axis=rightYAxis.get(i);
    double axisRange=axis.getMax() - axis.getMin();
    double sqSize=axisRange * zoomFactor;
    double underCursor=axis.translatePxToValue(e.getY());
    double minVal=underCursor - sqSize * (1 - yPercent);
    double maxVal=underCursor + sqSize * yPercent;
    zoom(axis,axis.translateValueToPx(minVal),axis.translateValueToPx(maxVal));
  }
}

Fixed version (ground truth):
@Override public void mouseWheelMoved(MouseWheelEvent e){
  int notches=e.getWheelRotation();
  IAxis xAxis=chart.getAxisX();
  IAxis yAxis=chart.getAxisY();
  double xAxisRange=xAxis.getRange().getExtent();
  double yAxisRange=yAxis.getRange().getExtent();
  double zoomFactor;
  if (notches > 0) {
    zoomFactor=notches * 1.2;
  }
 else {
    zoomFactor=-notches * 0.8;
  }
  double xSqSize=xAxisRange * zoomFactor;
  double ySqSize=yAxisRange * zoomFactor;
  double xPercent=((double)e.getX() - (double)chart.getXChartStart()) / (double)(chart.getXChartEnd() - chart.getXChartStart());
  double yPercent=((double)e.getY() - (double)chart.getYChartEnd()) / (double)(chart.getYChartStart() - chart.getYChartEnd());
  double xValueUnderCursor=xAxis.translatePxToValue(e.getX());
  double xMin=xValueUnderCursor - xSqSize * xPercent;
  double xMax=xValueUnderCursor + xSqSize * (1 - xPercent);
  double yValueUnderCursor=yAxis.translatePxToValue(e.getY());
  double yMin=yValueUnderCursor - ySqSize * (1 - yPercent);
  double yMax=yValueUnderCursor + ySqSize * yPercent;
  if (Double.isNaN(xMin) || Double.isNaN(xMax) || Double.isNaN(yMin)|| Double.isNaN(yMax)) {
    return;
  }
  chart.zoom(xMin,xMax,yMin,yMax);
  for (int i=0; i < rightYAxis.size(); i++) {
    AAxis axis=rightYAxis.get(i);
    double axisRange=axis.getMax() - axis.getMin();
    double sqSize=axisRange * zoomFactor;
    double underCursor=axis.translatePxToValue(e.getY());
    double minVal=underCursor - sqSize * (1 - yPercent);
    double maxVal=underCursor + sqSize * yPercent;
    zoom(axis,axis.translateValueToPx(minVal),axis.translateValueToPx(maxVal));
  }
}