Skip to content

Commit

Permalink
8274864: Remove Amman/Cairo hacks in ZoneInfoFile
Browse files Browse the repository at this point in the history
Backport-of: ec199072c5867624d66840238cc8828e16ae8da7
  • Loading branch information
rgithubli committed Apr 13, 2023
1 parent 7d7c993 commit 53bbf3c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -607,34 +607,6 @@ private static ZoneInfo getZoneInfo(String zoneId,
params[8] = endRule.secondOfDay * 1000;
params[9] = toSTZTime[endRule.timeDefinition];
dstSavings = (startRule.offsetAfter - startRule.offsetBefore) * 1000;

// Note: known mismatching -> Asia/Amman
// ZoneInfo : startDayOfWeek=5 <= Thursday
// startTime=86400000 <= 24 hours
// This: startDayOfWeek=6
// startTime=0
// Similar workaround needs to be applied to Africa/Cairo and
// its endDayOfWeek and endTime
// Below is the workarounds, it probably slows down everyone a little
if (params[2] == 6 && params[3] == 0 &&
(zoneId.equals("Asia/Amman"))) {
params[2] = 5;
params[3] = 86400000;
}
// Additional check for startDayOfWeek=6 and starTime=86400000
// is needed for Asia/Amman;
if (params[2] == 7 && params[3] == 0 &&
(zoneId.equals("Asia/Amman"))) {
params[2] = 6; // Friday
params[3] = 86400000; // 24h
}
//endDayOfWeek and endTime workaround
if (params[7] == 6 && params[8] == 0 &&
(zoneId.equals("Africa/Cairo"))) {
params[7] = 5;
params[8] = 86400000;
}

} else if (nTrans > 0) { // only do this if there is something in table already
if (lastyear < LASTYEAR) {
// ZoneInfo has an ending entry for 2037
Expand Down Expand Up @@ -907,7 +879,6 @@ private static class ZoneOffsetTransitionRule {
this.dow = dowByte == 0 ? -1 : dowByte;
this.secondOfDay = timeByte == 31 ? in.readInt() : timeByte * 3600;
this.timeDefinition = (data & (3 << 12)) >>> 12;

this.standardOffset = stdByte == 255 ? in.readInt() : (stdByte - 128) * 900;
this.offsetBefore = beforeByte == 3 ? in.readInt() : standardOffset + beforeByte * 1800;
this.offsetAfter = afterByte == 3 ? in.readInt() : standardOffset + afterByte * 1800;
Expand Down

0 comments on commit 53bbf3c

Please sign in to comment.