Program: 20457
Project: 20457
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  finish();
  if (requestCode == IMAGE_RESULT && resultCode == Activity.RESULT_OK) {
    if (data != null) {
      final Uri uri=data.getData();
      Cursor returnCursor=getContentResolver().query(uri,null,null,null,null);
      if (returnCursor != null) {
        int nameIndex=returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
        returnCursor.moveToFirst();
        String name="String_Node_Str";
        if (nameIndex > -1) {
          name=returnCursor.getString(nameIndex);
        }
        returnCursor.close();
        final String finalName=name;
        ChanApplication.getReplyManager()._onPickedFileLoading();
        new Thread(new Runnable(){
          @Override public void run(){
            try {
              final File cacheFile=new File(getCacheDir() + File.separator + "String_Node_Str");
              if (cacheFile.exists()) {
                cacheFile.delete();
              }
              InputStream is=getContentResolver().openInputStream(uri);
              FileOutputStream fos=new FileOutputStream(cacheFile);
              IOUtils.copy(is,fos);
              runOnUiThread(new Runnable(){
                @Override public void run(){
                  ChanApplication.getReplyManager()._onPickedFile(finalName,cacheFile);
                }
              }
);
            }
 catch (            IOException e) {
              e.printStackTrace();
            }
          }
        }
).start();
      }
 else {
        Toast.makeText(this,R.string.image_open_failed,Toast.LENGTH_LONG).show();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  finish();
  if (requestCode == IMAGE_RESULT && resultCode == Activity.RESULT_OK) {
    if (data != null) {
      final Uri uri=data.getData();
      String name="String_Node_Str";
      Cursor returnCursor=getContentResolver().query(uri,null,null,null,null);
      if (returnCursor != null) {
        int nameIndex=returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
        returnCursor.moveToFirst();
        if (nameIndex > -1) {
          name=returnCursor.getString(nameIndex);
        }
        returnCursor.close();
      }
      ChanApplication.getReplyManager()._onPickedFileLoading();
      final String finalName=name;
      new Thread(new Runnable(){
        @Override public void run(){
          try {
            final File cacheFile=new File(getCacheDir() + File.separator + "String_Node_Str");
            if (cacheFile.exists()) {
              cacheFile.delete();
            }
            ParcelFileDescriptor fileDescriptor=getContentResolver().openFileDescriptor(uri,"String_Node_Str");
            FileInputStream is=new FileInputStream(fileDescriptor.getFileDescriptor());
            FileOutputStream os=new FileOutputStream(cacheFile);
            IOUtils.copy(is,os);
            runOnUiThread(new Runnable(){
              @Override public void run(){
                ChanApplication.getReplyManager()._onPickedFile(finalName,cacheFile);
              }
            }
);
          }
 catch (          IOException e) {
            e.printStackTrace();
            Utils.runOnUiThread(new Runnable(){
              @Override public void run(){
                ChanApplication.getReplyManager()._onPickedFile("String_Node_Str",null);
                Toast.makeText(ImagePickActivity.this,R.string.file_open_failed,Toast.LENGTH_LONG).show();
              }
            }
);
          }
        }
      }
).start();
    }
  }
}