diff options
author | John Arthorne | 2010-10-01 14:39:39 +0000 |
---|---|---|
committer | John Arthorne | 2010-10-01 14:39:39 +0000 |
commit | 507ea76950a467445fbef931ba085ed9c13480a8 (patch) | |
tree | e88f8e4b4b8f42c7b8a0a5bbb74d8146e23edb15 | |
parent | 3576ed99fa17d935a4878d93cf88e12f75141a70 (diff) | |
download | rt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.tar.gz rt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.tar.xz rt.equinox.p2-507ea76950a467445fbef931ba085ed9c13480a8.zip |
Bug 326315 - Error in ProgressStatistics.getRecentSpeed
-rw-r--r-- | bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java | 8 |
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) |