Program: 18869
Project: 18869
Buggy source:
/** 
 * returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch point.
 * @param x
 * @param y
 * @return
 */
public Highlight getHighlightByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double xTouchVal=pts[0];
  double yTouchVal=pts[1];
  double base=Math.floor(xTouchVal);
  double touchOffset=mDeltaX * 0.025;
  if ((this instanceof LineChart || this instanceof ScatterChart) && (xTouchVal < -touchOffset || xTouchVal > mDeltaX + touchOffset))   return null;
  if (this instanceof BarChart && (xTouchVal < 0 || xTouchVal > mDeltaX))   return null;
  if (base < 0)   base=0;
  if (base >= mDeltaX)   base=mDeltaX - 1;
  int xIndex=(int)base;
  if (this instanceof BarChart) {
    xIndex/=mOriginalData.getDataSetCount();
  }
  int dataSetIndex=0;
  if (this instanceof LineChart || this instanceof ScatterChart) {
    if (xTouchVal - base > 0.5) {
      xIndex=(int)base + 1;
    }
  }
  if (mDataNotSet) {
    Log.e(LOG_TAG,"String_Node_Str");
    return null;
  }
  ArrayList<SelInfo> valsAtIndex=getYValsAtIndex(xIndex);
  if (this instanceof BarChart) {
    dataSetIndex=((int)base) % mOriginalData.getDataSetCount();
  }
 else {
    dataSetIndex=getClosestDataSetIndex(valsAtIndex,(float)yTouchVal);
  }
  if (dataSetIndex == -1)   return null;
  Toast.makeText(getContext(),"String_Node_Str" + xIndex + "String_Node_Str"+ dataSetIndex,Toast.LENGTH_SHORT).show();
  return new Highlight(xIndex,dataSetIndex);
}

Fixed version (ground truth):
/** 
 * returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch point.
 * @param x
 * @param y
 * @return
 */
public Highlight getHighlightByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double xTouchVal=pts[0];
  double yTouchVal=pts[1];
  double base=Math.floor(xTouchVal);
  double touchOffset=mDeltaX * 0.025;
  if ((this instanceof LineChart || this instanceof ScatterChart) && (xTouchVal < -touchOffset || xTouchVal > mDeltaX + touchOffset))   return null;
  if (this instanceof BarChart && (xTouchVal < 0 || xTouchVal > mDeltaX))   return null;
  if (base < 0)   base=0;
  if (base >= mDeltaX)   base=mDeltaX - 1;
  int xIndex=(int)base;
  if (this instanceof BarChart) {
    xIndex/=mOriginalData.getDataSetCount();
  }
  int dataSetIndex=0;
  if (this instanceof LineChart || this instanceof ScatterChart) {
    if (xTouchVal - base > 0.5) {
      xIndex=(int)base + 1;
    }
  }
  if (mDataNotSet) {
    Log.e(LOG_TAG,"String_Node_Str");
    return null;
  }
  ArrayList<SelInfo> valsAtIndex=getYValsAtIndex(xIndex);
  if (this instanceof BarChart) {
    dataSetIndex=((int)base) % mOriginalData.getDataSetCount();
  }
 else {
    dataSetIndex=getClosestDataSetIndex(valsAtIndex,(float)yTouchVal);
  }
  if (dataSetIndex == -1)   return null;
  return new Highlight(xIndex,dataSetIndex);
}