aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hohenegger2013-12-02 11:23:27 (EST)
committerMax Hohenegger2013-12-02 11:44:07 (EST)
commit2d82355b9d510cfa457741d21f260bd0e064bf17 (patch)
treec24b03ac8f2d8f7cf7f4b31a789f694cce74efb0
parent8ac5ec28c5cb8864d6284d46e13f65a96f85f2e8 (diff)
downloadorg.eclipse.nebula-2d82355b9d510cfa457741d21f260bd0e064bf17.zip
org.eclipse.nebula-2d82355b9d510cfa457741d21f260bd0e064bf17.tar.gz
org.eclipse.nebula-2d82355b9d510cfa457741d21f260bd0e064bf17.tar.bz2
Bug 422976 Infinite loop in TickLabels-computation leads torefs/changes/11/19211/1
OutOfMemoryError make sure to meet the exit condition by re-calculating each iteration using an incrementing integer factor Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
-rw-r--r--widgets/visualization/org.eclipse.nebula.visualization.xygraph/src/org/eclipse/nebula/visualization/xygraph/linearscale/LinearScaleTickLabels.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/widgets/visualization/org.eclipse.nebula.visualization.xygraph/src/org/eclipse/nebula/visualization/xygraph/linearscale/LinearScaleTickLabels.java b/widgets/visualization/org.eclipse.nebula.visualization.xygraph/src/org/eclipse/nebula/visualization/xygraph/linearscale/LinearScaleTickLabels.java
index f11533a..47a6059 100644
--- a/widgets/visualization/org.eclipse.nebula.visualization.xygraph/src/org/eclipse/nebula/visualization/xygraph/linearscale/LinearScaleTickLabels.java
+++ b/widgets/visualization/org.eclipse.nebula.visualization.xygraph/src/org/eclipse/nebula/visualization/xygraph/linearscale/LinearScaleTickLabels.java
@@ -382,7 +382,8 @@ public class LinearScaleTickLabels extends Figure {
tickLabelPositions.add(scale.getMargin());
}
- for (double b = firstPosition; max >= min ? b < max : b > max; b = b + tickStep) {
+ int i = 1;
+ for (double b = firstPosition; max >= min ? b < max : b > max; b = firstPosition + i++ * tickStep) {
if (scale.isDateEnabled()) {
Date date = new Date((long) b);
tickLabels.add(scale.format(date, b == firstPosition && !minDateAdded));