Program: 186298
Project: 186298
Buggy source:
public void run(){
  Log.v(TAG,"String_Node_Str" + currentDirectory);
  File[] files=currentDirectory.listFiles();
  int fileCount=0;
  int dirCount=0;
  int sdCount=0;
  int totalCount=0;
  if (cancel) {
    Log.v(TAG,"String_Node_Str");
    clearData();
    return;
  }
  if (files == null) {
    Log.v(TAG,"String_Node_Str");
    totalCount=0;
  }
 else {
    totalCount=files.length;
  }
  operationStartTime=SystemClock.uptimeMillis();
  Log.v(TAG,"String_Node_Str" + totalCount + "String_Node_Str");
  int progress=0;
  List<IconifiedText> listDir=new ArrayList<IconifiedText>(totalCount);
  List<File> listDirFile=new ArrayList<File>(totalCount);
  List<IconifiedText> listFile=new ArrayList<IconifiedText>(totalCount);
  List<File> listFileFile=new ArrayList<File>(totalCount);
  List<IconifiedText> listSdCard=new ArrayList<IconifiedText>(3);
  boolean noMedia=false;
  Drawable sdIcon=context.getResources().getDrawable(R.drawable.ic_launcher_sdcard);
  Drawable folderIcon=context.getResources().getDrawable(R.drawable.ic_launcher_folder);
  Drawable genericFileIcon=context.getResources().getDrawable(R.drawable.icon_file);
  Drawable currentIcon=null;
  boolean displayHiddenFiles=PreferenceActivity.getDisplayHiddenFiles(context);
  if (files != null) {
    for (    File currentFile : files) {
      if (cancel) {
        Log.v(TAG,"String_Node_Str");
        clearData();
        return;
      }
      progress++;
      updateProgress(progress,totalCount);
      if (!displayHiddenFiles && currentFile.isHidden()) {
        continue;
      }
      if (currentFile.isDirectory()) {
        if (currentFile.getAbsolutePath().equals(mSdCardPath)) {
          currentIcon=sdIcon;
          listSdCard.add(new IconifiedText(currentFile.getName(),"String_Node_Str",currentIcon));
        }
 else {
          if (!mWriteableOnly || currentFile.canWrite()) {
            listDirFile.add(currentFile);
          }
        }
      }
 else {
        String fileName=currentFile.getName();
        if (!noMedia) {
          if (fileName.equalsIgnoreCase("String_Node_Str")) {
            noMedia=true;
          }
        }
        String mimetype=mMimeTypes.getMimeType(fileName);
        String filetype=FileUtils.getExtension(fileName);
        boolean ext_allow=filetype.equalsIgnoreCase(mFilterFiletype) || mFilterFiletype == "String_Node_Str";
        boolean mime_allow=mFilterMimetype != null && (mimetype.contentEquals(mFilterMimetype) || mFilterMimetype.contentEquals("String_Node_Str") || mFilterFiletype == null);
        if (!mDirectoriesOnly && (ext_allow || mime_allow)) {
          listFileFile.add(currentFile);
        }
      }
    }
  }
  Log.v(TAG,"String_Node_Str");
  int sortBy=PreferenceActivity.getSortBy(context);
  boolean ascending=PreferenceActivity.getAscending(context);
  Collections.sort(listDirFile,Comparators.getForDirectory(sortBy,ascending));
  Collections.sort(listFileFile,Comparators.getForFile(sortBy,ascending));
  for (  File f : listDirFile) {
    listDir.add(new IconifiedText(f.getName(),"String_Node_Str",folderIcon));
  }
  for (  File currentFile : listFileFile) {
    String mimetype=mMimeTypes.getMimeType(currentFile.getName());
    currentIcon=getDrawableForMimetype(currentFile,mimetype);
    if (currentIcon == null) {
      currentIcon=genericFileIcon;
    }
 else {
      int width=genericFileIcon.getIntrinsicWidth();
      int height=genericFileIcon.getIntrinsicHeight();
      currentIcon=resizeDrawable(currentIcon,width,height);
    }
    String size="String_Node_Str";
    try {
      size=(String)formatter_formatFileSize.invoke(null,context,currentFile.length());
    }
 catch (    Exception e) {
      size=Long.toString(currentFile.length() / 1024);
      size+="String_Node_Str";
    }
    listFile.add(new IconifiedText(currentFile.getName(),size + "String_Node_Str" + FileUtils.formatDate(context,currentFile.lastModified()),currentIcon));
  }
  if (!cancel) {
    Log.v(TAG,"String_Node_Str");
    DirectoryContents contents=new DirectoryContents();
    contents.listDir=listDir;
    contents.listFile=listFile;
    contents.listSdCard=listSdCard;
    contents.noMedia=noMedia;
    Message msg=handler.obtainMessage(FileManagerActivity.MESSAGE_SHOW_DIRECTORY_CONTENTS);
    msg.obj=contents;
    msg.sendToTarget();
  }
  clearData();
}

