diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-16 20:22:03 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-16 20:22:03 +0100 |
commit | 92efa255721af0e29e502d69c90d8d878cc6e258 (patch) | |
tree | b6aaa966f60f1dd9969c9ee6a1715878acc17b88 /core/src/main | |
parent | c5450fc4133c26d3bc06e7e41682609ff16582a4 (diff) | |
parent | e87f053d9b13785dc314e74b0ea3a30d244dbec7 (diff) | |
download | AntennaPod-92efa255721af0e29e502d69c90d8d878cc6e258.zip |
Merge pull request #1773 from andrewgaul/boxing
Avoid unneeded boxing
Diffstat (limited to 'core/src/main')
8 files changed, 30 insertions, 30 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java index 2d174a6bc..01c888d6b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetEpisodeAction.java @@ -63,10 +63,10 @@ public class GpodnetEpisodeAction { Action action = Action.valueOf(fields[3]); GpodnetEpisodeAction result = new Builder(podcast, episode, action) .deviceId(deviceId) - .timestamp(new Date(Long.valueOf(fields[4]))) - .started(Integer.valueOf(fields[5])) - .position(Integer.valueOf(fields[6])) - .total(Integer.valueOf(fields[7])) + .timestamp(new Date(Long.parseLong(fields[4]))) + .started(Integer.parseInt(fields[5])) + .position(Integer.parseInt(fields[6])) + .total(Integer.parseInt(fields[7])) .build(); return result; } catch(IllegalArgumentException e) { 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 6c0aff15e..ac042de6f 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 @@ -158,12 +158,12 @@ public class UserPreferences { public static int getFeedOrder() { String value = prefs.getString(PREF_DRAWER_FEED_ORDER, "0"); - return Integer.valueOf(value); + return Integer.parseInt(value); } public static int getFeedCounterSetting() { String value = prefs.getString(PREF_DRAWER_FEED_COUNTER, "0"); - return Integer.valueOf(value); + return Integer.parseInt(value); } /** @@ -243,7 +243,7 @@ public class UserPreferences { } public static int getSmartMarkAsPlayedSecs() { - return Integer.valueOf(prefs.getString(PREF_SMART_MARK_AS_PLAYED_SECS, "30")); + return Integer.parseInt(prefs.getString(PREF_SMART_MARK_AS_PLAYED_SECS, "30")); } public static boolean isAutoFlattr() { @@ -295,8 +295,8 @@ public class UserPreferences { String datetime = prefs.getString(PREF_UPDATE_INTERVAL, ""); if(datetime.length() >= 3 && datetime.contains(":")) { String[] parts = datetime.split(":"); - int hourOfDay = Integer.valueOf(parts[0]); - int minute = Integer.valueOf(parts[1]); + int hourOfDay = Integer.parseInt(parts[0]); + int minute = Integer.parseInt(parts[1]); return new int[] { hourOfDay, minute }; } else { return new int[0]; @@ -308,7 +308,7 @@ public class UserPreferences { } public static int getParallelDownloads() { - return Integer.valueOf(prefs.getString(PREF_PARALLEL_DOWNLOADS, "4")); + return Integer.parseInt(prefs.getString(PREF_PARALLEL_DOWNLOADS, "4")); } public static int getEpisodeCacheSizeUnlimited() { @@ -338,12 +338,12 @@ public class UserPreferences { public static int getImageCacheSize() { String cacheSizeString = prefs.getString(PREF_IMAGE_CACHE_SIZE, IMAGE_CACHE_DEFAULT_VALUE); - int cacheSizeInt = Integer.valueOf(cacheSizeString); + int cacheSizeInt = Integer.parseInt(cacheSizeString); // if the cache size is too small the user won't get any images at all // that's bad, force it back to the default. if (cacheSizeInt < IMAGE_CACHE_SIZE_MINIMUM) { prefs.edit().putString(PREF_IMAGE_CACHE_SIZE, IMAGE_CACHE_DEFAULT_VALUE).apply(); - cacheSizeInt = Integer.valueOf(IMAGE_CACHE_DEFAULT_VALUE); + cacheSizeInt = Integer.parseInt(IMAGE_CACHE_DEFAULT_VALUE); } int cacheSizeMB = cacheSizeInt * 1024 * 1024; return cacheSizeMB; @@ -494,7 +494,7 @@ public class UserPreferences { if (valueFromPrefs.equals(context.getString(R.string.pref_episode_cache_unlimited))) { return EPISODE_CACHE_SIZE_UNLIMITED; } else { - return Integer.valueOf(valueFromPrefs); + return Integer.parseInt(valueFromPrefs); } } @@ -548,7 +548,7 @@ public class UserPreferences { public static EpisodeCleanupAlgorithm getEpisodeCleanupAlgorithm() { - int cleanupValue = Integer.valueOf(prefs.getString(PREF_EPISODE_CLEANUP, "-1")); + int cleanupValue = Integer.parseInt(prefs.getString(PREF_EPISODE_CLEANUP, "-1")); if (cleanupValue == EPISODE_CLEANUP_QUEUE) { return new APQueueCleanupAlgorithm(); } else if (cleanupValue == EPISODE_CLEANUP_NULL) { 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 090c48ca0..be6cd88cb 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 @@ -188,7 +188,7 @@ public class DownloadService extends Service { if (status.getReason() == DownloadError.ERROR_UNAUTHORIZED) { postAuthenticationNotification(downloader.getDownloadRequest()); } else if (status.getReason() == DownloadError.ERROR_HTTP_DATA_ERROR - && Integer.valueOf(status.getReasonDetailed()) == 416) { + && Integer.parseInt(status.getReasonDetailed()) == 416) { Log.d(TAG, "Requested invalid range, restarting download from the beginning"); FileUtils.deleteQuietly(new File(downloader.getDownloadRequest().getDestination())); 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 e3a195253..31775326f 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 @@ -180,7 +180,7 @@ public class HttpDownloader extends Downloader { && !TextUtils.isEmpty(contentRangeHeader)) { String start = contentRangeHeader.substring("bytes ".length(), contentRangeHeader.indexOf("-")); - request.setSoFar(Long.valueOf(start)); + request.setSoFar(Long.parseLong(start)); Log.d(TAG, "Starting download at position " + request.getSoFar()); out = new RandomAccessFile(destination, "rw"); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java index 99c4cd67a..769a796e3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java @@ -60,12 +60,12 @@ public class NSITunes extends Namespace { try { int duration = 0; if (parts.length == 2) { - duration += TimeUnit.MINUTES.toMillis(Long.valueOf(parts[0])) + - TimeUnit.SECONDS.toMillis(Long.valueOf(parts[1])); + duration += TimeUnit.MINUTES.toMillis(Long.parseLong(parts[0])) + + TimeUnit.SECONDS.toMillis(Long.parseLong(parts[1])); } else if (parts.length >= 3) { - duration += TimeUnit.HOURS.toMillis(Long.valueOf(parts[0])) + - TimeUnit.MINUTES.toMillis(Long.valueOf(parts[1])) + - TimeUnit.SECONDS.toMillis(Long.valueOf(parts[2])); + duration += TimeUnit.HOURS.toMillis(Long.parseLong(parts[0])) + + TimeUnit.MINUTES.toMillis(Long.parseLong(parts[1])) + + TimeUnit.SECONDS.toMillis(Long.parseLong(parts[2])); } else { return; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java index 1b929b214..2e3afefa9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java @@ -88,9 +88,9 @@ public final class Converter { if (parts.length != 3) { return 0; } - return Integer.valueOf(parts[0]) * 3600 * 1000 + - Integer.valueOf(parts[1]) * 60 * 1000 + - Integer.valueOf(parts[2]) * 1000; + return Integer.parseInt(parts[0]) * 3600 * 1000 + + Integer.parseInt(parts[1]) * 60 * 1000 + + Integer.parseInt(parts[2]) * 1000; } /** Converts short duration string (HH:MM) to milliseconds. */ @@ -99,8 +99,8 @@ public final class Converter { if (parts.length != 2) { return 0; } - return Integer.valueOf(parts[0]) * 3600 * 1000 + - Integer.valueOf(parts[1]) * 1000 * 60; + return Integer.parseInt(parts[0]) * 3600 * 1000 + + Integer.parseInt(parts[1]) * 1000 * 60; } /** Converts milliseconds to a localized string containing hours and minutes */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java index 155ef519b..314062e52 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java @@ -115,13 +115,13 @@ public class DateUtils { int idx = 0; if (parts.length == 3) { // string has hours - result += Integer.valueOf(parts[idx]) * 3600000L; + result += Integer.parseInt(parts[idx]) * 3600000L; idx++; } if (parts.length >= 2) { - result += Integer.valueOf(parts[idx]) * 60000L; + result += Integer.parseInt(parts[idx]) * 60000L; idx++; - result += (Float.valueOf(parts[idx])) * 1000L; + result += (Float.parseFloat(parts[idx])) * 1000L; } return result; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java index 13a980774..8d9151396 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java @@ -172,7 +172,7 @@ public class Timeline { try { if (m.find()) { - return Integer.valueOf(m.group(1)); + return Integer.parseInt(m.group(1)); } } catch (NumberFormatException e) { e.printStackTrace(); |