bug in RegularTimePeriod : does not use the current default

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
cblin
Posts: 12
Joined: Sun Jun 08, 2008 6:35 pm

bug in RegularTimePeriod : does not use the current default

Post by cblin » Wed Dec 17, 2008 4:24 pm

Hi,

I think there is a bug in the RegularTimePeriod that is using a static constant to reference the default timezone.

The problem arise with the following code (for ex) :

Code: Select all

new Day(new Date());
Timezone.setDefault(<timezone != previous default>);
new Day(new Date()); -> will still be based on the old default
To avoid this, simply do not use the constant DEFAULT_TIME_ZONE.

The workaround is to ALWAYS use : new Day(<dte>, Timezone.getDefaultTimezone()) but this is quite annoying

regards,

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Dec 17, 2008 5:24 pm

This was fixed for the 1.0.11 release:

http://jfreechart.svn.sourceforge.net/v ... 91&r2=1595
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

cblin
Posts: 12
Joined: Sun Jun 08, 2008 6:35 pm

Post by cblin » Thu Dec 18, 2008 10:13 am

Hi,

thanks for the answer and the link.

I will try to update my dependencies.

regards

Locked