Program: 17528
Project: 17528
Buggy source:
public void createBackup(final boolean RecoveryBackup){
  String prefix;
  String CurrentName;
  String EXT;
  if (RecoveryBackup) {
    prefix="String_Node_Str";
    EXT=mDevice.getRecoveryExt();
    CurrentName=mDevice.getRecoveryVersion();
  }
 else {
    prefix="String_Node_Str";
    EXT=mDevice.getKernelExt();
    CurrentName=mDevice.getKernelVersion();
  }
  final AppCompatDialog dialog=new AppCompatDialog(mContext);
  dialog.setTitle(R.string.setname);
  dialog.setContentView(R.layout.dialog_input);
  final AppCompatButton bGoBackup=(AppCompatButton)dialog.findViewById(R.id.bGoBackup);
  final AppCompatEditText etFileName=(AppCompatEditText)dialog.findViewById(R.id.etFileName);
  final AppCompatCheckBox optName=(AppCompatCheckBox)dialog.findViewById(R.id.cbOptInput);
  final String NameHint=prefix + "String_Node_Str" + Calendar.getInstance().get(Calendar.DATE)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.MONTH)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.YEAR)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.HOUR)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.MINUTE)+ EXT;
  optName.setText(CurrentName);
  optName.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      etFileName.setEnabled(!optName.isChecked());
    }
  }
);
  etFileName.setHint(NameHint);
  bGoBackup.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      String EXT;
      File Path;
      final int JOB;
      if (RecoveryBackup) {
        EXT=mDevice.getRecoveryExt();
        Path=Const.PathToRecoveryBackups;
        JOB=FlashUtil.JOB_BACKUP_RECOVERY;
      }
 else {
        EXT=mDevice.getKernelExt();
        Path=Const.PathToKernelBackups;
        JOB=FlashUtil.JOB_BACKUP_KERNEL;
      }
      CharSequence Name="String_Node_Str";
      if (optName.isChecked()) {
        Name=optName.getText() + EXT;
      }
 else {
        if (etFileName.getText() != null && !etFileName.getText().toString().equals("String_Node_Str")) {
          Name=etFileName.getText().toString();
        }
        if (Name.equals("String_Node_Str")) {
          Name=String.valueOf(etFileName.getHint());
        }
        if (!Name.toString().endsWith(EXT)) {
          Name=Name + EXT;
        }
      }
      final File fBACKUP=new File(Path,Name.toString());
      if (fBACKUP.exists()) {
        Toast.makeText(mActivity,R.string.backupalready,Toast.LENGTH_SHORT).show();
      }
 else {
        final FlashUtil BackupCreator=new FlashUtil(mActivity,fBACKUP,JOB);
        BackupCreator.setOnTaskDoneListener(new FlashUtil.OnTaskDoneListener(){
          @Override public void onSuccess(){
            ArrayAdapter<String> adapter;
            if (RecoveryBackup) {
              adapter=mAdapter.getRecoveryBackupFragment().getAdapter();
            }
 else {
              adapter=mAdapter.getKernelBackupFragment().getAdapter();
            }
            loadBackups(mActivity.getDevice(),adapter,RecoveryBackup);
          }
          @Override public void onFail(          Exception e){
          }
        }
);
        BackupCreator.execute();
      }
      dialog.dismiss();
    }
  }
);
  dialog.show();
}

Fixed version (ground truth):
public void createBackup(final boolean RecoveryBackup){
  String prefix;
  String CurrentName;
  String EXT;
  if (RecoveryBackup) {
    prefix="String_Node_Str";
    EXT=mDevice.getRecoveryExt();
    CurrentName=mDevice.getRecoveryVersion();
  }
 else {
    prefix="String_Node_Str";
    EXT=mDevice.getKernelExt();
    CurrentName=mDevice.getKernelVersion();
  }
  final AppCompatDialog dialog=new AppCompatDialog(mContext);
  dialog.setTitle(R.string.setname);
  dialog.setContentView(R.layout.dialog_input);
  final AppCompatButton bGoBackup=(AppCompatButton)dialog.findViewById(R.id.bGoBackup);
  final AppCompatEditText etFileName=(AppCompatEditText)dialog.findViewById(R.id.etFileName);
  final AppCompatCheckBox optName=(AppCompatCheckBox)dialog.findViewById(R.id.cbOptInput);
  final String NameHint=prefix + "String_Node_Str" + Calendar.getInstance().get(Calendar.DATE)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.MONTH)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.YEAR)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.HOUR)+ "String_Node_Str"+ Calendar.getInstance().get(Calendar.MINUTE)+ EXT;
  optName.setText(CurrentName);
  optName.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      etFileName.setEnabled(!optName.isChecked());
    }
  }
);
  etFileName.setHint(NameHint);
  bGoBackup.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      String EXT;
      File Path;
      final int JOB;
      if (RecoveryBackup) {
        EXT=mDevice.getRecoveryExt();
        Path=Const.PathToRecoveryBackups;
        JOB=FlashUtil.JOB_BACKUP_RECOVERY;
      }
 else {
        EXT=mDevice.getKernelExt();
        Path=Const.PathToKernelBackups;
        JOB=FlashUtil.JOB_BACKUP_KERNEL;
      }
      CharSequence Name="String_Node_Str";
      if (optName.isChecked()) {
        Name=optName.getText() + EXT;
      }
 else {
        if (etFileName.getText() != null && !etFileName.getText().toString().equals("String_Node_Str")) {
          Name=etFileName.getText().toString();
        }
        if (Name.equals("String_Node_Str")) {
          Name=String.valueOf(etFileName.getHint());
        }
        if (!Name.toString().endsWith(EXT)) {
          Name=Name + EXT;
        }
      }
      final File fBACKUP=new File(Path,Name.toString());
      if (fBACKUP.exists()) {
        Toast.makeText(mActivity,R.string.backupalready,Toast.LENGTH_SHORT).show();
      }
 else {
        final FlashUtil BackupCreator=new FlashUtil(mActivity,fBACKUP,JOB);
        BackupCreator.setOnTaskDoneListener(new FlashUtil.OnTaskDoneListener(){
          @Override public void onSuccess(){
            mAdapter.reload();
          }
          @Override public void onFail(          Exception e){
          }
        }
);
        BackupCreator.execute();
      }
      dialog.dismiss();
    }
  }
);
  dialog.show();
}