summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2019-03-25 14:19:05 +0000
committerNeil Fuller <nfuller@google.com>2019-03-26 15:21:43 +0000
commit1e636e52c35e1d3527207d6a8b864a03bf5ce581 (patch)
treeef60d820dd4b53dd6cc85c826f6329db75a99ff5 /annotations/generate_annotated_java_files.py
parent7ef5542dd47503ceb1b686b19a43c0ebe5591266 (diff)
Fix android.text.format.Time behavior
Fix android.text.format.Time behavior when using zic > 2014b and where zones now have transitions close to Integer.MIN_VALUE and Integer.MAX_VALUE. In those cases the act of adjusting for offset can cause over/underflow and lead to -1. This was particularly noticeable with Asia/Singapore as the last DST transition with zic <= 2014b was in 1981 and it has a positive DST offset. Therefore most date calculations involving times since 1981 with zic > 2014b would consider the transition at Integer.MAX_VALUE and add the offset of 8 hours to get local time, thereby exceeding Integer.MAX_VALUE and causing an error. This change also fixes another bug around the offset used for times before the first explicit transition. This was noticed while running the new TimeTest tests with zic <= 2014b. Testing: atest CtsTextTestCases:android.text.format.cts.TimeTest atest CtsLibcoreTestCases:libcore.libcore.util.ZoneInfoTest atest CtsLibcoreTestCases:libcore.java.util.TimeZoneTest atest FrameworksCoreTests:android.text.format.TimeTest ...with 2014b zic data and 2018e zic data. All tests pass with both. Bug: 118835133 Test: See above Change-Id: I0ce9eb25a783ac17f28d8dc0c63865df51bf46db
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions