Source:
<code>private void downloadItem(TranslationRowData translationRowData) { <START> if (!(translationRowData instanceof TranslationItem)) { <END> return; } TranslationItem selectedItem = (TranslationItem) translationRowData; if (selectedItem.exists() && !selectedItem.needsUpgrade()) { return; } downloadingItem = selectedItem; if (mDownloadReceiver == null) { mDownloadReceiver = new DefaultDownloadReceiver(this, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); LocalBroadcastManager.getInstance(this).registerReceiver( mDownloadReceiver, new IntentFilter( QuranDownloadNotifier.ProgressIntent.INTENT_NAME)); } mDownloadReceiver.setListener(this); String url = selectedItem.translation.fileUrl; if (selectedItem.translation.fileUrl == null) { return; } String destination = databaseDirectory; Timber.d("downloading %s to %s", url, destination); if (selectedItem.exists()) { try { File f = new File(destination, selectedItem.translation.filename); if (f.exists()) { File newPath = new File(destination, selectedItem.translation.filename + UPGRADING_EXTENSION); if (newPath.exists()) { newPath.delete(); } f.renameTo(newPath); } } catch (Exception e) { Timber.d(e, "error backing database file up"); } } String notificationTitle = selectedItem.name(); Intent intent = ServiceIntentHelper.getDownloadIntent(this, url, destination, notificationTitle, TRANSLATION_DOWNLOAD_KEY, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); String filename = selectedItem.translation.filename; if (url.endsWith("zip")) { filename += ".zip"; } intent.putExtra(QuranDownloadService.EXTRA_OUTPUT_FILE_NAME, filename); startService(intent); }</code><technical_language>this instanceof is longer needed</technical_language>

Target:
private void downloadItem(TranslationRowData translationRowData) { TranslationItem selectedItem = (TranslationItem) translationRowData; if (selectedItem.exists() && !selectedItem.needsUpgrade()) { return; } downloadingItem = selectedItem; if (mDownloadReceiver == null) { mDownloadReceiver = new DefaultDownloadReceiver(this, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); LocalBroadcastManager.getInstance(this).registerReceiver( mDownloadReceiver, new IntentFilter( QuranDownloadNotifier.ProgressIntent.INTENT_NAME)); } mDownloadReceiver.setListener(this); String url = selectedItem.translation.fileUrl; if (selectedItem.translation.fileUrl == null) { return; } String destination = databaseDirectory; Timber.d("downloading %s to %s", url, destination); if (selectedItem.exists()) { try { File f = new File(destination, selectedItem.translation.filename); if (f.exists()) { File newPath = new File(destination, selectedItem.translation.filename + UPGRADING_EXTENSION); if (newPath.exists()) { newPath.delete(); } f.renameTo(newPath); } } catch (Exception e) { Timber.d(e, "error backing database file up"); } } String notificationTitle = selectedItem.name(); Intent intent = ServiceIntentHelper.getDownloadIntent(this, url, destination, notificationTitle, TRANSLATION_DOWNLOAD_KEY, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); String filename = selectedItem.translation.filename; if (url.endsWith("zip")) { filename += ".zip"; } intent.putExtra(QuranDownloadService.EXTRA_OUTPUT_FILE_NAME, filename); startService(intent); }