Program: 23685
Project: 23685
Buggy source:
/** 
 * Add a new movement to the batch of movements in this event.  The input data must contain (NUM_SAMPLE_DATA *   {@link #getPointerCount()}) samples of data.
 * @param eventTime The time stamp for this data.
 * @param inData The actual data.
 * @param metaState Meta key state.
 * @hide
 */
public final void addBatch(long eventTime,float[] inData,int metaState){
  float[] data=mDataSamples;
  long[] times=mTimeSamples;
  final int NP=mNumPointers;
  final int NS=mNumSamples;
  final int NI=NP * NS;
  final int ND=NI * NUM_SAMPLE_DATA;
  if (data.length <= ND) {
    final int NEW_ND=ND + (NP * (BASE_AVAIL_SAMPLES * NUM_SAMPLE_DATA));
    float[] newData=new float[NEW_ND];
    System.arraycopy(data,0,newData,0,ND);
    mDataSamples=data=newData;
  }
  if (times.length <= NS) {
    final int NEW_NS=NS + BASE_AVAIL_SAMPLES;
    long[] newHistoryTimes=new long[NEW_NS];
    System.arraycopy(times,0,newHistoryTimes,0,NS);
    mTimeSamples=times=newHistoryTimes;
  }
  times[NS]=times[0];
  times[0]=eventTime;
  System.arraycopy(data,0,data,ND,mNumPointers * NUM_SAMPLE_DATA);
  System.arraycopy(inData,0,data,0,mNumPointers * NUM_SAMPLE_DATA);
  mNumSamples=NS + 1;
  mRawX=inData[SAMPLE_X];
  mRawY=inData[SAMPLE_Y];
  mMetaState|=metaState;
  if (DEBUG_POINTERS) {
    StringBuilder sb=new StringBuilder(128);
    sb.append("String_Node_Str");
    for (int i=0; i < mNumPointers; i++) {
      sb.append("String_Node_Str");
      sb.append(mPointerIdentifiers[i]);
      sb.append("String_Node_Str");
      sb.append(mDataSamples[(i * NUM_SAMPLE_DATA) + SAMPLE_X]);
      sb.append("String_Node_Str");
      sb.append(mDataSamples[(i * NUM_SAMPLE_DATA) + SAMPLE_Y]);
      sb.append("String_Node_Str");
    }
    Log.v("String_Node_Str",sb.toString());
  }
}

Fixed version (ground truth):
/** 
 * Add a new movement to the batch of movements in this event.  The input data must contain (NUM_SAMPLE_DATA *   {@link #getPointerCount()}) samples of data.
 * @param eventTime The time stamp for this data.
 * @param inData The actual data.
 * @param metaState Meta key state.
 * @hide
 */
public final void addBatch(long eventTime,float[] inData,int metaState){
  float[] data=mDataSamples;
  long[] times=mTimeSamples;
  final int NP=mNumPointers;
  final int NS=mNumSamples;
  final int NI=NP * NS;
  final int ND=NI * NUM_SAMPLE_DATA;
  if (data.length < (ND + (NP * NUM_SAMPLE_DATA))) {
    final int NEW_ND=ND + (NP * (BASE_AVAIL_SAMPLES * NUM_SAMPLE_DATA));
    float[] newData=new float[NEW_ND];
    System.arraycopy(data,0,newData,0,ND);
    mDataSamples=data=newData;
  }
  if (times.length < (NS + 1)) {
    final int NEW_NS=NS + BASE_AVAIL_SAMPLES;
    long[] newHistoryTimes=new long[NEW_NS];
    System.arraycopy(times,0,newHistoryTimes,0,NS);
    mTimeSamples=times=newHistoryTimes;
  }
  times[NS]=times[0];
  times[0]=eventTime;
  System.arraycopy(data,0,data,ND,mNumPointers * NUM_SAMPLE_DATA);
  System.arraycopy(inData,0,data,0,mNumPointers * NUM_SAMPLE_DATA);
  mNumSamples=NS + 1;
  mRawX=inData[SAMPLE_X];
  mRawY=inData[SAMPLE_Y];
  mMetaState|=metaState;
  if (DEBUG_POINTERS) {
    StringBuilder sb=new StringBuilder(128);
    sb.append("String_Node_Str");
    for (int i=0; i < mNumPointers; i++) {
      sb.append("String_Node_Str");
      sb.append(mPointerIdentifiers[i]);
      sb.append("String_Node_Str");
      sb.append(mDataSamples[(i * NUM_SAMPLE_DATA) + SAMPLE_X]);
      sb.append("String_Node_Str");
      sb.append(mDataSamples[(i * NUM_SAMPLE_DATA) + SAMPLE_Y]);
      sb.append("String_Node_Str");
    }
    Log.v("String_Node_Str",sb.toString());
  }
}