diff options
87 files changed, 202 insertions, 200 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index aca8b7b0a..3af22af9d 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -48,13 +48,13 @@ class UITestUtils { private static final String TEST_FILE_NAME = "3sec.mp3"; - private Context context; - private HTTPBin server = new HTTPBin(); + private final Context context; + private final HTTPBin server = new HTTPBin(); private File destDir; private File hostedFeedDir; private File hostedMediaDir; - public List<Feed> hostedFeeds = new ArrayList<>(); + public final List<Feed> hostedFeeds = new ArrayList<>(); public UITestUtils(Context context) { this.context = context; diff --git a/app/src/androidTest/java/de/test/antennapod/util/service/download/HTTPBin.java b/app/src/androidTest/java/de/test/antennapod/util/service/download/HTTPBin.java index 23be5ad4a..cde93fd7e 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/service/download/HTTPBin.java +++ b/app/src/androidTest/java/de/test/antennapod/util/service/download/HTTPBin.java @@ -45,7 +45,7 @@ public class HTTPBin extends NanoHTTPD { private static final String MIME_HTML = "text/html"; private static final String MIME_PLAIN = "text/plain"; - private List<File> servedFiles; + private final List<File> servedFiles; public HTTPBin() { super(PORT); diff --git a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java index 0ce9df0aa..e0694a0d9 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java +++ b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java @@ -104,7 +104,7 @@ public abstract class NanoHTTPD { private final String hostname; private final int myPort; private ServerSocket myServerSocket; - private Set<Socket> openConnections = new HashSet<>(); + private final Set<Socket> openConnections = new HashSet<>(); private Thread myThread; /** * Pluggable strategy for asynchronously executing requests. @@ -557,7 +557,7 @@ public abstract class NanoHTTPD { /** * Headers for the HTTP response. Use addHeader() to add lines. */ - private Map<String, String> header = new ArrayMap<>(); + private final Map<String, String> header = new ArrayMap<>(); /** * The request method that spawned this response. */ @@ -838,7 +838,7 @@ public abstract class NanoHTTPD { public static final int BUFSIZE = 8192; private final TempFileManager tempFileManager; private final OutputStream outputStream; - private PushbackInputStream inputStream; + private final PushbackInputStream inputStream; private int splitbyte; private int rlen; private String uri; @@ -1320,7 +1320,9 @@ public abstract class NanoHTTPD { } public static class Cookie { - private String n, v, e; + private final String n; + private final String v; + private final String e; public Cookie(String name, String value, String expires) { n = name; @@ -1360,8 +1362,8 @@ public abstract class NanoHTTPD { * @author LordFokas */ public class CookieHandler implements Iterable<String> { - private ArrayMap<String, String> cookies = new ArrayMap<>(); - private ArrayList<Cookie> queue = new ArrayList<>(); + private final ArrayMap<String, String> cookies = new ArrayMap<>(); + private final ArrayList<Cookie> queue = new ArrayList<>(); public CookieHandler(Map<String, String> httpHeaders) { String raw = httpHeaders.get("cookie"); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 2b6cd8511..123f66661 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -21,7 +21,7 @@ import de.danoeh.antennapod.dialog.VariableSpeedDialog; public class AudioplayerActivity extends MediaplayerInfoActivity { private static final String TAG = "AudioPlayerActivity"; - private AtomicBoolean isSetup = new AtomicBoolean(false); + private final AtomicBoolean isSetup = new AtomicBoolean(false); @Override protected void onResume() { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/CastplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/CastplayerActivity.java index 07eae3752..871e9c279 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/CastplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/CastplayerActivity.java @@ -15,7 +15,7 @@ import de.danoeh.antennapod.core.service.playback.PlaybackService; public class CastplayerActivity extends MediaplayerInfoActivity { private static final String TAG = "CastPlayerActivity"; - private AtomicBoolean isSetup = new AtomicBoolean(false); + private final AtomicBoolean isSetup = new AtomicBoolean(false); @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 21951dc0e..7580becdc 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -100,7 +100,7 @@ public class FeedInfoActivity extends AppCompatActivity { private boolean authInfoChanged = false; - private TextWatcher authTextWatcher = new TextWatcher() { + private final TextWatcher authTextWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @@ -117,7 +117,7 @@ public class FeedInfoActivity extends AppCompatActivity { private boolean filterTextChanged = false; - private TextWatcher filterTextWatcher = new TextWatcher() { + private final TextWatcher filterTextWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 16bd1217c..f56dca173 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -398,7 +398,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi } } - private AdapterView.OnItemClickListener navListClickListener = new AdapterView.OnItemClickListener() { + private final AdapterView.OnItemClickListener navListClickListener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { int viewType = parent.getAdapter().getItemViewType(position); @@ -409,7 +409,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi } }; - private AdapterView.OnItemLongClickListener newListLongClickListener = new AdapterView.OnItemLongClickListener() { + private final AdapterView.OnItemLongClickListener newListLongClickListener = new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { if(position < navAdapter.getTags().size()) { @@ -630,7 +630,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi private DBReader.NavDrawerData navDrawerData; private int selectedNavListIndex = 0; - private NavListAdapter.ItemAccess itemAccess = new NavListAdapter.ItemAccess() { + private final NavListAdapter.ItemAccess itemAccess = new NavListAdapter.ItemAccess() { @Override public int getCount() { if (navDrawerData != null) { @@ -748,7 +748,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi snackbar.show(); } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java index 03b47e615..ae7040e0e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java @@ -496,7 +496,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem snackbar.show(); } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index d9fe1f6e7..2cec70ff6 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -100,7 +100,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity { private Subscription download; private Subscription parser; private Subscription updater; - private EventDistributor.EventListener listener = new EventDistributor.EventListener() { + private final EventDistributor.EventListener listener = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EventDistributor.FEED_LIST_UPDATE) != 0) { @@ -581,7 +581,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity { private class FeedViewAuthenticationDialog extends AuthenticationDialog { - private String feedUrl; + private final String feedUrl; FeedViewAuthenticationDialog(Context context, int titleRes, String feedUrl) { super(context, titleRes, true, false, null, null); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java index d104a9e93..a2a49f54e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java @@ -164,7 +164,7 @@ public class StorageErrorActivity extends AppCompatActivity { startActivity(new Intent(this, MainActivity.class)); } - private BroadcastReceiver mediaUpdate = new BroadcastReceiver() { + private final BroadcastReceiver mediaUpdate = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 08d4ac54c..921b6b6ce 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -45,7 +45,7 @@ public class VideoplayerActivity extends MediaplayerActivity { private VideoControlsHider videoControlsHider = new VideoControlsHider(this); - private AtomicBoolean isSetup = new AtomicBoolean(false); + private final AtomicBoolean isSetup = new AtomicBoolean(false); private LinearLayout controls; private LinearLayout videoOverlay; @@ -173,7 +173,7 @@ public class VideoplayerActivity extends MediaplayerActivity { progressIndicator.setVisibility(View.INVISIBLE); } - private View.OnTouchListener onVideoviewTouched = (v, event) -> { + private final View.OnTouchListener onVideoviewTouched = (v, event) -> { if (event.getAction() == MotionEvent.ACTION_DOWN) { videoControlsHider.stop(); toggleVideoControlsVisibility(); @@ -353,7 +353,7 @@ public class VideoplayerActivity extends MediaplayerActivity { private static final int DELAY = 2500; - private WeakReference<VideoplayerActivity> activity; + private final WeakReference<VideoplayerActivity> activity; public VideoControlsHider(VideoplayerActivity activity) { this.activity = new WeakReference<>(activity); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index 172646211..715318db1 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -225,7 +225,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR return pos; } - private View.OnClickListener secondaryActionListener = new View.OnClickListener() { + private final View.OnClickListener secondaryActionListener = new View.OnClickListener() { @Override public void onClick(View v) { FeedItem item = (FeedItem) v.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index e271b5eed..2c6aa8f72 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -31,9 +31,9 @@ public class DownloadLogAdapter extends BaseAdapter { private final String TAG = "DownloadLogAdapter"; - private Context context; + private final Context context; - private ItemAccess itemAccess; + private final ItemAccess itemAccess; public DownloadLogAdapter(Context context, ItemAccess itemAccess) { super(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java index 807a32d8a..c62c30c90 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -110,7 +110,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { return convertView; } - private View.OnClickListener secondaryActionListener = new View.OnClickListener() { + private final View.OnClickListener secondaryActionListener = new View.OnClickListener() { @Override public void onClick(View v) { FeedItem item = (FeedItem) v.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java index f5865ba47..5bc67a95a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java @@ -22,8 +22,8 @@ public class DownloadlistAdapter extends BaseAdapter { private static final int SELECTION_NONE = -1; private int selectedItemIndex; - private ItemAccess itemAccess; - private Context context; + private final ItemAccess itemAccess; + private final Context context; public DownloadlistAdapter(Context context, ItemAccess itemAccess) { @@ -105,7 +105,7 @@ public class DownloadlistAdapter extends BaseAdapter { return convertView; } - private View.OnClickListener butSecondaryListener = new View.OnClickListener() { + private final View.OnClickListener butSecondaryListener = new View.OnClickListener() { @Override public void onClick(View v) { Downloader downloader = (Downloader) v.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index 71d162645..e29781be1 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -32,13 +32,13 @@ import de.danoeh.antennapod.core.util.ThemeUtils; */ public class FeedItemlistAdapter extends BaseAdapter { - private ActionButtonCallback callback; + private final ActionButtonCallback callback; private final ItemAccess itemAccess; private final Context context; - private boolean showFeedtitle; - private int selectedItemIndex; + private final boolean showFeedtitle; + private final int selectedItemIndex; /** true if played items should be made partially transparent */ - private boolean makePlayedItemsTransparent; + private final boolean makePlayedItemsTransparent; private final ActionButtonUtils actionButtonUtils; private static final int SELECTION_NONE = -1; 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 963a24429..2daa5e70f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -62,8 +62,8 @@ public class NavListAdapter extends BaseAdapter private static List<String> tags; private static String[] titles; - private ItemAccess itemAccess; - private WeakReference<Activity> activity; + private final ItemAccess itemAccess; + private final WeakReference<Activity> activity; private boolean showSubscriptionList = true; public NavListAdapter(ItemAccess itemAccess, Activity context) { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java index 8eebc919a..01dd4c2de 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -50,7 +50,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap private static final String TAG = QueueRecyclerAdapter.class.getSimpleName(); - private WeakReference<MainActivity> mainActivity; + private final WeakReference<MainActivity> mainActivity; private final ItemAccess itemAccess; private final ActionButtonCallback actionButtonCallback; private final ActionButtonUtils actionButtonUtils; @@ -304,7 +304,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap } - private View.OnClickListener secondaryActionListener = new View.OnClickListener() { + private final View.OnClickListener secondaryActionListener = new View.OnClickListener() { @Override public void onClick(View v) { FeedItem item = (FeedItem) v.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java index 8385ce2df..50255c11f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java @@ -23,7 +23,7 @@ import de.danoeh.antennapod.core.util.Converter; * Adapter for the statistics list */ public class StatisticsListAdapter extends BaseAdapter { - private Context context; + private final Context context; private List<DBReader.StatisticsItem> feedTime = new ArrayList<>(); private boolean countAll = true; diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/ExportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/ExportWorker.java index 453a87b85..b6cf5cb84 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/ExportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/ExportWorker.java @@ -23,8 +23,8 @@ public class ExportWorker { private static final String TAG = "ExportWorker"; private static final String DEFAULT_OUTPUT_NAME = "antennapod-feeds"; - private ExportWriter exportWriter; - private File output; + private final ExportWriter exportWriter; + private final File output; public ExportWorker(ExportWriter exportWriter) { this(exportWriter, new File(UserPreferences.getDataFolder(EXPORT_DIR), diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java index 5529e772f..ea5128102 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java @@ -15,9 +15,9 @@ import de.danoeh.antennapod.core.storage.DownloadRequester; /** Queues items for download in the background. */ public class OpmlFeedQueuer extends AsyncTask<Void, Void, Void> { - private Context context; + private final Context context; private ProgressDialog progDialog; - private int[] selection; + private final int[] selection; public OpmlFeedQueuer(Context context, int[] selection) { super(); diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java index 445b74d85..13b95907f 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java @@ -20,12 +20,12 @@ public class OpmlImportWorker extends AsyncTask<Void, Void, ArrayList<OpmlElement>> { private static final String TAG = "OpmlImportWorker"; - private Context context; + private final Context context; private Exception exception; private ProgressDialog progDialog; - private Reader mReader; + private final Reader mReader; public OpmlImportWorker(Context context, Reader reader) { super(); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index 53d200991..b9276982a 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -43,7 +43,7 @@ public class ProxyDialog { private static final String TAG = "ProxyDialog"; - private Context context; + private final Context context; private MaterialDialog dialog; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java index 5bb3f09c3..be7850495 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java @@ -24,7 +24,7 @@ public abstract class SleepTimerDialog { private static final String TAG = SleepTimerDialog.class.getSimpleName(); - private Context context; + private final Context context; private MaterialDialog dialog; private EditText etxtTime; 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 195b1558c..d750f7fe3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -346,7 +346,7 @@ public class AllEpisodesFragment extends Fragment { updateShowOnlyEpisodesListViewState(); } - private AllEpisodesRecycleAdapter.ItemAccess itemAccess = new AllEpisodesRecycleAdapter.ItemAccess() { + private final AllEpisodesRecycleAdapter.ItemAccess itemAccess = new AllEpisodesRecycleAdapter.ItemAccess() { @Override public int getCount() { @@ -444,7 +444,7 @@ public class AllEpisodesFragment extends Fragment { } } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 0) { 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 1ba7ed557..f37ecd5e7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java @@ -168,7 +168,7 @@ public class CompletedDownloadsFragment extends ListFragment { } } - private DownloadedEpisodesListAdapter.ItemAccess itemAccess = new DownloadedEpisodesListAdapter.ItemAccess() { + private final DownloadedEpisodesListAdapter.ItemAccess itemAccess = new DownloadedEpisodesListAdapter.ItemAccess() { @Override public int getCount() { return (items != null) ? items.size() : 0; @@ -189,7 +189,7 @@ public class CompletedDownloadsFragment extends ListFragment { } }; - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 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 0a710196a..9a4c9e030 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java @@ -82,7 +82,7 @@ public class DownloadLogFragment extends ListFragment { getActivity().supportInvalidateOptionsMenu(); } - private DownloadLogAdapter.ItemAccess itemAccess = new DownloadLogAdapter.ItemAccess() { + private final DownloadLogAdapter.ItemAccess itemAccess = new DownloadLogAdapter.ItemAccess() { @Override public int getCount() { @@ -99,7 +99,7 @@ public class DownloadLogFragment extends ListFragment { } }; - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { 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 6cc95c852..0e9e36df0 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java @@ -80,7 +80,7 @@ public class DownloadsFragment extends Fragment { public class DownloadsPagerAdapter extends FragmentPagerAdapter { - Resources resources; + final Resources resources; public DownloadsPagerAdapter(FragmentManager fm, Resources resources) { super(fm); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java index 6a7b40e28..8928d2bf3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java @@ -79,7 +79,7 @@ public class EpisodesFragment extends Fragment { public static class EpisodesPagerAdapter extends FragmentPagerAdapter { private final Resources resources; - private AllEpisodesFragment[] fragments = { + private final AllEpisodesFragment[] fragments = { new NewEpisodesFragment(), new AllEpisodesFragment(), new FavoriteEpisodesFragment() diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java index 0d1b1b7b6..6ee9ce467 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java @@ -49,7 +49,7 @@ public class FyydSearchFragment extends Fragment { private Button butRetry; private TextView txtvEmpty; - private FyydClient client = new FyydClient(AntennapodHttpClient.getHttpClient()); + private final FyydClient client = new FyydClient(AntennapodHttpClient.getHttpClient()); /** * List of podcasts retreived from the search diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index ffc0c4c8d..935fd7898 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -200,7 +200,7 @@ public class ItemDescriptionFragment extends Fragment implements MediaplayerInfo } - private View.OnLongClickListener webViewLongClickListener = new View.OnLongClickListener() { + private final View.OnLongClickListener webViewLongClickListener = new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index da7fc5299..66c01845c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -449,7 +449,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { } } - private View.OnLongClickListener webViewLongClickListener = new View.OnLongClickListener() { + private final View.OnLongClickListener webViewLongClickListener = new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { @@ -551,7 +551,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 0) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index e4bb0a28e..d9db41f82 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -405,7 +405,7 @@ public class ItemlistFragment extends ListFragment { } } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { @@ -571,7 +571,7 @@ public class ItemlistFragment extends ListFragment { } } - private FeedItemlistAdapter.ItemAccess itemAccess = new FeedItemlistAdapter.ItemAccess() { + private final FeedItemlistAdapter.ItemAccess itemAccess = new FeedItemlistAdapter.ItemAccess() { @Override public FeedItem getItem(int position) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 441f0096c..fb6280021 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -199,7 +199,7 @@ public class PlaybackHistoryFragment extends ListFragment { } } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { @@ -224,7 +224,7 @@ public class PlaybackHistoryFragment extends ListFragment { getActivity().supportInvalidateOptionsMenu(); } - private FeedItemlistAdapter.ItemAccess itemAccess = new FeedItemlistAdapter.ItemAccess() { + private final FeedItemlistAdapter.ItemAccess itemAccess = new FeedItemlistAdapter.ItemAccess() { @Override public int getItemDownloadProgressPercent(FeedItem item) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index fccb86076..f7624a5e9 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -519,7 +519,7 @@ public class QueueFragment extends Fragment { infoBar.setText(info); } - private QueueRecyclerAdapter.ItemAccess itemAccess = new QueueRecyclerAdapter.ItemAccess() { + private final QueueRecyclerAdapter.ItemAccess itemAccess = new QueueRecyclerAdapter.ItemAccess() { @Override public int getCount() { return queue != null ? queue.size() : 0; @@ -579,7 +579,7 @@ public class QueueFragment extends Fragment { } }; - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 0) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java index ba526edb3..66c59b7f7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java @@ -75,7 +75,7 @@ public class RunningDownloadsFragment extends ListFragment { } - private DownloadlistAdapter.ItemAccess itemAccess = new DownloadlistAdapter.ItemAccess() { + private final DownloadlistAdapter.ItemAccess itemAccess = new DownloadlistAdapter.ItemAccess() { @Override public int getCount() { return (downloaderList != null) ? downloaderList.size() : 0; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java index 9626e6c2e..c834b7ea7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java @@ -210,7 +210,7 @@ public class SubscriptionFragment extends Fragment { loadSubscriptions(); } - private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EVENTS & arg) != 0) { @@ -220,7 +220,7 @@ public class SubscriptionFragment extends Fragment { } }; - private SubscriptionsAdapter.ItemAccess itemAccess = new SubscriptionsAdapter.ItemAccess() { + private final SubscriptionsAdapter.ItemAccess itemAccess = new SubscriptionsAdapter.ItemAccess() { @Override public int getCount() { if (navDrawerData != null) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java index c5078eda0..b48027668 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java @@ -71,7 +71,7 @@ public class GpodnetMainFragment extends Fragment { private static final int POS_TAGS = 1; private static final int POS_SUGGESTIONS = 2; - Resources resources; + final Resources resources; public GpodnetPagerAdapter(FragmentManager fm, Resources resources) { super(fm); diff --git a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java index 53d4aba16..d5141bd37 100644 --- a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java +++ b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java @@ -193,7 +193,7 @@ public class PlayerWidgetService extends Service { } } - private ServiceConnection mConnection = new ServiceConnection() { + private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "Connection to service established"); synchronized (psLock) { @@ -223,7 +223,7 @@ public class PlayerWidgetService extends Service { class ViewUpdater extends Thread { private static final String THREAD_NAME = "ViewUpdater"; - private PlayerWidgetService service; + private final PlayerWidgetService service; public ViewUpdater(PlayerWidgetService service) { super(); diff --git a/core/src/free/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java b/core/src/free/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java index 423faf558..37109ddca 100644 --- a/core/src/free/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java +++ b/core/src/free/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java @@ -10,7 +10,7 @@ import android.support.v4.media.session.PlaybackStateCompat; */ class PlaybackServiceFlavorHelper { - private PlaybackService.FlavorHelperCallback callback; + private final PlaybackService.FlavorHelperCallback callback; PlaybackServiceFlavorHelper(Context context, PlaybackService.FlavorHelperCallback callback) { this.callback = callback; diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 137ede81b..1e0c07b01 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -14,9 +14,9 @@ import de.danoeh.antennapod.core.storage.DBWriter; /** Removes a feed in the background. */ public class FeedRemover extends AsyncTask<Void, Void, Void> { - private Context context; + private final Context context; private ProgressDialog dialog; - private Feed feed; + private final Feed feed; public boolean skipOnCompletion = false; public FeedRemover(Context context, Feed feed) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java index 4838a75d6..420a60469 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java @@ -19,7 +19,7 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils; public class FlattrStatusFetcher extends Thread { private static final String TAG = "FlattrStatusFetcher"; - private Context context; + private final Context context; public FlattrStatusFetcher(Context context) { super(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java index 5f19dbb78..985cabbf8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java @@ -22,10 +22,10 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils; public class FlattrTokenFetcher extends AsyncTask<Void, Void, AccessToken> { private static final String TAG = "FlattrTokenFetcher"; - private Context context; - private AndroidAuthenticator auth; + private final Context context; + private final AndroidAuthenticator auth; private AccessToken token; - private Uri uri; + private final Uri uri; private ProgressDialog dialog; private FlattrException exception; diff --git a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java index f7706cd5f..c626a8189 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java +++ b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java @@ -15,9 +15,9 @@ public abstract class ConfirmationDialog { private static final String TAG = ConfirmationDialog.class.getSimpleName(); - private Context context; - private int titleId; - private String message; + private final Context context; + private final int titleId; + private final String message; private int positiveText; private int negativeText; diff --git a/core/src/main/java/de/danoeh/antennapod/core/export/html/HtmlSymbols.java b/core/src/main/java/de/danoeh/antennapod/core/export/html/HtmlSymbols.java index b8807a686..1ca126469 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/export/html/HtmlSymbols.java +++ b/core/src/main/java/de/danoeh/antennapod/core/export/html/HtmlSymbols.java @@ -22,7 +22,7 @@ class HtmlSymbols extends CommonSymbols { static final String ORDERED_LIST = "ol"; static final String LIST_ITEM = "li"; - static String HEADING = "h1"; + static final String HEADING = "h1"; static final String LINK = "a"; static final String LINK_DESTINATION = "href"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java b/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java index 3c79e49ca..b769eaf55 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java @@ -27,8 +27,8 @@ public class EventDistributor extends Observable { public static final int DOWNLOAD_HANDLED = 64; public static final int PLAYER_STATUS_UPDATE = 128; - private Handler handler; - private AbstractQueue<Integer> events; + private final Handler handler; + private final AbstractQueue<Integer> events; private static EventDistributor instance; diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedFilter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedFilter.java index 35abb8de6..28161ac9b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedFilter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedFilter.java @@ -9,8 +9,8 @@ public class FeedFilter { private static final String TAG = "FeedFilter"; - private String includeFilter; - private String excludeFilter; + private final String includeFilter; + private final String excludeFilter; public FeedFilter() { this("", ""); 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 e0412f79c..7b387b1d3 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 @@ -59,7 +59,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr public static final int PLAYED = 1; private String paymentLink; - private FlattrStatus flattrStatus; + private final FlattrStatus flattrStatus; /** * Is true if the database contains any chapters that belong to this item. This attribute is only @@ -87,7 +87,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr /** * Any tags assigned to this item */ - private Set<String> tags = new HashSet<>(); + private final Set<String> tags = new HashSet<>(); public FeedItem() { this.state = UNPLAYED; diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java b/core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java index 9aa8d3170..ea8eb7871 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java @@ -1,11 +1,11 @@ package de.danoeh.antennapod.core.feed; public class SearchResult { - private FeedComponent component; + private final FeedComponent component; /** Additional information (e.g. where it was found) */ private String subtitle; /** Higher value means more importance */ - private int value; + private final int value; public SearchResult(FeedComponent component, int value, String subtitle) { super(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java index 7f248bcac..3e4f06a12 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java @@ -37,7 +37,7 @@ class ApOkHttpUrlLoader implements ModelLoader<String, InputStream> { public static class Factory implements ModelLoaderFactory<String, InputStream> { private static volatile OkHttpClient internalClient; - private OkHttpClient client; + private final OkHttpClient client; private static OkHttpClient getInternalClient() { if (internalClient == null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java index 2edecca65..84c085ed2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.gpoddernet; class GpodnetServiceBadStatusCodeException extends GpodnetServiceException { - private int statusCode; + private final int statusCode; public GpodnetServiceBadStatusCodeException(String message, int statusCode) { super(message); diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java index 79eb33cb5..faf4264e5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java @@ -4,10 +4,10 @@ import android.support.annotation.NonNull; public class GpodnetDevice { - private String id; - private String caption; - private DeviceType type; - private int subscriptions; + private final String id; + private final String caption; + private final DeviceType type; + private final int subscriptions; public GpodnetDevice(@NonNull String id, String caption, diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java index 191c0fa39..680dc1042 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java @@ -3,13 +3,13 @@ package de.danoeh.antennapod.core.gpoddernet.model; import android.support.annotation.NonNull; public class GpodnetPodcast { - private String url; - private String title; - private String description; - private int subscribers; - private String logoUrl; - private String website; - private String mygpoLink; + private final String url; + private final String title; + private final String description; + private final int subscribers; + private final String logoUrl; + private final String website; + private final String mygpoLink; public GpodnetPodcast(@NonNull String url, @NonNull String title, diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java index 6cc9b79a3..0f1961bef 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java @@ -5,9 +5,9 @@ import android.support.annotation.NonNull; import java.util.List; public class GpodnetSubscriptionChange { - private List<String> added; - private List<String> removed; - private long timestamp; + private final List<String> added; + private final List<String> removed; + private final long timestamp; public GpodnetSubscriptionChange(@NonNull List<String> added, @NonNull List<String> removed, diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java index d2281bc9e..b51b8d996 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java @@ -46,7 +46,7 @@ public class GpodnetPreferences { private static String deviceID; private static String hostname; - private static ReentrantLock feedListLock = new ReentrantLock(); + private static final ReentrantLock feedListLock = new ReentrantLock(); private static Set<String> addedFeeds; private static Set<String> removedFeeds; diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 72d62eba8..743ee135d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -125,7 +125,7 @@ public class UserPreferences { private static final int NOTIFICATION_BUTTON_REWIND = 0; private static final int NOTIFICATION_BUTTON_FAST_FORWARD = 1; private static final int NOTIFICATION_BUTTON_SKIP = 2; - private static int EPISODE_CACHE_SIZE_UNLIMITED = -1; + private static final int EPISODE_CACHE_SIZE_UNLIMITED = -1; public static final int FEED_ORDER_COUNTER = 0; public static final int FEED_ORDER_ALPHABETICAL = 1; public static final int FEED_ORDER_LAST_UPDATE = 2; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java index 7f45c5ae3..0e9ba9359 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java @@ -333,7 +333,7 @@ public class GpodnetSyncService extends Service { nm.notify(id, notification); } - private WaiterThread syncWaiterThread = new WaiterThread(WAIT_INTERVAL) { + private final WaiterThread syncWaiterThread = new WaiterThread(WAIT_INTERVAL) { @Override public void onWaitCompleted() { sync(); @@ -341,7 +341,7 @@ public class GpodnetSyncService extends Service { }; private abstract class WaiterThread { - private long waitInterval; + private final long waitInterval; private Thread thread; private WaiterThread(long waitInterval) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java index d910f6fef..9a64bebf7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java @@ -17,7 +17,7 @@ public class DownloadRequest implements Parcelable { private String username; private String password; private String lastModified; - private boolean deleteOnFailure; + private final boolean deleteOnFailure; private final long feedfileId; private final int feedfileType; private final Bundle arguments; @@ -254,15 +254,15 @@ public class DownloadRequest implements Parcelable { } public static class Builder { - private String destination; - private String source; - private String title; + private final String destination; + private final String source; + private final String title; private String username; private String password; private String lastModified; private boolean deleteOnFailure = false; - private long feedfileId; - private int feedfileType; + private final long feedfileId; + private final int feedfileType; private Bundle arguments; public Builder(@NonNull String destination, @NonNull FeedFile item) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index dd9ea8171..44861f8d1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -127,8 +127,8 @@ public class DownloadService extends Service { private NotificationCompat.Builder notificationCompatBuilder; - private int NOTIFICATION_ID = 2; - private int REPORT_ID = 3; + private final int NOTIFICATION_ID = 2; + private final int REPORT_ID = 3; /** * Currently running downloads. @@ -152,7 +152,7 @@ public class DownloadService extends Service { private static final int SCHED_EX_POOL_SIZE = 1; private ScheduledThreadPoolExecutor schedExecutor; - private Handler postHandler = new Handler(); + private final Handler postHandler = new Handler(); private final IBinder mBinder = new LocalBinder(); @@ -162,7 +162,7 @@ public class DownloadService extends Service { } } - private Thread downloadCompletionThread = new Thread() { + private final Thread downloadCompletionThread = new Thread() { private static final String TAG = "downloadCompletionThd"; @Override @@ -384,7 +384,7 @@ public class DownloadService extends Service { return null; } - private BroadcastReceiver cancelDownloadReceiver = new BroadcastReceiver() { + private final BroadcastReceiver cancelDownloadReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -604,9 +604,9 @@ public class DownloadService extends Service { private class FeedSyncThread extends Thread { private static final String TAG = "FeedSyncThread"; - private BlockingQueue<DownloadRequest> completedRequests = new LinkedBlockingDeque<>(); - private CompletionService<Pair<DownloadRequest, FeedHandlerResult>> parserService = new ExecutorCompletionService<>(Executors.newSingleThreadExecutor()); - private ExecutorService dbService = Executors.newSingleThreadExecutor(); + private final BlockingQueue<DownloadRequest> completedRequests = new LinkedBlockingDeque<>(); + private final CompletionService<Pair<DownloadRequest, FeedHandlerResult>> parserService = new ExecutorCompletionService<>(Executors.newSingleThreadExecutor()); + private final ExecutorService dbService = Executors.newSingleThreadExecutor(); private Future<?> dbUpdateFuture; private volatile boolean isActive = true; private volatile boolean isCollectingRequests = false; @@ -766,7 +766,7 @@ public class DownloadService extends Service { private class FeedParserTask implements Callable<Pair<DownloadRequest, FeedHandlerResult>> { - private DownloadRequest request; + private final DownloadRequest request; private FeedParserTask(DownloadRequest request) { this.request = request; @@ -952,8 +952,8 @@ public class DownloadService extends Service { */ private class FailedDownloadHandler implements Runnable { - private DownloadRequest request; - private DownloadStatus status; + private final DownloadRequest request; + private final DownloadStatus status; FailedDownloadHandler(DownloadStatus status, DownloadRequest request) { this.request = request; @@ -975,7 +975,7 @@ public class DownloadService extends Service { */ private class MediaHandlerThread implements Runnable { - private DownloadRequest request; + private final DownloadRequest request; private DownloadStatus status; MediaHandlerThread(@NonNull DownloadStatus status, diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java index a09790f9f..5debc6d05 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java @@ -25,7 +25,7 @@ public class DownloadStatus { * identify the download. Should be the title of the item/feed/media or the * URL if the download has no other title. */ - private String title; + private final String title; private DownloadError reason; /** * A message which can be presented to the user to give more information. @@ -34,13 +34,13 @@ public class DownloadStatus { private String reasonDetailed; private boolean successful; private Date completionDate; - private long feedfileId; + private final long feedfileId; /** * Is used to determine the type of the feedfile even if the feedfile does * not exist anymore. The value should be FEEDFILETYPE_FEED, * FEEDFILETYPE_FEEDIMAGE or FEEDFILETYPE_FEEDMEDIA */ - private int feedfileType; + private final int feedfileType; // ------------------------------------ NOT STORED IN DB private boolean done; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java index 4a3377d70..f09cbabb0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java @@ -18,8 +18,8 @@ public abstract class Downloader implements Callable<Downloader> { volatile boolean cancelled; - DownloadRequest request; - DownloadStatus result; + final DownloadRequest request; + final DownloadStatus result; Downloader(DownloadRequest request) { super(); 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 b409a419a..2bb20482c 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 @@ -316,7 +316,7 @@ public class HttpDownloader extends Downloader { private class BasicAuthorizationInterceptor implements Interceptor { - private DownloadRequest downloadRequest; + private final DownloadRequest downloadRequest; public BasicAuthorizationInterceptor(DownloadRequest downloadRequest) { this.downloadRequest = downloadRequest; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 6c99f1214..5f205c515 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -42,7 +42,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { private volatile boolean stream; private volatile MediaType mediaType; - private volatile AtomicBoolean startWhenPrepared; + private final AtomicBoolean startWhenPrepared; private volatile boolean pausedBecauseOfTransientAudiofocusLoss; private volatile Pair<Integer, Integer> videoSize; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index cb69078ca..417716810 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -1784,7 +1784,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } }; - private SharedPreferences.OnSharedPreferenceChangeListener prefListener = + private final SharedPreferences.OnSharedPreferenceChangeListener prefListener = (sharedPreferences, key) -> { if (UserPreferences.PREF_LOCKSCREEN_BACKGROUND.equals(key)) { updateMediaSessionMetadata(getPlayable()); @@ -1806,7 +1806,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { void unregisterReceiver(BroadcastReceiver receiver); } - private FlavorHelperCallback flavorHelperCallback = new FlavorHelperCallback() { + private final FlavorHelperCallback flavorHelperCallback = new FlavorHelperCallback() { @Override public PlaybackServiceMediaPlayer.PSMPCallback getMediaPlayerCallback() { return PlaybackService.this.mediaPlayerCallback; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java index 20b3cc6d6..bfd007310 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java @@ -365,9 +365,9 @@ public abstract class PlaybackServiceMediaPlayer { * Holds information about a PSMP object. */ public static class PSMPInfo { - public PlayerStatus oldPlayerStatus; - public PlayerStatus playerStatus; - public Playable playable; + public final PlayerStatus oldPlayerStatus; + public final PlayerStatus playerStatus; + public final Playable playable; PSMPInfo(PlayerStatus oldPlayerStatus, PlayerStatus playerStatus, Playable playable) { this.oldPlayerStatus = oldPlayerStatus; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ShakeListener.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ShakeListener.java index 53b5007b6..c0b1b3bc0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ShakeListener.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ShakeListener.java @@ -13,8 +13,8 @@ class ShakeListener implements SensorEventListener private Sensor mAccelerometer; private SensorManager mSensorMgr; - private PlaybackServiceTaskManager.SleepTimer mSleepTimer; - private Context mContext; + private final PlaybackServiceTaskManager.SleepTimer mSleepTimer; + private final Context mContext; public ShakeListener(Context context, PlaybackServiceTaskManager.SleepTimer sleepTimer) { mContext = context; 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 9a4ae1151..fa87cc216 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 @@ -1023,14 +1023,14 @@ public final class DBReader { /** * Simply sums up time of podcasts that are marked as played */ - public long totalTimeCountAll; + public final long totalTimeCountAll; /** * Respects speed, listening twice, ... */ - public long totalTime; + public final long totalTime; - public List<StatisticsItem> feedTime; + public final List<StatisticsItem> feedTime; public StatisticsData(long totalTime, long totalTimeCountAll, List<StatisticsItem> feedTime) { this.totalTime = totalTime; @@ -1040,26 +1040,26 @@ public final class DBReader { } public static class StatisticsItem { - public Feed feed; - public long time; + public final Feed feed; + public final long time; /** * Respects speed, listening twice, ... */ - public long timePlayed; + public final long timePlayed; /** * Simply sums up time of podcasts that are marked as played */ - public long timePlayedCountAll; - public long episodes; + public final long timePlayedCountAll; + public final long episodes; /** * Episodes that are actually played */ - public long episodesStarted; + public final long episodesStarted; /** * All episodes that are marked as played (or have position != 0) */ - public long episodesStartedIncludingMarked; + public final long episodesStartedIncludingMarked; public StatisticsItem(Feed feed, long time, long timePlayed, long timePlayedCountAll, long episodes, long episodesStarted, long episodesStartedIncludingMarked) { @@ -1195,12 +1195,12 @@ public final class DBReader { } public static class NavDrawerData { - public List<Feed> feeds; - public int queueSize; - public int numNewItems; - public int numDownloadedItems; - public LongIntMap feedCounters; - public int reclaimableSpace; + public final List<Feed> feeds; + public final int queueSize; + public final int numNewItems; + public final int numDownloadedItems; + public final LongIntMap feedCounters; + public final int reclaimableSpace; public NavDrawerData(List<Feed> feeds, int queueSize, diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 4e332c3ad..573954412 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -53,7 +53,7 @@ public final class DBTasks { /** * Executor service used by the autodownloadUndownloadedEpisodes method. */ - private static ExecutorService autodownloadExec; + private static final ExecutorService autodownloadExec; static { autodownloadExec = Executors.newSingleThreadExecutor(r -> { @@ -149,7 +149,7 @@ public final class DBTasks { } } - private static AtomicBoolean isRefreshing = new AtomicBoolean(false); + private static final AtomicBoolean isRefreshing = new AtomicBoolean(false); /** * Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still @@ -803,7 +803,7 @@ public final class DBTasks { */ abstract static class QueryTask<T> implements Callable<T> { private T result; - private Context context; + private final Context context; public QueryTask(Context context) { this.context = context; 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 0e0165a37..a8fd79fda 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 @@ -48,7 +48,7 @@ public class DownloadRequester { private static DownloadRequester downloader; - private Map<String, DownloadRequest> downloads; + private final Map<String, DownloadRequest> downloads; private DownloadRequester() { downloads = new ConcurrentHashMap<>(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java index 6e2434659..d84279f6e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java @@ -8,11 +8,11 @@ import java.util.Date; * Contains information about a feed's items. */ public class FeedItemStatistics { - private long feedID; - private int numberOfItems; - private int numberOfNewItems; - private int numberOfInProgressItems; - private Date lastUpdate; + private final long feedID; + private final int numberOfItems; + private final int numberOfNewItems; + private final int numberOfInProgressItems; + private final Date lastUpdate; private static final Date UNKNOWN_DATE = new Date(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 aa11e94a3..460f9b661 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 @@ -309,8 +309,8 @@ public class PodDBAdapter { private static PodDBHelper dbHelper; private static volatile SQLiteDatabase db; - private static Lock dbLock = new ReentrantLock(); - private static AtomicInteger counter = new AtomicInteger(0); + private static final Lock dbLock = new ReentrantLock(); + private static final AtomicInteger counter = new AtomicInteger(0); public static void init(Context context) { PodDBAdapter.context = context.getApplicationContext(); @@ -1666,7 +1666,7 @@ public class PodDBAdapter { private static final int VERSION = 1060200; - private Context context; + private final Context context; /** * Constructor. diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java index f67721a6e..77300d864 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java @@ -9,8 +9,8 @@ import de.danoeh.antennapod.core.feed.Feed; */ public class FeedHandlerResult { - public Feed feed; - public Map<String, String> alternateFeedUrls; + public final Feed feed; + public final Map<String, String> alternateFeedUrls; public FeedHandlerResult(Feed feed, Map<String, String> alternateFeedUrls) { this.feed = feed; diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java index eec7ef096..530cbd0e9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java @@ -25,15 +25,15 @@ public class HandlerState { * Contains links to related feeds, e.g. feeds with enclosures in other formats. The key of the map is the * URL of the feed, the value is the title */ - Map<String, String> alternateUrls; - private ArrayList<FeedItem> items; + final Map<String, String> alternateUrls; + private final ArrayList<FeedItem> items; private FeedItem currentItem; - Stack<SyndElement> tagstack; + final Stack<SyndElement> tagstack; /** * Namespaces that have been defined so far. */ - Map<String, Namespace> namespaces; - Stack<Namespace> defaultNamespaces; + final Map<String, Namespace> namespaces; + final Stack<Namespace> defaultNamespaces; /** * Buffer for saving characters. */ @@ -42,7 +42,7 @@ public class HandlerState { /** * Temporarily saved objects. */ - private Map<String, Object> tempObjects; + private final Map<String, Object> tempObjects; public HandlerState(Feed feed) { this.feed = feed; diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java index ba73e06dd..17b2708aa 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java @@ -21,7 +21,7 @@ import de.danoeh.antennapod.core.syndication.namespace.atom.NSAtom; class SyndHandler extends DefaultHandler { private static final String TAG = "SyndHandler"; private static final String DEFAULT_PREFIX = ""; - HandlerState state; + final HandlerState state; public SyndHandler(Feed feed, TypeGetter.Type type) { state = new HandlerState(feed); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java index 3da9251d9..606f93faf 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java @@ -4,7 +4,7 @@ import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type; public class UnsupportedFeedtypeException extends Exception { private static final long serialVersionUID = 9105878964928170669L; - private TypeGetter.Type type; + private final TypeGetter.Type type; private String rootElement; public UnsupportedFeedtypeException(Type type) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java index aa5c40bda..ba1b8ba5c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java @@ -2,8 +2,8 @@ package de.danoeh.antennapod.core.syndication.namespace; /** Defines a XML Element that is pushed on the tagstack */ public class SyndElement { - private String name; - private Namespace namespace; + private final String name; + private final Namespace namespace; public SyndElement(String name, Namespace namespace) { this.name = name; diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java index 69f302dcb..ea1b724d4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java @@ -11,7 +11,7 @@ public class AtomText extends SyndElement { private static final String TYPE_HTML = "html"; private static final String TYPE_XHTML = "xhtml"; - private String type; + private final String type; private String content; public AtomText(String name, Namespace namespace, String type) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java index 287ec4d0c..7ec7f84c4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java @@ -7,7 +7,7 @@ import java.nio.charset.Charset; public class LangUtils { public static final Charset UTF_8 = Charset.forName("UTF-8"); - private static ArrayMap<String, String> languages; + private static final ArrayMap<String, String> languages; static { languages = new ArrayMap<>(); languages.put("af", "Afrikaans"); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java index 287fe1100..ecb641dad 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java @@ -5,7 +5,7 @@ import de.danoeh.antennapod.core.feed.FeedMedia; public class MediaFileNotFoundException extends Exception { private static final long serialVersionUID = 1L; - private FeedMedia media; + private final FeedMedia media; public MediaFileNotFoundException(String msg, FeedMedia media) { super(msg); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java index 2c178496e..43cd5f170 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java @@ -24,7 +24,7 @@ public class SimpleFlattrThing implements FlattrThing { return this.status; } - private String title; - private String url; - private FlattrStatus status; + private final String title; + private final String url; + private final FlattrStatus status; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java index e33ad8cf6..2f3f378ab 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java @@ -2,7 +2,7 @@ package de.danoeh.antennapod.core.util.id3reader.model; public class FrameHeader extends Header { - private char flags; + private final char flags; public FrameHeader(String id, int size, char flags) { super(id, size); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java index 63bb99c03..29185748f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java @@ -2,8 +2,8 @@ package de.danoeh.antennapod.core.util.id3reader.model; public abstract class Header { - String id; - int size; + final String id; + final int size; Header(String id, int size) { super(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java index bfad3a445..b652a139c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java @@ -2,8 +2,8 @@ package de.danoeh.antennapod.core.util.id3reader.model; public class TagHeader extends Header { - private char version; - private byte flags; + private final char version; + private final byte flags; public TagHeader(String id, int size, char version, byte flags) { super(id, size); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java index c4acdb65e..645bae5f3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java @@ -23,7 +23,7 @@ public class ExternalMedia implements Playable { public static final String PREF_MEDIA_TYPE = "ExternalMedia.PrefMediaType"; public static final String PREF_LAST_PLAYED_TIME = "ExternalMedia.PrefLastPlayedTime"; - private String source; + private final String source; private String episodeTitle; private String feedTitle; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/syndication/HtmlToPlainText.java b/core/src/main/java/de/danoeh/antennapod/core/util/syndication/HtmlToPlainText.java index bd40f398d..642b75ffd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/syndication/HtmlToPlainText.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/syndication/HtmlToPlainText.java @@ -42,7 +42,7 @@ public class HtmlToPlainText { // the formatting rules, implemented in a breadth-first DOM traverse private class FormattingVisitor implements NodeVisitor { - private StringBuilder accum = new StringBuilder(); // holds the accumulated text + private final StringBuilder accum = new StringBuilder(); // holds the accumulated text // hit when the node is first seen public void head(Node node, int depth) { 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 a90620f74..cdf171299 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 @@ -7,7 +7,7 @@ import java.io.InputStream; import java.util.Arrays; class OggInputStream extends InputStream { - private InputStream input; + private final InputStream input; /** True if OggInputStream is currently inside an Ogg page. */ private boolean isInPage; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java index fc437190c..ff7508390 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util.vorbiscommentreader; class VorbisCommentHeader { - private String vendorString; - private long userCommentLength; + private final String vendorString; + private final long userCommentLength; public VorbisCommentHeader(String vendorString, long userCommentLength) { super(); |