Skip to content

Commit

Permalink
8274864: Remove Amman/Cairo hacks in ZoneInfoFile
Browse files Browse the repository at this point in the history
Reviewed-by: iris, joehw
  • Loading branch information
naotoj committed Oct 8, 2021
1 parent ccbce10 commit ec19907
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 @@ -618,34 +618,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 @@ -918,7 +890,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

5 comments on commit ec19907

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on ec19907 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew the backport was successfully created on the branch gnu-andrew-backport-ec199072 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit ec199072 from the openjdk/jdk repository.

The commit being backported was authored by Naoto Sato on 8 Oct 2021 and was reviewed by Iris Clark and Joe Wang.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git gnu-andrew-backport-ec199072:gnu-andrew-backport-ec199072
$ git checkout gnu-andrew-backport-ec199072
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git gnu-andrew-backport-ec199072

@gnu-andrew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on ec19907 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew the backport was successfully created on the branch gnu-andrew-backport-ec199072 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit ec199072 from the openjdk/jdk repository.

The commit being backported was authored by Naoto Sato on 8 Oct 2021 and was reviewed by Iris Clark and Joe Wang.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git gnu-andrew-backport-ec199072:gnu-andrew-backport-ec199072
$ git checkout gnu-andrew-backport-ec199072
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git gnu-andrew-backport-ec199072

Please sign in to comment.