changeset 225:219e9666f590

Bugfix Gap-Calculation moved maxGap into negative Valies because of overflow of Long-Variable. gnv-artifacts/trunk@289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 06 Nov 2009 08:58:14 +0000
parents 2b7a40b5b535
children 34052186c26b
files gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java	Thu Nov 05 16:02:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java	Fri Nov 06 08:58:14 2009 +0000
@@ -66,6 +66,9 @@
      */
     private static Logger sLogger = Logger.getLogger(ChartFactory.class);
     private static boolean sDebug = sLogger.isDebugEnabled();
+    
+    private final static long NOTIMEGAP = Long.MAX_VALUE - 1000; 
+    // Minus 1000 damit es bei Additionen keinen Überlauf gibt
 
     public synchronized void createSimpleTimeSeriesChart(
                                                          ChartLabels pLabels,
@@ -405,7 +408,7 @@
         if (gapID < 0 || gapID >= 99){
             
             if (gapID == -1){ // Mesh
-                gap = Long.MAX_VALUE; // Es gibt keine Lücken in Netzen.
+                gap = NOTIMEGAP; // Es gibt keine Lücken in Netzen.
             }else if (pEnd-pStart < 60){
                 gap = (3/(pEnd-pStart)) * (dEnd.getTime() - dStart.getTime());
             }

http://dive4elements.wald.intevation.org