Re: [SourceJammer-devel] Argh I hate SJ and DST!
Brought to you by:
robertmacgrogan
From: Robert M. <rob...@ya...> - 2005-03-31 15:44:32
|
Somehow Yahoo ate my first attempt to answer this message. I delved into the SJ code to find where's it's doing this date comparison. Here's what it does: 1) Info about the local file is stored in the .source.jam file when you add, check in, check out, or get the file. 2) The date that is stored comes from getting the lastModified() value from the java.io.File object. This value is actually a long, not a Date. I assume it is equivelent to Date.getTime(). 3) When the local/remote sync color is set, the current properties of the local file are compared to the stored values. SJ gets lastModified() again and compares this to the stored lastModified() value. If they are not equal, you get the out-of-sync color. You would not think that the lastModified() value of a file would change just because you go into or out of DST. Why would it? The real question, of course, is how should SJ be comparing these values to avoid this problem? Any ideas? --Rob --- Marc Palmer <ma...@an...> wrote: > > So the clocks go forward here in the UK, and again the SJ server thinks > -all- of my local files are out of date. > > This is such a pain, we have to track it down. How can I help? > > My clients are setup for GMT, with "automatically adjust for DST" turned on. > > The server is setup exactly the same. > > All boxes show the same time. > > I'm guessing there is a problem with some Time/Calendar usage in SJ > server or client not using methods that take the timezone into account > properly. > > Date.getTime() returns UTC. This does not include DST adjustments. So I > suspect in some places SJ is using this UTC value with DST adjusted > (Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) > and in others just the ZONE_OFFSET > > ...or SJ is never doing timezone adjustments. > > Anyway, it's getting confused along these lines. > > Cheers > > > -- > Marc Palmer wj...@wa... > > Wangjammers - Java, J2ME and Web Consultants > ~ http://www.wangjammers.org/ > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > SourceJammer-devel mailing list > Sou...@li... > https://lists.sourceforge.net/lists/listinfo/sourcejammer-devel > __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo |