diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-17 18:51:30 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-17 18:51:30 +0200 |
commit | b9fbc48168dcf23456e86b8dfe045c57a3d56e6d (patch) | |
tree | 00277334d046a968e55e7dcaa07209c4d4717541 /src/de/danoeh/antennapod/service | |
parent | 7c4715128cdd301a354f3e5d3eee1f9db7e55419 (diff) | |
parent | b1cdfe20416dc78349dc78b279f718076e07643c (diff) | |
download | AntennaPod-b9fbc48168dcf23456e86b8dfe045c57a3d56e6d.zip |
Merge branch 'findbugs' of git://github.com/andrewgaul/AntennaPod into andrewgaul-findbugs
Conflicts:
src/de/danoeh/antennapod/activity/DownloadActivity.java
src/de/danoeh/antennapod/asynctask/OpmlExportWorker.java
src/de/danoeh/antennapod/feed/Feed.java
src/de/danoeh/antennapod/feed/FeedItem.java
src/de/danoeh/antennapod/feed/FeedMedia.java
src/de/danoeh/antennapod/service/download/DownloadStatus.java
src/de/danoeh/antennapod/storage/DownloadRequester.java
src/de/danoeh/antennapod/storage/PodDBAdapter.java
Diffstat (limited to 'src/de/danoeh/antennapod/service')
-rw-r--r-- | src/de/danoeh/antennapod/service/download/DownloadStatus.java | 6 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/service/download/HttpDownloader.java | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/de/danoeh/antennapod/service/download/DownloadStatus.java b/src/de/danoeh/antennapod/service/download/DownloadStatus.java index 62e54cbb4..8be73a8ae 100644 --- a/src/de/danoeh/antennapod/service/download/DownloadStatus.java +++ b/src/de/danoeh/antennapod/service/download/DownloadStatus.java @@ -52,7 +52,7 @@ public class DownloadStatus { this.feedfileId = feedfileId; this.reason = reason; this.successful = successful; - this.completionDate = completionDate; + this.completionDate = (Date) completionDate.clone(); this.reasonDetailed = reasonDetailed; this.feedfileType = feedfileType; } @@ -133,7 +133,7 @@ public class DownloadStatus { } public Date getCompletionDate() { - return completionDate; + return (Date) completionDate.clone(); } public long getFeedfileId() { @@ -172,7 +172,7 @@ public class DownloadStatus { } public void setCompletionDate(Date completionDate) { - this.completionDate = completionDate; + this.completionDate = (Date) completionDate.clone(); } public void setId(long id) { diff --git a/src/de/danoeh/antennapod/service/download/HttpDownloader.java b/src/de/danoeh/antennapod/service/download/HttpDownloader.java index 364844181..972b83c61 100644 --- a/src/de/danoeh/antennapod/service/download/HttpDownloader.java +++ b/src/de/danoeh/antennapod/service/download/HttpDownloader.java @@ -74,9 +74,8 @@ public class HttpDownloader extends Downloader { if (StorageUtils.storageAvailable(PodcastApp.getInstance())) { File destination = new File(request.getDestination()); if (!destination.exists()) { - connection = AndroidHttpClient - .getUngzippedContent(httpEntity); - InputStream in = new BufferedInputStream(connection); + connection = new BufferedInputStream(AndroidHttpClient + .getUngzippedContent(httpEntity)); out = new BufferedOutputStream(new FileOutputStream( destination)); byte[] buffer = new byte[BUFFER_SIZE]; @@ -99,7 +98,7 @@ public class HttpDownloader extends Downloader { if (AppConfig.DEBUG) Log.d(TAG, "Starting download"); while (!cancelled - && (count = in.read(buffer)) != -1) { + && (count = connection.read(buffer)) != -1) { out.write(buffer, 0, count); request.setSoFar(request.getSoFar() + count); request.setProgressPercent((int) (((double) request |