From 15248a6dab2e729e53242a28e5778ca14deff2b6 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Sun, 26 Jul 2020 19:13:38 +0200 Subject: [PATCH] Add missing @NonNull and @Nullable annotations. --- .../activity/DownloadAuthenticationActivity.java | 4 +++- .../adapter/FeedItemlistDescriptionAdapter.java | 7 ++++++- .../dialog/EpisodesApplyActionFragment.java | 4 ++-- .../danoeh/antennapod/fragment/AddFeedFragment.java | 9 ++++++++- .../antennapod/fragment/AllEpisodesFragment.java | 2 +- .../antennapod/fragment/AudioPlayerFragment.java | 4 +++- .../fragment/CompletedDownloadsFragment.java | 2 +- .../antennapod/fragment/DownloadLogFragment.java | 13 ++++++++----- .../antennapod/fragment/DownloadsFragment.java | 7 +++++-- .../antennapod/fragment/EpisodesListFragment.java | 6 +++--- .../fragment/FavoriteEpisodesFragment.java | 6 ++++-- .../antennapod/fragment/FeedInfoFragment.java | 8 ++++---- .../antennapod/fragment/FeedItemlistFragment.java | 8 ++++---- .../danoeh/antennapod/core/event/DownloadEvent.java | 3 +++ .../antennapod/core/event/DownloadLogEvent.java | 3 +++ .../antennapod/core/event/DownloaderUpdate.java | 1 + .../antennapod/core/event/FavoritesEvent.java | 3 +++ .../danoeh/antennapod/core/event/FeedItemEvent.java | 3 ++- .../de/danoeh/antennapod/core/feed/FeedEvent.java | 3 +++ .../de/danoeh/antennapod/core/feed/FeedItem.java | 3 +++ .../core/glide/ChapterImageModelLoader.java | 10 +++++++--- .../core/glide/FastBlurTransformation.java | 5 ++++- .../antennapod/core/storage/DownloadRequester.java | 2 +- .../antennapod/core/sync/model/EpisodeAction.java | 2 ++ .../core/sync/model/EpisodeActionChanges.java | 1 + 25 files changed, 85 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java index 810005d2d..1d3d9bf11 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java @@ -3,6 +3,8 @@ package de.danoeh.antennapod.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; + +import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import android.widget.Button; @@ -86,7 +88,7 @@ public class DownloadAuthenticationActivity extends AppCompatActivity { } @Override - protected void onSaveInstanceState(Bundle outState) { + protected void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putString("username", etxtUsername.getText().toString()); outState.putString("password", etxtPassword.getText().toString()); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java index 690bb9e3d..6bfd34d5c 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java @@ -7,6 +7,10 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.MediaType; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; @@ -32,8 +36,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter { super(context, resource, objects); } + @NonNull @Override - public View getView(int position, View convertView, ViewGroup parent) { + public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { Holder holder; FeedItem item = getItem(position); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 6af35fa55..c3177668a 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -220,7 +220,7 @@ public class EpisodesApplyActionFragment extends Fragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.episodes_apply_action_options, menu); @@ -236,7 +236,7 @@ public class EpisodesApplyActionFragment extends Fragment { } @Override - public void onPrepareOptionsMenu(Menu menu) { + public void onPrepareOptionsMenu(@NonNull Menu menu) { // Prepare icon for select toggle button int[] icon = new int[1]; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index 546684f14..167daa08b 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -12,9 +12,13 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; @@ -36,7 +40,10 @@ public class AddFeedFragment extends Fragment { private MainActivity activity; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + @Nullable + public View onCreateView(@NonNull LayoutInflater inflater, + @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View root = inflater.inflate(R.layout.addfeed, container, false); activity = (MainActivity) getActivity(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index ce2e9575c..f66032bc7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -56,7 +56,7 @@ public class AllEpisodesFragment extends EpisodesListFragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); menu.findItem(R.id.filter_items).setVisible(true); menu.findItem(R.id.mark_all_read_item).setVisible(true); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java index 9c2030c2f..7eb749681 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java @@ -92,7 +92,9 @@ public class AudioPlayerFragment extends Fragment implements private boolean showTimeLeft; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, + @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View root = inflater.inflate(R.layout.audioplayer_fragment, container, false); toolbar = root.findViewById(R.id.toolbar); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java index 13941dd2c..3c39dc579 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java @@ -104,7 +104,7 @@ public class CompletedDownloadsFragment extends Fragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.downloads_completed, menu); menu.findItem(R.id.episode_actions).setVisible(items.size() > 0); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java index 1d36345ca..24f7fd85a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java @@ -6,6 +6,9 @@ import android.content.ClipboardManager; import android.content.Context; import android.content.res.TypedArray; import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.ListFragment; import android.util.Log; @@ -69,7 +72,7 @@ public class DownloadLogFragment extends ListFragment { } @Override - public void onViewCreated(View view, Bundle savedInstanceState) { + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // add padding final ListView lv = getListView(); @@ -101,7 +104,7 @@ public class DownloadLogFragment extends ListFragment { } @Override - public void onListItemClick(ListView l, View v, int position, long id) { + public void onListItemClick(@NonNull ListView l, @NonNull View v, int position, long id) { super.onListItemClick(l, v, position, id); DownloadStatus status = adapter.getItem(position); @@ -161,7 +164,7 @@ public class DownloadLogFragment extends ListFragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { if (!isAdded()) { return; } @@ -174,7 +177,7 @@ public class DownloadLogFragment extends ListFragment { } @Override - public void onPrepareOptionsMenu(Menu menu) { + public void onPrepareOptionsMenu(@NonNull Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem menuItem = menu.findItem(R.id.clear_history_item); if (menuItem != null) { @@ -183,7 +186,7 @@ public class DownloadLogFragment extends ListFragment { } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (!super.onOptionsItemSelected(item)) { switch (item.getItemId()) { case R.id.clear_history_item: diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java index cf0c6db90..c173bf8ee 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java @@ -8,6 +8,7 @@ import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; @@ -39,7 +40,9 @@ public class DownloadsFragment extends Fragment { private TabLayout tabLayout; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, + @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View root = inflater.inflate(R.layout.pager_fragment, container, false); Toolbar toolbar = root.findViewById(R.id.toolbar); @@ -76,7 +79,7 @@ public class DownloadsFragment extends Fragment { } @Override - public void onViewCreated(View view, Bundle savedInstanceState) { + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (getArguments() != null) { int tab = getArguments().getInt(ARG_SELECTED_TAB); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java index 29b6a1b16..44f6c8827 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java @@ -120,7 +120,7 @@ public abstract class EpisodesListFragment extends Fragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { if (!isAdded()) { return; } @@ -131,7 +131,7 @@ public abstract class EpisodesListFragment extends Fragment { } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (!super.onOptionsItemSelected(item)) { switch (item.getItemId()) { case R.id.refresh_item: @@ -176,7 +176,7 @@ public abstract class EpisodesListFragment extends Fragment { } @Override - public boolean onContextItemSelected(MenuItem item) { + public boolean onContextItemSelected(@NonNull MenuItem item) { Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]"); if (!getUserVisibleHint()) { return false; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java index 4f8b4f00c..d50be88c5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java @@ -53,12 +53,14 @@ public class FavoriteEpisodesFragment extends EpisodesListFragment { ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { @Override - public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { + public boolean onMove(@NonNull RecyclerView recyclerView, + @NonNull RecyclerView.ViewHolder viewHolder, + @NonNull RecyclerView.ViewHolder target) { return false; } @Override - public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) { + public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int swipeDir) { EpisodeItemViewHolder holder = (EpisodeItemViewHolder) viewHolder; Log.d(TAG, String.format("remove(%s)", holder.getFeedItem().getId())); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java index 071fa9f54..ae03b5032 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java @@ -162,7 +162,7 @@ public class FeedInfoFragment extends Fragment { } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NonNull Configuration newConfig) { super.onConfigurationChanged(newConfig); int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing); header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom()); @@ -227,7 +227,7 @@ public class FeedInfoFragment extends Fragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.feedinfo, menu); optionsMenu = menu; @@ -235,7 +235,7 @@ public class FeedInfoFragment extends Fragment { } @Override - public void onPrepareOptionsMenu(Menu menu) { + public void onPrepareOptionsMenu(@NonNull Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null); menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null @@ -243,7 +243,7 @@ public class FeedInfoFragment extends Fragment { } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (feed == null) { ((MainActivity) getActivity()).showSnackbarAbovePlayer( R.string.please_wait_for_data, Toast.LENGTH_LONG); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 950fb47c6..02df1c969 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -228,7 +228,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem }; @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { if (!isAdded()) { return; } @@ -246,21 +246,21 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem } @Override - public void onPrepareOptionsMenu(Menu menu) { + public void onPrepareOptionsMenu(@NonNull Menu menu) { if (feed != null) { FeedMenuHandler.onPrepareOptionsMenu(menu, feed); } } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NonNull Configuration newConfig) { super.onConfigurationChanged(newConfig); int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing); header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom()); } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (!super.onOptionsItemSelected(item)) { if (feed == null) { ((MainActivity) getActivity()).showSnackbarAbovePlayer( diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java index 24a71ec96..efd53ab9d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.core.event; +import androidx.annotation.NonNull; + import java.util.ArrayList; import java.util.List; @@ -19,6 +21,7 @@ public class DownloadEvent { return new DownloadEvent(update); } + @NonNull @Override public String toString() { return "DownloadEvent{" + diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadLogEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadLogEvent.java index 7428c5b00..5ab5decf9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadLogEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadLogEvent.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.core.event; +import androidx.annotation.NonNull; + public class DownloadLogEvent { private DownloadLogEvent() { @@ -9,6 +11,7 @@ public class DownloadLogEvent { return new DownloadLogEvent(); } + @NonNull @Override public String toString() { return "DownloadLogEvent"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java index f549940b7..10992408d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java @@ -46,6 +46,7 @@ public class DownloaderUpdate { this.mediaIds = mediaIds1.toArray(); } + @NonNull @Override public String toString() { return "DownloaderUpdate{" + diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/FavoritesEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/FavoritesEvent.java index 578007561..d3be8fac0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/FavoritesEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/FavoritesEvent.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.core.event; +import androidx.annotation.NonNull; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -27,6 +29,7 @@ public class FavoritesEvent { return new FavoritesEvent(Action.REMOVED, item); } + @NonNull @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/FeedItemEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/FeedItemEvent.java index 4b14a72d2..02559b2f5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/FeedItemEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/FeedItemEvent.java @@ -21,7 +21,7 @@ public class FeedItemEvent { private final Action action; @NonNull public final List items; - private FeedItemEvent(Action action, List items) { + private FeedItemEvent(@NonNull Action action, @NonNull List items) { this.action = action; this.items = items; } @@ -42,6 +42,7 @@ public class FeedItemEvent { return updated(Arrays.asList(items)); } + @NonNull @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedEvent.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedEvent.java index 15cdf92dc..044554451 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedEvent.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.core.feed; +import androidx.annotation.NonNull; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -18,6 +20,7 @@ public class FeedEvent { this.feedId = feedId; } + @NonNull @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index 60ebe6965..b681c21d1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -1,6 +1,8 @@ package de.danoeh.antennapod.core.feed; import android.database.Cursor; + +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import android.text.TextUtils; @@ -482,6 +484,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, ImageR */ public void removeTag(String tag) { tags.remove(tag); } + @NonNull @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ChapterImageModelLoader.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ChapterImageModelLoader.java index 36da11eca..35a9d987b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ChapterImageModelLoader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ChapterImageModelLoader.java @@ -28,8 +28,9 @@ import org.apache.commons.io.IOUtils; public final class ChapterImageModelLoader implements ModelLoader { public static class Factory implements ModelLoaderFactory { + @NonNull @Override - public ModelLoader build(MultiModelLoaderFactory unused) { + public ModelLoader build(@NonNull MultiModelLoaderFactory unused) { return new ChapterImageModelLoader(); } @@ -41,12 +42,15 @@ public final class ChapterImageModelLoader implements ModelLoader buildLoadData(EmbeddedChapterImage model, int width, int height, Options options) { + public LoadData buildLoadData(@NonNull EmbeddedChapterImage model, + int width, + int height, + @NonNull Options options) { return new LoadData<>(new ObjectKey(model), new EmbeddedImageFetcher(model)); } @Override - public boolean handles(EmbeddedChapterImage model) { + public boolean handles(@NonNull EmbeddedChapterImage model) { return true; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java b/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java index d0301db2f..1f8ae5ad9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java @@ -21,7 +21,10 @@ public class FastBlurTransformation extends BitmapTransformation { } @Override - protected Bitmap transform(BitmapPool pool, Bitmap source, int outWidth, int outHeight) { + protected Bitmap transform(@NonNull BitmapPool pool, + @NonNull Bitmap source, + int outWidth, + int outHeight) { int targetWidth = outWidth / 3; int targetHeight = (int) (1.0 * outHeight * targetWidth / outWidth); Bitmap resized = ThumbnailUtils.extractThumbnail(source, targetWidth, targetHeight); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index f10dde65f..e3121caa2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -340,7 +340,7 @@ public class DownloadRequester implements DownloadStateProvider { /** * Checks if feedfile is in the downloads list */ - public synchronized boolean isDownloadingFile(FeedFile item) { + public synchronized boolean isDownloadingFile(@NonNull FeedFile item) { return item.getDownload_url() != null && downloads.containsKey(item.getDownload_url()); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeAction.java b/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeAction.java index 6154ccc84..798be8d96 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeAction.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeAction.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.sync.model; import android.text.TextUtils; import android.util.Log; +import androidx.annotation.NonNull; import androidx.core.util.ObjectsCompat; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.util.DateUtils; @@ -179,6 +180,7 @@ public class EpisodeAction { return obj; } + @NonNull @Override public String toString() { return "EpisodeAction{" diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeActionChanges.java b/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeActionChanges.java index 77942ffa0..90af585af 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeActionChanges.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/model/EpisodeActionChanges.java @@ -23,6 +23,7 @@ public class EpisodeActionChanges { return this.timestamp; } + @NonNull @Override public String toString() { return "EpisodeActionGetResponse{"