diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/BUILD b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/BUILD index 82aa46a2ad8829..55ebfe7b6d3ba1 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/BUILD +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/BUILD @@ -22,6 +22,7 @@ java_library( "//src/main/java/com/google/devtools/build/lib/concurrent", "//src/main/java/com/google/devtools/build/lib/events", "//src/main/java/com/google/devtools/build/lib/util", + "//src/main/java/com/google/devtools/build/lib/remote/util", "//src/main/java/com/google/devtools/build/lib/util:os", "//src/main/java/com/google/devtools/build/lib/vfs", "//src/main/java/com/google/devtools/build/lib/vfs:pathfragment", @@ -29,6 +30,6 @@ java_library( "//third_party:auth", "//third_party:auto_value", "//third_party:guava", - "//third_party:jsr305", + "//third_party:jsr305" ], ) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadProgressEvent.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadProgressEvent.java index 637c794247f659..6707c673c4cb7a 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadProgressEvent.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadProgressEvent.java @@ -16,8 +16,8 @@ import com.google.devtools.build.lib.events.ExtendedEventHandler; import java.net.URL; -import java.text.NumberFormat; import java.util.Locale; +import com.google.devtools.build.lib.remote.util.Utils; /** * Postable event reporting on progress made downloading an URL. It can be used to report the URL @@ -73,9 +73,7 @@ public long getBytesRead() { @Override public String getProgress() { if (bytesRead > 0) { - NumberFormat formatter = NumberFormat.getIntegerInstance(Locale.ENGLISH); - formatter.setGroupingUsed(true); - return formatter.format(bytesRead) + "B"; + return String.format("%s (%,dB)", Utils.bytesCountToDisplayString(bytesRead), bytesRead); } else { return ""; }