There is an inconsistency between Windows and Linux timezone files generated
during the JDK build. Some timezone files such as TimeZoneNames_en_CA.java,
TimeZoneNames_en_BW.java, TimeZoneNames_en_CM.java, etc. do not contain
short names for particular timezone.
It could be an intensional change by the fix of
JDK-8181157: CLDR Timezone name fallback implementation.
In this case, the timezone files for Windows may accidentally contain short
names. Moreover, some builds for Linux contain short names as well. We
needs to make sure it was intensional or not.
Taking 11.0.2+9 as an example, a source diff below shows a difference in
TimeZoneNames_en_CA.java between Linux and Windows. The Windows version of
TimeZoneNames_em_CA.java has a few extra short name aliases such as "ART" and
"ARST" that are not generated for the Linux version.
---
linux/tz/jdk-11.0.2+9_x64/jdk.localedata/sun/util/resources/cldr/ext/TimeZoneN
ames_en_CA.java
2019-01-18 14:16:26.000000000 +0900
+++
windows/tz/jdk-11.0.2+9_x64/jdk.localedata/sun/util/resources/cldr/ext/TimeZon
eNames_en_CA.java
- protected final Object[][] getContents() {
+ protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
- "",
+ "ART",
"Argentina Summer Time",
- "",
+ "ARST",
"Argentina Time",
- "",
+ "ART",
};
Looking around other bundles including 11.0.1+13, 11.0.2+7, 11.0.2+9
and 12.0.0+33 for Windows and Linux. The timezone files in 11.0.1+13 and
11.0.2+7 for Linux contain short name aliases, which is the same as all
versions for Windows. On the other hand, 11.0.0+28, 11.0.2+9 and 12-ea+33
for Linux do not have short name aliases.
Other TimeZoneNames_en_XX.java files have similar inconsistencies but how
much files contain such inconsistency hasn't been examined yet.
1. Create temporary directory
$ mkdir tz
$ ls
jdk-11.0.0+28_x64 jdk-11.0.1+13_x64 jdk-11.0.2+7_x64 jdk-11.0.2+9_x64
jdk-12-ea+33 tz
2. Extract TimeZoneNames_en_CA.java from src.zip
$ for in in `ls`
for> do
for> mkdir -n tz/$i
for> unzip -d tz/$i lib/src.zip
jdk.localedata/sun/util/resources/cldr/ext/TimeZoneNames_en_CA.java
for> done
3. Compare the Argentina timezone for all TimeZoneNames_en_CA.java
$ for i in *
do
echo $i
tail -n +66
$i/jdk.localedata/sun/util/resources/cldr/ext/TimeZoneNames_en_CA.java | head
-20
done
jdk-11.0.0+28_x64
package sun.util.resources.cldr.ext;
import sun.util.resources.TimeZoneNamesBundle;
public class TimeZoneNames_en_CA extends TimeZoneNamesBundle {
@Override
protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
"",
"Argentina Summer Time",
"",
"Argentina Time",
"",
};
final String[] America_Eastern = new String[] {
"",
"EST",
"",
"EDT",
jdk-11.0.1+13_x64
package sun.util.resources.cldr.ext;
import sun.util.resources.TimeZoneNamesBundle;
public class TimeZoneNames_en_CA extends TimeZoneNamesBundle {
@Override
protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
"ART",
"Argentina Summer Time",
"ARST",
"Argentina Time",
"ART",
};
final String[] America_Eastern = new String[] {
"",
"EST",
"",
"EDT",
jdk-11.0.2+7_x64
package sun.util.resources.cldr.ext;
import sun.util.resources.TimeZoneNamesBundle;
public class TimeZoneNames_en_CA extends TimeZoneNamesBundle {
@Override
protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
"ART",
"Argentina Summer Time",
"ARST",
"Argentina Time",
"ART",
};
final String[] America_Eastern = new String[] {
"",
"EST",
"",
"EDT",
jdk-11.0.2+9_x64
package sun.util.resources.cldr.ext;
import sun.util.resources.TimeZoneNamesBundle;
public class TimeZoneNames_en_CA extends TimeZoneNamesBundle {
@Override
protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
"",
"Argentina Summer Time",
"",
"Argentina Time",
"",
};
final String[] America_Eastern = new String[] {
"",
"EST",
"",
"EDT",
jdk-12-ea+33
package sun.util.resources.cldr.ext;
import sun.util.resources.TimeZoneNamesBundle;
public class TimeZoneNames_en_CA extends TimeZoneNamesBundle {
@Override
protected final Object[][] getContents() {
final String[] Argentina = new String[] {
"Argentina Standard Time",
"",
"Argentina Summer Time",
"",
"Argentina Time",
"",
};
final String[] America_Eastern = new String[] {
"",
"EST",
"",
"EDT",