Program: 195506
Project: 195506
Buggy source:
/** 
 * Find all   {@link IntervalStats} for the given range and interval type.
 */
public <T>List<T> queryUsageStats(int intervalType,long beginTime,long endTime,StatCombiner<T> combiner){
synchronized (mLock) {
    if (intervalType < 0 || intervalType >= mIntervalDirs.length) {
      throw new IllegalArgumentException("String_Node_Str" + intervalType);
    }
    final TimeSparseArray<AtomicFile> intervalStats=mSortedStatFiles[intervalType];
    if (endTime <= beginTime) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + endTime + "String_Node_Str"+ beginTime+ "String_Node_Str");
      }
      return null;
    }
    int startIndex=intervalStats.closestIndexOnOrBefore(beginTime);
    if (startIndex < 0) {
      startIndex=0;
    }
    int endIndex=intervalStats.closestIndexOnOrBefore(endTime);
    if (endIndex < 0) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str");
      }
      return null;
    }
    if (intervalStats.keyAt(endIndex) == endTime) {
      endIndex--;
      if (endIndex < 0) {
        if (DEBUG) {
          Slog.d(TAG,"String_Node_Str");
        }
        return null;
      }
    }
    try {
      IntervalStats stats=new IntervalStats();
      ArrayList<T> results=new ArrayList<>();
      for (int i=startIndex; i <= endIndex; i++) {
        final AtomicFile f=intervalStats.valueAt(i);
        if (DEBUG) {
          Slog.d(TAG,"String_Node_Str" + f.getBaseFile().getAbsolutePath());
        }
        UsageStatsXml.read(f,stats);
        if (beginTime < stats.endTime) {
          combiner.combine(stats,false,results);
        }
      }
      return results;
    }
 catch (    IOException e) {
      Slog.e(TAG,"String_Node_Str",e);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Find all   {@link IntervalStats} for the given range and interval type.
 */
public <T>List<T> queryUsageStats(int intervalType,long beginTime,long endTime,StatCombiner<T> combiner){
synchronized (mLock) {
    if (intervalType < 0 || intervalType >= mIntervalDirs.length) {
      throw new IllegalArgumentException("String_Node_Str" + intervalType);
    }
    final TimeSparseArray<AtomicFile> intervalStats=mSortedStatFiles[intervalType];
    if (endTime <= beginTime) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + endTime + "String_Node_Str"+ beginTime+ "String_Node_Str");
      }
      return null;
    }
    int startIndex=intervalStats.closestIndexOnOrBefore(beginTime);
    if (startIndex < 0) {
      startIndex=0;
    }
    int endIndex=intervalStats.closestIndexOnOrBefore(endTime);
    if (endIndex < 0) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str");
      }
      return null;
    }
    if (intervalStats.keyAt(endIndex) == endTime) {
      endIndex--;
      if (endIndex < 0) {
        if (DEBUG) {
          Slog.d(TAG,"String_Node_Str");
        }
        return null;
      }
    }
    final IntervalStats stats=new IntervalStats();
    final ArrayList<T> results=new ArrayList<>();
    for (int i=startIndex; i <= endIndex; i++) {
      final AtomicFile f=intervalStats.valueAt(i);
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + f.getBaseFile().getAbsolutePath());
      }
      try {
        UsageStatsXml.read(f,stats);
        if (beginTime < stats.endTime) {
          combiner.combine(stats,false,results);
        }
      }
 catch (      IOException e) {
        Slog.e(TAG,"String_Node_Str",e);
      }
    }
    return results;
  }
}