Program: 17545
Project: 17545
Buggy source:
/** 
 * Cards on FlashRecovery and FlashKernel Dialog
 */
public void FlashSupportedRecovery(Card card){
  final File path;
  final ArrayList<String> Versions;
  String SYSTEM=card.getData().toString();
  ArrayAdapter<String> VersionsAdapter=new ArrayAdapter<>(mContext,R.layout.custom_list_item);
switch (SYSTEM) {
case "String_Node_Str":
    Versions=mDevice.getStockRecoveryVersions();
  path=Const.PathToStockRecovery;
break;
case "String_Node_Str":
Versions=mDevice.getCwmRecoveryVersions();
path=Const.PathToCWM;
break;
case "String_Node_Str":
Versions=mDevice.getTwrpRecoveryVersions();
path=Const.PathToTWRP;
break;
case "String_Node_Str":
Versions=mDevice.getPhilzRecoveryVersions();
path=Const.PathToPhilz;
break;
default :
return;
}
for (String i : Versions) {
VersionsAdapter.add(formatName(i,SYSTEM));
}
final AlertDialog.Builder RecoveriesDialog=new AlertDialog.Builder(mContext);
RecoveriesDialog.setTitle(SYSTEM.toUpperCase());
RecoveriesDialog.setAdapter(VersionsAdapter,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialog,int which){
final String fileName=Versions.get(which);
final File recovery=new File(path,fileName);
if (!recovery.exists()) {
try {
URL url=new URL(Const.RECOVERY_URL + "String_Node_Str" + fileName);
DownloadDialog RecoveryDownloader=new DownloadDialog(mContext,url,recovery);
RecoveryDownloader.setOnDownloadListener(new DownloadDialog.OnDownloadListener(){
@Override public void success(File file){
flashRecovery(file);
}
@Override public void failed(Exception e){
}
}
);
RecoveryDownloader.setRetry(true);
RecoveryDownloader.setAskBeforeDownload(true);
RecoveryDownloader.setChecksumFile(Const.RecoveryCollectionFile);
RecoveryDownloader.ask();
}
 catch (MalformedURLException ignored) {
}
}
 else {
flashRecovery(recovery);
}
}
}
);
RecoveriesDialog.show();
}

Fixed version (ground truth):
/** 
 * Cards on FlashRecovery and FlashKernel Dialog
 */
public void FlashSupportedRecovery(Card card){
  final File path;
  final ArrayList<String> Versions;
  String SYSTEM=card.getData().toString();
  ArrayAdapter<String> VersionsAdapter=new ArrayAdapter<>(mContext,R.layout.custom_list_item);
switch (SYSTEM) {
case "String_Node_Str":
    Versions=mDevice.getStockRecoveryVersions();
  path=Const.PathToStockRecovery;
break;
case "String_Node_Str":
Versions=mDevice.getCwmRecoveryVersions();
path=Const.PathToCWM;
break;
case "String_Node_Str":
Versions=mDevice.getTwrpRecoveryVersions();
path=Const.PathToTWRP;
break;
case "String_Node_Str":
Versions=mDevice.getPhilzRecoveryVersions();
path=Const.PathToPhilz;
break;
default :
return;
}
for (String i : Versions) {
VersionsAdapter.add(formatName(i,SYSTEM));
}
final AlertDialog.Builder RecoveriesDialog=new AlertDialog.Builder(mContext);
RecoveriesDialog.setTitle(SYSTEM.toUpperCase());
RecoveriesDialog.setAdapter(VersionsAdapter,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialog,int which){
final String fileName=Versions.get(which);
final File recovery=new File(path,fileName);
if (!recovery.exists()) {
try {
URL url=new URL(Const.RECOVERY_URL + "String_Node_Str" + fileName);
final Downloader downloader=new Downloader(url,recovery);
final DownloadDialog RecoveryDownloader=new DownloadDialog(mContext,downloader);
RecoveryDownloader.setOnDownloadListener(new DownloadDialog.OnDownloadListener(){
@Override public void onSuccess(File file){
flashRecovery(file);
}
@Override public void onFail(Exception e){
RecoveryDownloader.retry();
}
}
);
RecoveryDownloader.setAskBeforeDownload(true);
downloader.setChecksumFile(Const.RecoveryCollectionFile);
RecoveryDownloader.ask();
}
 catch (MalformedURLException ignored) {
}
}
 else {
flashRecovery(recovery);
}
}
}
);
RecoveriesDialog.show();
}