Program: 184972
Project: 184972
Buggy source:
/** 
 * Loops over a list of URLs, points the browser to each one, and records the time elapsed.
 * @param input the reader from which to get the URLs.
 * @param writer the writer to which to output the results.
 * @param clearCache determines whether the cache is cleared before loading each page
 * @param loopCount the number of times to loop through the list of pages
 * @throws IOException unable to read from input or write to writer.
 * @throws InterruptedException the thread was interrupted waiting for the page to load.
 */
void loopUrls(BufferedReader input,OutputStreamWriter writer,boolean clearCache,int loopCount) throws IOException, InterruptedException {
  Tab tab=mActivity.getTabControl().getCurrentTab();
  WebView webView=tab.getWebView();
  List<String> pages=new LinkedList<String>();
  String page;
  while (null != (page=input.readLine())) {
    pages.add(page);
  }
  Iterator<String> iterator=pages.iterator();
  for (int i=0; i < mStatus.getPage(); ++i) {
    iterator.next();
  }
  if (mStatus.getIsRecovery()) {
    Log.e(TAG,"String_Node_Str" + iterator.next());
  }
  while (mStatus.getIteration() < loopCount) {
    if (clearCache) {
      webView.clearCache(true);
    }
    while (iterator.hasNext()) {
      page=iterator.next();
      mStatus.setUrl(page);
      mStatus.write();
      Log.i(TAG,"String_Node_Str" + page);
      Uri uri=Uri.parse(page);
      final Intent intent=new Intent(Intent.ACTION_VIEW,uri);
      long startTime=System.currentTimeMillis();
      resetForNewPage();
      mInst.runOnMainSync(new Runnable(){
        public void run(){
          mActivity.onNewIntent(intent);
        }
      }
);
      waitForLoad();
      long stopTime=System.currentTimeMillis();
      String url=webView.getUrl();
      Log.i(TAG,"String_Node_Str" + url);
      if (writer != null) {
        writer.write(page + "String_Node_Str" + (stopTime - startTime)+ newLine);
        writer.flush();
      }
      mStatus.incrementPage();
    }
    mStatus.incrementIteration();
    mStatus.resetPage();
    iterator=pages.iterator();
  }
}

Fixed version (ground truth):
/** 
 * Loops over a list of URLs, points the browser to each one, and records the time elapsed.
 * @param input the reader from which to get the URLs.
 * @param writer the writer to which to output the results.
 * @param clearCache determines whether the cache is cleared before loading each page
 * @param loopCount the number of times to loop through the list of pages
 * @throws IOException unable to read from input or write to writer.
 * @throws InterruptedException the thread was interrupted waiting for the page to load.
 */
void loopUrls(BufferedReader input,OutputStreamWriter writer,boolean clearCache,int loopCount) throws IOException, InterruptedException {
  Tab tab=mActivity.getTabControl().getCurrentTab();
  WebView webView=tab.getWebView();
  List<String> pages=new LinkedList<String>();
  String page;
  while (null != (page=input.readLine())) {
    pages.add(page);
  }
  Iterator<String> iterator=pages.iterator();
  for (int i=0; i < mStatus.getPage(); ++i) {
    iterator.next();
  }
  if (mStatus.getIsRecovery()) {
    Log.e(TAG,"String_Node_Str" + iterator.next());
    mStatus.incrementPage();
  }
  while (mStatus.getIteration() < loopCount) {
    if (clearCache) {
      webView.clearCache(true);
    }
    while (iterator.hasNext()) {
      page=iterator.next();
      mStatus.setUrl(page);
      mStatus.write();
      Log.i(TAG,"String_Node_Str" + page);
      Uri uri=Uri.parse(page);
      final Intent intent=new Intent(Intent.ACTION_VIEW,uri);
      long startTime=System.currentTimeMillis();
      resetForNewPage();
      mInst.runOnMainSync(new Runnable(){
        public void run(){
          mActivity.onNewIntent(intent);
        }
      }
);
      waitForLoad();
      long stopTime=System.currentTimeMillis();
      String url=webView.getUrl();
      Log.i(TAG,"String_Node_Str" + url);
      if (writer != null) {
        writer.write(page + "String_Node_Str" + (stopTime - startTime)+ newLine);
        writer.flush();
      }
      mStatus.incrementPage();
    }
    mStatus.incrementIteration();
    mStatus.resetPage();
    iterator=pages.iterator();
  }
}