Fix static analysis issues
This commit is contained in:
parent
4f8979ecac
commit
104704ee50
@ -8,7 +8,6 @@ import org.apache.commons.io.IOUtils;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -20,15 +19,15 @@ import de.danoeh.antennapod.core.feed.Feed;
|
|||||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||||
import de.danoeh.antennapod.core.storage.DBReader;
|
import de.danoeh.antennapod.core.storage.DBReader;
|
||||||
|
|
||||||
/** Writes saved favorites to file */
|
/** Writes saved favorites to file. */
|
||||||
public class FavoritesWriter implements ExportWriter {
|
public class FavoritesWriter implements ExportWriter {
|
||||||
private static final String TAG = "FavoritesWriter";
|
private static final String TAG = "FavoritesWriter";
|
||||||
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
|
|
||||||
private static final int PAGE_LIMIT = 100;
|
private static final int PAGE_LIMIT = 100;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeDocument(List<Feed> feeds, Writer writer, Context context) throws IllegalArgumentException, IllegalStateException, IOException {
|
public void writeDocument(List<Feed> feeds, Writer writer, Context context)
|
||||||
|
throws IllegalArgumentException, IllegalStateException, IOException {
|
||||||
Log.d(TAG, "Starting to write document");
|
Log.d(TAG, "Starting to write document");
|
||||||
|
|
||||||
InputStream templateStream = context.getAssets().open("favorites-export-template.html");
|
InputStream templateStream = context.getAssets().open("favorites-export-template.html");
|
||||||
@ -85,6 +84,12 @@ public class FavoritesWriter implements ExportWriter {
|
|||||||
return favoritesList;
|
return favoritesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group favorite episodes by feed, sorting them by publishing date in descending order.
|
||||||
|
*
|
||||||
|
* @param favoritesList {@code List} of all favorite episodes.
|
||||||
|
* @return A {@code Map} favorite episodes, keyed by feed ID.
|
||||||
|
*/
|
||||||
private Map<Long, List<FeedItem>> getFeedMap(List<FeedItem> favoritesList) {
|
private Map<Long, List<FeedItem>> getFeedMap(List<FeedItem> favoritesList) {
|
||||||
Map<Long, List<FeedItem>> feedMap = new TreeMap<>();
|
Map<Long, List<FeedItem>> feedMap = new TreeMap<>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user