harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Yu" <junjie0...@gmail.com>
Subject [classlib][luni]Date.getTimezoneOffset return wrong value
Date Fri, 25 Apr 2008 10:03:15 GMT
Hi, all,

I looked at this issue from the JIRA[1]. The testcase works fine on RI but
fails on Harmony in the second assert statement.
I found that the returned TimeZone instance from
TimeZone.getTimeZone("America/Toronto") on Harmony was "GMT" other than
"America/Toronto". That's why the second assert statement fails on Harmony.
I attached a patch to the JIRA[1], which will solve
this issue. Anybody to verify it? If no objection, I will ask a committer to
apply it: )

-----------------TestCase---------------------------
import java.util.TimeZone;
import java.util.Date;
import junit.framework.TestCase;
public class TestGetTimezoneOffset extends TestCase {
 public void testGetTimezoneOffset() {
  TimeZone.setDefault(TimeZone.getTimeZone("America/Toronto"));
  Date date = new Date(07,2,24);
  assertEquals(300,date.getTimezoneOffset());
  date = new Date(99,8,1);
  assertEquals(240,date.getTimezoneOffset());
 }
}
[1] https://issues.apache.org/jira/browse/HARMONY-4904

-- 
Best Regards,
Jim Yu (虞俊杰)

China Software Development Lab, IBM
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message