diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java index 49ce954bc..877fccea6 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java @@ -113,7 +113,7 @@ public class DirectoryChooserActivity extends AppCompatActivity { }); butNavUp.setOnClickListener(v -> { - File parent = null; + File parent; if (selectedDir != null && (parent = selectedDir.getParentFile()) != null) { changeDirectory(parent); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index e66032e11..9da83435e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -194,7 +194,7 @@ public class NavListAdapter extends BaseAdapter @Override public View getView(int position, View convertView, ViewGroup parent) { int viewType = getItemViewType(position); - View v = null; + View v; if (viewType == VIEW_TYPE_NAV) { v = getNavView((String) getItem(position), position, convertView, parent); } else if (viewType == VIEW_TYPE_SECTION_DIVIDER) { diff --git a/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java b/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java index a4daa9109..0e1846f1c 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java +++ b/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java @@ -54,7 +54,7 @@ class NestedScrollableHost extends FrameLayout { touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); } - private int touchSlop = 0; + private int touchSlop; private float initialX = 0f; private float initialY = 0f; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index f39ac0df8..7585e9d33 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -121,7 +121,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService { views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer); try { - Bitmap icon = null; + Bitmap icon; int iconSize = getResources().getDimensionPixelSize(android.R.dimen.app_icon_size); icon = Glide.with(PlayerWidgetJobService.this) .asBitmap() diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 54b8d321a..96665bd51 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -189,7 +189,7 @@ public class HttpDownloader extends Downloader { } byte[] buffer = new byte[BUFFER_SIZE]; - int count = 0; + int count; request.setStatusMsg(R.string.download_running); Log.d(TAG, "Getting size of download"); request.setSize(responseBody.contentLength() + request.getSoFar()); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 4ec9cce63..a13f03e9f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -582,7 +582,7 @@ public final class DBReader { } private static String getImageAuthentication(final String imageUrl, PodDBAdapter adapter) { - String credentials = null; + String credentials; try (Cursor cursor = adapter.getImageAuthenticationCursor(imageUrl)) { if (cursor.moveToFirst()) { String username = cursor.getString(0); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index e6d47b32a..8a3f44e18 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -1218,7 +1218,7 @@ public class PodDBAdapter { public Cursor searchItems(long feedID, String searchQuery) { String preparedQuery = prepareSearchQuery(searchQuery); - String queryFeedId = ""; + String queryFeedId; if (feedID != 0) { // search items in specific feed queryFeedId = KEY_FEED + " = " + feedID; diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/gpoddernet/GpodnetService.java b/core/src/main/java/de/danoeh/antennapod/core/sync/gpoddernet/GpodnetService.java index eae7a08af..704113c57 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/gpoddernet/GpodnetService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/gpoddernet/GpodnetService.java @@ -519,8 +519,8 @@ public class GpodnetService implements ISyncService { private String executeRequest(@NonNull Request.Builder requestB) throws GpodnetServiceException { Request request = requestB.build(); - String responseString = null; - Response response = null; + String responseString; + Response response; ResponseBody body = null; try { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java index cdf171299..9277af6e6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java @@ -39,7 +39,7 @@ class OggInputStream extends InputStream { private void readOggPage() throws IOException { // find OggS int[] buffer = new int[4]; - int c = 0; + int c; boolean isInOggS = false; while ((c = input.read()) != -1) { switch (c) {