52North / sensorweb-server-helgoland

Thin Web binding API to access series data.
GNU General Public License v2.0
24 stars 21 forks source link

Timestamps before 1900 cause IllegalArgumentExceptions #94

Open ridoo opened 9 years ago

ridoo commented 9 years ago

Have a look at this entry: http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=10974

A fix would just use the FixedMilliseconds class instead of Seconds ...

ridoo commented 9 years ago

After testing, it seems that this bug affects deeper changes than just exchanging Second with FixedMilliSecond: When drawing the chart DateAxis fails with

Caused by: java.lang.NullPointerException: null
    at org.jfree.chart.axis.DateAxis.previousStandardDate(DateAxis.java:1018) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.axis.DateAxis.nextStandardDate(DateAxis.java:1091) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.axis.DateAxis.calculateLowestVisibleTickValue(DateAxis.java:848) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.axis.DateAxis.refreshTicksHorizontal(DateAxis.java:1620) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.axis.DateAxis.refreshTicks(DateAxis.java:1556) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:807) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.plot.XYPlot.calculateDomainAxisSpace(XYPlot.java:3070) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.plot.XYPlot.calculateAxisSpace(XYPlot.java:3028) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3156) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1235) ~[jfreechart-1.0.13.jar:na]
    at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1117) ~[jfreechart-1.0.13.jar:na]
    at org.n52.io.img.ChartRenderer.drawChartToImage(ChartRenderer.java:148) ~[timeseries-io-1.4.0-SNAPSHOT.jar:na]

However, unfortunately I found no bug related to this issue on the bugtracker ...