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 14a3b27b0..88e05942b 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 l = new ArrayList(); + ArrayList l = new ArrayList<>(); l.add("http://bitsundso.de/feed"); service.uploadSubscriptions(USER, "radio", l); } public void testUploadSubscription2() throws GpodnetServiceException { authenticate(); - ArrayList l = new ArrayList(); + ArrayList 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/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 items = new ArrayList(); + List items = new ArrayList<>(); feed.setItems(items); - List files = new ArrayList(); + List 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 itemIDs = new ArrayList(); + List 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..7095d50b1 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 itemFiles = new ArrayList(); + List 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); @@ -207,7 +207,7 @@ public class DBWriterTest extends InstrumentationTestCase { feed.setImage(null); - List itemFiles = new ArrayList(); + List 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 itemFiles = new ArrayList(); + List 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 queue = new ArrayList(); + List 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()); + 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 itemFiles = new ArrayList(); + List 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); @@ -598,7 +598,7 @@ public class DBWriterTest extends InstrumentationTestCase { for (FeedItem item : feed.getItems()) { assertTrue(item.getId() != 0); } - List> futures = new ArrayList>(); + List> futures = new ArrayList<>(); for (FeedItem item : feed.getItems()) { futures.add(DBWriter.addQueueItem(context, item)); } 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 432d4a4e6..ccac4e761 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -59,7 +59,7 @@ public class UITestUtils { private File hostedFeedDir; private File hostedMediaDir; - public List hostedFeeds = new ArrayList(); + public List hostedFeeds = new ArrayList<>(); public UITestUtils(Context context) { this.context = context; @@ -149,7 +149,7 @@ public class UITestUtils { image.setOwner(feed); // create items - List items = new ArrayList(); + List 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(); + 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 28ff6694e..a728d9afd 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 openConnections = new HashSet(); + private Set openConnections = new HashSet<>(); private Thread myThread; /** * Pluggable strategy for asynchronously executing requests. @@ -348,7 +348,7 @@ public abstract class NanoHTTPD { * @return a map of String (parameter name) to List<String> (a list of the values supplied). */ protected Map> decodeParameters(String queryString) { - Map> parms = new ArrayMap>(); + Map> parms = new ArrayMap<>(); if (queryString != null) { StringTokenizer st = new StringTokenizer(queryString, "&"); while (st.hasMoreTokens()) { @@ -356,7 +356,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()); + parms.put(propertyName, new ArrayList<>()); } String propertyValue = (sep >= 0) ? decodePercent(e.substring(sep + 1)) : null; if (propertyValue != null) { @@ -490,7 +490,7 @@ public abstract class NanoHTTPD { public DefaultTempFileManager() { tmpdir = System.getProperty("java.io.tmpdir"); - tempFiles = new ArrayList(); + tempFiles = new ArrayList<>(); } @Override @@ -563,7 +563,7 @@ public abstract class NanoHTTPD { /** * Headers for the HTTP response. Use addHeader() to add lines. */ - private Map header = new ArrayMap(); + private Map header = new ArrayMap<>(); /** * The request method that spawned this response. */ @@ -865,7 +865,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(); + headers = new ArrayMap<>(); headers.put("remote-addr", remoteIp); headers.put("http-client-ip", remoteIp); @@ -909,16 +909,16 @@ public abstract class NanoHTTPD { inputStream.unread(buf, splitbyte, rlen - splitbyte); } - parms = new ArrayMap(); + parms = new ArrayMap<>(); if(null == headers) { - headers = new ArrayMap(); + 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 pre = new ArrayMap(); + Map pre = new ArrayMap<>(); decodeHeader(hin, pre, parms, headers); method = Method.lookup(pre.get("method")); @@ -1116,7 +1116,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 item = new ArrayMap(); + Map item = new ArrayMap<>(); mpline = in.readLine(); while (mpline != null && mpline.trim().length() > 0) { int p = mpline.indexOf(':'); @@ -1131,7 +1131,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 disposition = new ArrayMap(); + Map disposition = new ArrayMap<>(); while (st.hasMoreTokens()) { String token = st.nextToken().trim(); int p = token.indexOf('='); @@ -1196,7 +1196,7 @@ public abstract class NanoHTTPD { private int[] getBoundaryPositions(ByteBuffer b, byte[] boundary) { int matchcount = 0; int matchbyte = -1; - List matchbytes = new ArrayList(); + List matchbytes = new ArrayList<>(); for (int i = 0; i < b.limit(); i++) { if (b.get(i) == boundary[matchcount]) { if (matchcount == 0) @@ -1366,8 +1366,8 @@ public abstract class NanoHTTPD { * @author LordFokas */ public class CookieHandler implements Iterable { - private ArrayMap cookies = new ArrayMap(); - private ArrayList queue = new ArrayList(); + private ArrayMap cookies = new ArrayMap<>(); + private ArrayList queue = new ArrayList<>(); public CookieHandler(Map 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 bc1a40b11..fce50bd1c 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java @@ -99,7 +99,7 @@ public class OpmlFeedChooserActivity extends AppCompatActivity { } private List getTitleList() { - List result = new ArrayList(); + List result = new ArrayList<>(); if (OpmlImportHolder.getReadElements() != null) { for (OpmlElement element : OpmlImportHolder.getReadElements()) { result.add(element.getText()); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java index cd74ae9a9..558485ce3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java @@ -118,7 +118,7 @@ public class FlattrUtils { public static List retrieveFlattredThings() throws FlattrException { - ArrayList myFlattrs = new ArrayList(); + ArrayList myFlattrs = new ArrayList<>(); if (hasToken()) { FlattrService fs = FlattrServiceCreator.getService(retrieveToken());