diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 17:50:32 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 17:50:32 +0100 |
commit | cbc3b23753bb32a239ebfa9e6ef8791e57fd17ab (patch) | |
tree | 96971c4ace7e3ee196f2afb3c1c4a4f0991b1ada /app/src | |
parent | 26b938ce5bdafc06c474abbbebd6b459af5f6de1 (diff) | |
download | AntennaPod-cbc3b23753bb32a239ebfa9e6ef8791e57fd17ab.zip |
Replace explicit type with <>
Diffstat (limited to 'app/src')
10 files changed, 38 insertions, 38 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java index 3ca7906cb..5ae07badc 100644 --- a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java +++ b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java @@ -38,14 +38,14 @@ public class GPodnetServiceTest extends AndroidTestCase { public void testUploadSubscription() throws GpodnetServiceException { authenticate(); - ArrayList<String> l = new ArrayList<String>(); + ArrayList<String> l = new ArrayList<>(); l.add("http://bitsundso.de/feed"); service.uploadSubscriptions(USER, "radio", l); } public void testUploadSubscription2() throws GpodnetServiceException { authenticate(); - ArrayList<String> l = new ArrayList<String>(); + ArrayList<String> l = new ArrayList<>(); l.add("http://bitsundso.de/feed"); l.add("http://gamesundso.de/feed"); service.uploadSubscriptions(USER, "radio", l); diff --git a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java index ee454ce8a..11ec1f453 100644 --- a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java @@ -165,7 +165,7 @@ public class FeedHandlerTest extends InstrumentationTestCase { Feed feed = new Feed(0, null, "title", "http://example.com", "This is the description", "http://example.com/payment", "Daniel", "en", null, "http://example.com/feed", image, file.getAbsolutePath(), "http://example.com/feed", true); - feed.setItems(new ArrayList<FeedItem>()); + feed.setItems(new ArrayList<>()); for (int i = 0; i < numItems; i++) { FeedItem item = new FeedItem(0, "item-" + i, "http://example.com/item-" + i, diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java b/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java index 5e5eb1e8b..09533208f 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java @@ -145,9 +145,9 @@ public class DBCleanupTests extends InstrumentationTestCase { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; Feed feed = new Feed("url", null, "title"); - List<FeedItem> items = new ArrayList<FeedItem>(); + List<FeedItem> items = new ArrayList<>(); feed.setItems(items); - List<File> files = new ArrayList<File>(); + List<File> files = new ArrayList<>(); populateItems(NUM_ITEMS, feed, items, files, FeedItem.UNPLAYED, false, false); DBTasks.performAutoCleanup(context); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java index 785d32e93..13cf56ff4 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java @@ -100,7 +100,7 @@ public class DBTasksTest extends InstrumentationTestCase { assertTrue(feed.getId() != 0); final long feedID = feed.getId(); feed.setId(0); - List<Long> itemIDs = new ArrayList<Long>(); + List<Long> itemIDs = new ArrayList<>(); for (FeedItem item : feed.getItems()) { assertTrue(item.getId() != 0); itemIDs.add(item.getId()); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java index 40083e507..b1cc807ea 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java @@ -138,7 +138,7 @@ public class DBWriterTest extends InstrumentationTestCase { image.setOwner(feed); feed.setImage(image); - List<File> itemFiles = new ArrayList<File>(); + List<File> itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed, true); @@ -151,7 +151,7 @@ public class DBWriterTest extends InstrumentationTestCase { FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null, 0, 0); item.setMedia(media); - item.setChapters(new ArrayList<Chapter>()); + item.setChapters(new ArrayList<>()); item.getChapters().add(new SimpleChapter(0, "item " + i, item, "example.com")); } @@ -207,7 +207,7 @@ public class DBWriterTest extends InstrumentationTestCase { feed.setImage(null); - List<File> itemFiles = new ArrayList<File>(); + List<File> itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed); @@ -418,7 +418,7 @@ public class DBWriterTest extends InstrumentationTestCase { image.setOwner(feed); feed.setImage(image); - List<File> itemFiles = new ArrayList<File>(); + List<File> itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed); @@ -444,7 +444,7 @@ public class DBWriterTest extends InstrumentationTestCase { } - List<FeedItem> queue = new ArrayList<FeedItem>(); + List<FeedItem> queue = new ArrayList<>(); queue.addAll(feed.getItems()); adapter.open(); adapter.setQueue(queue); @@ -482,7 +482,7 @@ public class DBWriterTest extends InstrumentationTestCase { assertNotNull(destFolder); Feed feed = new Feed("url", null, "title"); - feed.setItems(new ArrayList<FeedItem>()); + feed.setItems(new ArrayList<>()); // create Feed image File imgFile = new File(destFolder, "image"); @@ -490,7 +490,7 @@ public class DBWriterTest extends InstrumentationTestCase { image.setOwner(feed); feed.setImage(image); - List<File> itemFiles = new ArrayList<File>(); + List<File> itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed); @@ -539,7 +539,7 @@ public class DBWriterTest extends InstrumentationTestCase { private FeedMedia playbackHistorySetup(Date playbackCompletionDate) { final Context context = getInstrumentation().getTargetContext(); Feed feed = new Feed("url", null, "title"); - feed.setItems(new ArrayList<FeedItem>()); + feed.setItems(new ArrayList<>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), FeedItem.PLAYED, feed); FeedMedia media = new FeedMedia(0, item, 10, 0, 1, "mime", null, "url", false, playbackCompletionDate, 0, 0); feed.getItems().add(item); @@ -598,7 +598,7 @@ public class DBWriterTest extends InstrumentationTestCase { for (FeedItem item : feed.getItems()) { assertTrue(item.getId() != 0); } - List<Future<?>> futures = new ArrayList<Future<?>>(); + List<Future<?>> futures = new ArrayList<>(); for (FeedItem item : feed.getItems()) { futures.add(DBWriter.addQueueItem(context, item)); } @@ -791,7 +791,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testMarkFeedRead() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; Feed feed = new Feed("url", null, "title"); - feed.setItems(new ArrayList<FeedItem>()); + feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.UNPLAYED, feed); feed.getItems().add(item); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java index aec0265a6..6156da926 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java @@ -96,7 +96,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv public void testClickNavDrawer() throws Exception { uiTestUtils.addLocalFeedData(false); - UserPreferences.setHiddenDrawerItems(new ArrayList<String>()); + UserPreferences.setHiddenDrawerItems(new ArrayList<>()); // queue openNavDrawer(); @@ -159,7 +159,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } public void testDrawerPreferencesHideSomeElements() { - UserPreferences.setHiddenDrawerItems(new ArrayList<String>()); + UserPreferences.setHiddenDrawerItems(new ArrayList<>()); openNavDrawer(); solo.clickLongOnText(solo.getString(R.string.queue_label)); solo.waitForDialogToOpen(); @@ -190,7 +190,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } public void testDrawerPreferencesHideAllElements() { - UserPreferences.setHiddenDrawerItems(new ArrayList<String>()); + UserPreferences.setHiddenDrawerItems(new ArrayList<>()); String[] titles = getInstrumentation().getTargetContext().getResources().getStringArray(R.array.nav_drawer_titles); openNavDrawer(); @@ -209,7 +209,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } public void testDrawerPreferencesHideCurrentElement() { - UserPreferences.setHiddenDrawerItems(new ArrayList<String>()); + UserPreferences.setHiddenDrawerItems(new ArrayList<>()); openNavDrawer(); String downloads = solo.getString(R.string.downloads_label); 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 eeb001ea1..ab0155ba8 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -57,7 +57,7 @@ public class UITestUtils { private File hostedFeedDir; private File hostedMediaDir; - public List<Feed> hostedFeeds = new ArrayList<Feed>(); + public List<Feed> hostedFeeds = new ArrayList<>(); public UITestUtils(Context context) { this.context = context; @@ -147,7 +147,7 @@ public class UITestUtils { image.setOwner(feed); // create items - List<FeedItem> items = new ArrayList<FeedItem>(); + List<FeedItem> items = new ArrayList<>(); for (int j = 0; j < NUM_ITEMS_PER_FEED; j++) { FeedItem item = new FeedItem(j, "Feed " + (i+1) + ": Item " + (j+1), "item" + j, "http://example.com/feed" + i + "/item/" + j, new Date(), FeedItem.UNPLAYED, feed); 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 2f2c3fe5b..23be5ad4a 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 @@ -49,7 +49,7 @@ public class HTTPBin extends NanoHTTPD { public HTTPBin() { super(PORT); - this.servedFiles = new ArrayList<File>(); + this.servedFiles = new ArrayList<>(); } /** 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 da79ec615..8f155dd0b 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<Socket>(); + private Set<Socket> openConnections = new HashSet<>(); private Thread myThread; /** * Pluggable strategy for asynchronously executing requests. @@ -342,7 +342,7 @@ public abstract class NanoHTTPD { * @return a map of <code>String</code> (parameter name) to <code>List<String></code> (a list of the values supplied). */ protected Map<String, List<String>> decodeParameters(String queryString) { - Map<String, List<String>> parms = new ArrayMap<String, List<String>>(); + Map<String, List<String>> parms = new ArrayMap<>(); if (queryString != null) { StringTokenizer st = new StringTokenizer(queryString, "&"); while (st.hasMoreTokens()) { @@ -350,7 +350,7 @@ public abstract class NanoHTTPD { int sep = e.indexOf('='); String propertyName = (sep >= 0) ? decodePercent(e.substring(0, sep)).trim() : decodePercent(e).trim(); if (!parms.containsKey(propertyName)) { - parms.put(propertyName, new ArrayList<String>()); + parms.put(propertyName, new ArrayList<>()); } String propertyValue = (sep >= 0) ? decodePercent(e.substring(sep + 1)) : null; if (propertyValue != null) { @@ -484,7 +484,7 @@ public abstract class NanoHTTPD { public DefaultTempFileManager() { tmpdir = System.getProperty("java.io.tmpdir"); - tempFiles = new ArrayList<TempFile>(); + tempFiles = new ArrayList<>(); } @Override @@ -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<String, String>(); + private Map<String, String> header = new ArrayMap<>(); /** * The request method that spawned this response. */ @@ -859,7 +859,7 @@ public abstract class NanoHTTPD { this.inputStream = new PushbackInputStream(inputStream, BUFSIZE); this.outputStream = outputStream; String remoteIp = inetAddress.isLoopbackAddress() || inetAddress.isAnyLocalAddress() ? "127.0.0.1" : inetAddress.getHostAddress().toString(); - headers = new ArrayMap<String, String>(); + headers = new ArrayMap<>(); headers.put("remote-addr", remoteIp); headers.put("http-client-ip", remoteIp); @@ -903,16 +903,16 @@ public abstract class NanoHTTPD { inputStream.unread(buf, splitbyte, rlen - splitbyte); } - parms = new ArrayMap<String, String>(); + parms = new ArrayMap<>(); if(null == headers) { - headers = new ArrayMap<String, String>(); + headers = new ArrayMap<>(); } // Create a BufferedReader for parsing the header. BufferedReader hin = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(buf, 0, rlen))); // Decode the header into parms and header java properties - Map<String, String> pre = new ArrayMap<String, String>(); + Map<String, String> pre = new ArrayMap<>(); decodeHeader(hin, pre, parms, headers); method = Method.lookup(pre.get("method")); @@ -1110,7 +1110,7 @@ public abstract class NanoHTTPD { throw new ResponseException(Response.Status.BAD_REQUEST, "BAD REQUEST: Content type is multipart/form-data but next chunk does not start with boundary. Usage: GET /example/file.html"); } boundarycount++; - Map<String, String> item = new ArrayMap<String, String>(); + Map<String, String> item = new ArrayMap<>(); mpline = in.readLine(); while (mpline != null && mpline.trim().length() > 0) { int p = mpline.indexOf(':'); @@ -1125,7 +1125,7 @@ public abstract class NanoHTTPD { throw new ResponseException(Response.Status.BAD_REQUEST, "BAD REQUEST: Content type is multipart/form-data but no content-disposition info found. Usage: GET /example/file.html"); } StringTokenizer st = new StringTokenizer(contentDisposition, ";"); - Map<String, String> disposition = new ArrayMap<String, String>(); + Map<String, String> disposition = new ArrayMap<>(); while (st.hasMoreTokens()) { String token = st.nextToken().trim(); int p = token.indexOf('='); @@ -1190,7 +1190,7 @@ public abstract class NanoHTTPD { private int[] getBoundaryPositions(ByteBuffer b, byte[] boundary) { int matchcount = 0; int matchbyte = -1; - List<Integer> matchbytes = new ArrayList<Integer>(); + List<Integer> matchbytes = new ArrayList<>(); for (int i = 0; i < b.limit(); i++) { if (b.get(i) == boundary[matchcount]) { if (matchcount == 0) @@ -1360,8 +1360,8 @@ public abstract class NanoHTTPD { * @author LordFokas */ public class CookieHandler implements Iterable<String> { - private ArrayMap<String, String> cookies = new ArrayMap<String, String>(); - private ArrayList<Cookie> queue = new ArrayList<Cookie>(); + private ArrayMap<String, String> cookies = new ArrayMap<>(); + private 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/OpmlFeedChooserActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java index 355e0f372..cd375a65a 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java @@ -97,7 +97,7 @@ public class OpmlFeedChooserActivity extends AppCompatActivity { } private List<String> getTitleList() { - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); if (OpmlImportHolder.getReadElements() != null) { for (OpmlElement element : OpmlImportHolder.getReadElements()) { result.add(element.getText()); |