Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2010-10-01 14:39:39 +0000
committerJohn Arthorne2010-10-01 14:39:39 +0000
commit507ea76950a467445fbef931ba085ed9c13480a8 (patch)
treee88f8e4b4b8f42c7b8a0a5bbb74d8146e23edb15 /bundles/org.eclipse.equinox.p2.repository
parent3576ed99fa17d935a4878d93cf88e12f75141a70 (diff)
downloadrt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.tar.gz
rt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.tar.xz
rt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.zip
Bug 326315 - Error in ProgressStatistics.getRecentSpeed
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java
index 6b740e448..bc5a2105f 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java
@@ -98,9 +98,11 @@ public class ProgressStatistics {
long amount = 0L;
SortedMap<Long, Long> relevantData = m_recentSpeedMap.headMap(new Long(m_recentSpeedMapKey));
- for (Long rl : relevantData.values()) {
- dur += SPEED_RESOLUTION;
- amount += rl.longValue();
+ if (!relevantData.isEmpty()) {
+ for (Long rl : relevantData.values()) {
+ dur += SPEED_RESOLUTION;
+ amount += rl.longValue();
+ }
}
if (dur >= 1000)

Back to the top