Program: 11152
Project: 11152
Buggy source:
/** 
 * Initializes all the views in the layout of the activity.
 */
private void initializeViews(){
  directoryTitle=(TextView)findViewById(R.id.file_directory_title);
  addButton=(MaterialFloatingActionButton)findViewById(R.id.file_picker_add_button);
  addButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      NameFileDialog nfd=NameFileDialog.newInstance();
      nfd.show(getFragmentManager(),"String_Node_Str");
    }
  }
);
  if (fabColorId != -1) {
    addButton.setButtonColor(getResources().getColor(fabColorId));
  }
  selectButton=(Button)findViewById(R.id.select_button);
  selectButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (requestCode == REQUEST_DIRECTORY) {
        if (currentFile.isDirectory()) {
          curDirectory=currentFile;
          data=new Intent();
          data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
          setResult(RESULT_OK,data);
          finish();
        }
 else {
          SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_select_directory_message).duration(1500));
        }
      }
 else {
        if (currentFile.isDirectory()) {
          curDirectory=currentFile;
          new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
        }
 else {
          if (mimeType != null) {
            MimeTypeMap mimeTypeMap=MimeTypeMap.getSingleton();
            String requiredExtension="String_Node_Str" + mimeTypeMap.getExtensionFromMimeType(mimeType);
            if (requiredExtension.equalsIgnoreCase(fileExt(currentFile.toString()))) {
              data=new Intent();
              data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
              setResult(RESULT_OK,data);
              finish();
            }
 else {
              SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(String.format(getString(R.string.file_picker_snackbar_select_file_ext_message),requiredExtension)).duration(1500));
            }
          }
 else {
            data=new Intent();
            data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
            setResult(RESULT_OK,data);
            finish();
          }
        }
      }
    }
  }
);
  openButton=(Button)findViewById(R.id.open_button);
  openButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (currentFile.isDirectory()) {
        curDirectory=currentFile;
        directoryTitle.setText(curDirectory.getName());
        new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
      }
 else {
        Intent newIntent=new Intent(android.content.Intent.ACTION_VIEW);
        String file=currentFile.toString();
        if (file != null) {
          newIntent.setDataAndType(Uri.fromFile(currentFile),mimeType);
          newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          try {
            startActivity(newIntent);
          }
 catch (          android.content.ActivityNotFoundException e) {
            SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_no_file_type_handler));
          }
        }
 else {
          SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_no_read_type));
        }
      }
    }
  }
);
  buttonContainer=(LinearLayout)findViewById(R.id.button_container);
  buttonContainer.setVisibility(View.INVISIBLE);
  header=(RelativeLayout)findViewById(R.id.header_container);
}

Fixed version (ground truth):
/** 
 * Initializes all the views in the layout of the activity.
 */
private void initializeViews(){
  directoryTitle=(TextView)findViewById(R.id.file_directory_title);
  addButton=(MaterialFloatingActionButton)findViewById(R.id.file_picker_add_button);
  addButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      NameFileDialog nfd=NameFileDialog.newInstance();
      nfd.show(getFragmentManager(),"String_Node_Str");
    }
  }
);
  if (fabColorId != -1) {
    addButton.setButtonColor(getResources().getColor(fabColorId));
  }
  selectButton=(Button)findViewById(R.id.select_button);
  selectButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (requestCode == REQUEST_DIRECTORY) {
        if (currentFile.isDirectory()) {
          curDirectory=currentFile;
          data=new Intent();
          data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
          setResult(RESULT_OK,data);
          finish();
        }
 else {
          SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_select_directory_message).duration(1500));
        }
      }
 else {
        if (currentFile.isDirectory()) {
          curDirectory=currentFile;
          new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
        }
 else {
          if (mimeType != null && !mimeType.equalsIgnoreCase(FileType.NONE.getMimeType())) {
            MimeTypeMap mimeTypeMap=MimeTypeMap.getSingleton();
            String requiredExtension="String_Node_Str" + mimeTypeMap.getExtensionFromMimeType(mimeType);
            if (requiredExtension.equalsIgnoreCase(fileExt(currentFile.toString()))) {
              data=new Intent();
              data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
              setResult(RESULT_OK,data);
              finish();
            }
 else {
              SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(String.format(getString(R.string.file_picker_snackbar_select_file_ext_message),requiredExtension)).duration(1500));
            }
          }
 else {
            data=new Intent();
            data.putExtra(FILE_EXTRA_DATA_PATH,currentFile.getAbsolutePath());
            setResult(RESULT_OK,data);
            finish();
          }
        }
      }
    }
  }
);
  openButton=(Button)findViewById(R.id.open_button);
  openButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (currentFile.isDirectory()) {
        curDirectory=currentFile;
        directoryTitle.setText(curDirectory.getName());
        new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
      }
 else {
        Intent newIntent=new Intent(android.content.Intent.ACTION_VIEW);
        String file=currentFile.toString();
        if (file != null) {
          newIntent.setDataAndType(Uri.fromFile(currentFile),mimeType);
          newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          try {
            startActivity(newIntent);
          }
 catch (          android.content.ActivityNotFoundException e) {
            SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_no_file_type_handler));
          }
        }
 else {
          SnackbarManager.show(Snackbar.with(FilePickerActivity.this).text(R.string.file_picker_snackbar_no_read_type));
        }
      }
    }
  }
);
  buttonContainer=(LinearLayout)findViewById(R.id.button_container);
  buttonContainer.setVisibility(View.INVISIBLE);
  header=(RelativeLayout)findViewById(R.id.header_container);
}