diff --git a/arduino-core/src/cc/arduino/contributions/packages/DownloadableContributionsDownloader.java b/arduino-core/src/cc/arduino/contributions/packages/DownloadableContributionsDownloader.java index 6e034a823..908df52a2 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/DownloadableContributionsDownloader.java +++ b/arduino-core/src/cc/arduino/contributions/packages/DownloadableContributionsDownloader.java @@ -85,8 +85,8 @@ public class DownloadableContributionsDownloader { FileDownloader me = (FileDownloader) o; String msg = ""; if (me.getDownloadSize() != null) { - long downloaded = me.getInitialSize() + me.getDownloaded() / 1000; - long total = me.getInitialSize() + me.getDownloadSize() / 1000; + long downloaded = (me.getInitialSize() + me.getDownloaded()) / 1000; + long total = (me.getInitialSize() + me.getDownloadSize()) / 1000; msg = format(_("Downloaded {0}kb of {1}kb."), downloaded, total); } progress.setStatus(statusText + " " + msg); diff --git a/arduino-core/src/cc/arduino/utils/network/FileDownloader.java b/arduino-core/src/cc/arduino/utils/network/FileDownloader.java index a3e66c8a5..f686ab2e7 100644 --- a/arduino-core/src/cc/arduino/utils/network/FileDownloader.java +++ b/arduino-core/src/cc/arduino/utils/network/FileDownloader.java @@ -181,8 +181,9 @@ public class FileDownloader extends Observable { // Check for valid content length. long len = connection.getContentLength(); - if (len >= 0) + if (len >= 0) { setDownloadSize(len); + } setStatus(Status.DOWNLOADING); synchronized (this) {