18aa2ce5993b2f06e1d4d60c90d92fe4650b1d75 |
|
06-Feb-2010 |
Elliott Hughes <enh@google.com> |
Fix a bug I introduced to SimpleTimeZone with my Calendar.setTimeZone fix. Our implementations of SimpleTimeZone and Calendar became mutually recursive for custom time zones when I changed GregorianCalendar.computeFields to use TimeZone.inDaylightTime --- SimpleTimeZone's implementation of inDaylightTime creates a GregorianCalendar leading to a stack overflow looking something like this... at java.util.SimpleTimeZone.inDaylightTime(SimpleTimeZone.java:599) at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:595) at java.util.Calendar.complete(Calendar.java:819) at java.util.Calendar.setTimeInMillis(Calendar.java:1319) at java.util.GregorianCalendar.<init>(GregorianCalendar.java:339) at java.util.GregorianCalendar.<init>(GregorianCalendar.java:325) at java.util.SimpleTimeZone.inDaylightTime(SimpleTimeZone.java:599) I've cut the knot by introducing "Grego" from ICU4J, and rewriting our SimpleTimeZone.inDaylightTime in the style of ICU4J's implementation. Maybe we'll be using the ICU4J calendar implementation sooner than I thought!
|