Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java @ 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 | 21152e1bf325 |
children | e964a3d8f7bc |
comparison
equal
deleted
inserted
replaced
224:2b7a40b5b535 | 225:219e9666f590 |
---|---|
64 /** | 64 /** |
65 * Default Logging instance | 65 * Default Logging instance |
66 */ | 66 */ |
67 private static Logger sLogger = Logger.getLogger(ChartFactory.class); | 67 private static Logger sLogger = Logger.getLogger(ChartFactory.class); |
68 private static boolean sDebug = sLogger.isDebugEnabled(); | 68 private static boolean sDebug = sLogger.isDebugEnabled(); |
69 | |
70 private final static long NOTIMEGAP = Long.MAX_VALUE - 1000; | |
71 // Minus 1000 damit es bei Additionen keinen Überlauf gibt | |
69 | 72 |
70 public synchronized void createSimpleTimeSeriesChart( | 73 public synchronized void createSimpleTimeSeriesChart( |
71 ChartLabels pLabels, | 74 ChartLabels pLabels, |
72 ChartStyle pStyle, | 75 ChartStyle pStyle, |
73 Collection<KeyValueDescibeData> parameters, | 76 Collection<KeyValueDescibeData> parameters, |
403 long gap = 0; | 406 long gap = 0; |
404 | 407 |
405 if (gapID < 0 || gapID >= 99){ | 408 if (gapID < 0 || gapID >= 99){ |
406 | 409 |
407 if (gapID == -1){ // Mesh | 410 if (gapID == -1){ // Mesh |
408 gap = Long.MAX_VALUE; // Es gibt keine Lücken in Netzen. | 411 gap = NOTIMEGAP; // Es gibt keine Lücken in Netzen. |
409 }else if (pEnd-pStart < 60){ | 412 }else if (pEnd-pStart < 60){ |
410 gap = (3/(pEnd-pStart)) * (dEnd.getTime() - dStart.getTime()); | 413 gap = (3/(pEnd-pStart)) * (dEnd.getTime() - dStart.getTime()); |
411 } | 414 } |
412 }else{ | 415 }else{ |
413 | 416 |