Fixed version (ground truth):
public void run(){
  Log.v(TAG,"String_Node_Str" + currentDirectory);
  File[] files=currentDirectory.listFiles();
  int fileCount=0;
  int dirCount=0;
  int sdCount=0;
  int totalCount=0;
  if (cancel) {
    Log.v(TAG,"String_Node_Str");
    clearData();
    return;
  }
  if (files == null) {
    Log.v(TAG,"String_Node_Str");
    totalCount=0;
  }
 else {
    totalCount=files.length;
  }
  operationStartTime=SystemClock.uptimeMillis();
  Log.v(TAG,"String_Node_Str" + totalCount + "String_Node_Str");
  int progress=0;
  List<IconifiedText> listDir=new ArrayList<IconifiedText>(totalCount);
  List<File> listDirFile=new ArrayList<File>(totalCount);
  List<IconifiedText> listFile=new ArrayList<IconifiedText>(totalCount);
  List<File> listFileFile=new ArrayList<File>(totalCount);
  List<IconifiedText> listSdCard=new ArrayList<IconifiedText>(3);
  boolean noMedia=false;
  Drawable sdIcon=context.getResources().getDrawable(R.drawable.ic_launcher_sdcard);
  Drawable folderIcon=context.getResources().getDrawable(R.drawable.ic_launcher_folder);
  Drawable genericFileIcon=context.getResources().getDrawable(R.drawable.icon_file);
  Drawable currentIcon=null;
  boolean displayHiddenFiles=PreferenceActivity.getDisplayHiddenFiles(context);
  if (files != null) {
    for (    File currentFile : files) {
      if (cancel) {
        Log.v(TAG,"String_Node_Str");
        clearData();
        return;
      }
      progress++;
      updateProgress(progress,totalCount);
      if (!displayHiddenFiles && currentFile.isHidden()) {
        continue;
      }
      if (currentFile.isDirectory()) {
        if (currentFile.getAbsolutePath().equals(mSdCardPath)) {
          currentIcon=sdIcon;
          listSdCard.add(new IconifiedText(currentFile.getName(),"String_Node_Str",currentIcon));
        }
 else {
          if (!mWriteableOnly || currentFile.canWrite()) {
            listDirFile.add(currentFile);
          }
        }
      }
 else {
        String fileName=currentFile.getName();
        if (!noMedia) {
          if (fileName.equalsIgnoreCase("String_Node_Str")) {
            noMedia=true;
          }
        }
        String mimetype=mMimeTypes.getMimeType(fileName);
        String filetype=FileUtils.getExtension(fileName);
        boolean ext_allow=filetype.equalsIgnoreCase(mFilterFiletype) || mFilterFiletype == "String_Node_Str";
        boolean mime_allow=mFilterMimetype != null && (mimetype.contentEquals(mFilterMimetype) || mFilterMimetype.contentEquals("String_Node_Str") || mFilterFiletype == null);
        if (!mDirectoriesOnly && (ext_allow || mime_allow)) {
          listFileFile.add(currentFile);
        }
      }
    }
  }
  Log.v(TAG,"String_Node_Str");
  int sortBy=PreferenceActivity.getSortBy(context);
  boolean ascending=PreferenceActivity.getAscending(context);
  Collections.sort(listDirFile,Comparators.getForDirectory(sortBy,ascending));
  Collections.sort(listFileFile,Comparators.getForFile(sortBy,ascending));
  for (  File f : listDirFile) {
    listDir.add(new IconifiedText(f.getName(),"String_Node_Str",folderIcon));
  }
  for (  File currentFile : listFileFile) {
    String mimetype=mMimeTypes.getMimeType(currentFile.getName());
    currentIcon=getDrawableForMimetype(currentFile,mimetype);
    if (currentIcon == null) {
      currentIcon=genericFileIcon;
    }
 else {
      int width=genericFileIcon.getIntrinsicWidth();
      int height=genericFileIcon.getIntrinsicHeight();
      currentIcon=ImageUtils.resizeDrawable(currentIcon,width,height);
    }
    String size="String_Node_Str";
    try {
      size=(String)formatter_formatFileSize.invoke(null,context,currentFile.length());
    }
 catch (    Exception e) {
      size=Long.toString(currentFile.length() / 1024);
      size+="String_Node_Str";
    }
    listFile.add(new IconifiedText(currentFile.getName(),size + "String_Node_Str" + FileUtils.formatDate(context,currentFile.lastModified()),currentIcon));
  }
  if (!cancel) {
    Log.v(TAG,"String_Node_Str");
    DirectoryContents contents=new DirectoryContents();
    contents.listDir=listDir;
    contents.listFile=listFile;
    contents.listSdCard=listSdCard;
    contents.noMedia=noMedia;
    Message msg=handler.obtainMessage(FileManagerActivity.MESSAGE_SHOW_DIRECTORY_CONTENTS);
    msg.obj=contents;
    msg.sendToTarget();
  }
  clearData();
}