Fix building of Java zones

This commit is contained in:
Petr Machata 2011-11-03 22:27:14 +01:00
parent da082e26ff
commit 81ac290464
2 changed files with 50 additions and 3 deletions

View File

@ -0,0 +1,42 @@
# Patch based on fix in JDK8 tree by Yuka Kamiya from Oracle:
# http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f114bddac6d6
diff -up ./sun/tools/javazic/Mappings.java.sav ./sun/tools/javazic/Mappings.java
--- ./sun/tools/javazic/Mappings.java.sav 2011-11-03 16:31:53.000000000 -0400
+++ ./sun/tools/javazic/Mappings.java 2011-11-03 16:41:44.000000000 -0400
@@ -77,15 +77,17 @@ class Mappings {
int rawOffset = zone.get(zone.size()-1).getGmtOffset();
// If the GMT offset of this Zone will change in some
// future time, this Zone is added to the exclude list.
- if (zone.size() > 1) {
- ZoneRec zrec = zone.get(zone.size()-2);
+ boolean isExcluded = false;
+ for (int i = 0; i < zone.size(); i++) {
+ ZoneRec zrec = zone.get(i);
if ((zrec.getGmtOffset() != rawOffset)
&& (zrec.getUntilTime(0) > Time.getCurrentTime())) {
if (excludeList == null) {
excludeList = new ArrayList<String>();
}
excludeList.add(zone.getName());
- continue;
+ isExcluded = true;
+ break;
}
}
@@ -101,9 +103,13 @@ class Mappings {
rawOffsetsIndex.add(i, rawOffset);
Set<String> perRawOffset = new TreeSet<String>();
+ if (!isExcluded) {
+ perRawOffset = new TreeSet<String>();
+ }
+
perRawOffset.add(zonename);
rawOffsetsIndexTable.add(i, perRawOffset);
- } else {
+ } else if (!isExcluded) {
int i = rawOffsetsIndex.indexOf(new Integer(rawOffset));
Set<String> perRawOffset = rawOffsetsIndexTable.get(i);
perRawOffset.add(zonename);

View File

@ -3,7 +3,7 @@ Name: tzdata
Version: 2011n
%define tzdata_version 2011n
%define tzcode_version 2011i
Release: 1%{?dist}
Release: 2%{?dist}
License: Public Domain
Group: System Environment/Base
URL: ftp://munnari.oz.au/pub/
@ -34,7 +34,8 @@ the world.
Summary: Timezone data for Java
Group: System Environment/Base
Source3: javazic.tar.gz
Patch0: javazic-fixup.patch
Patch100: javazic-fixup.patch
Patch101: javazic-exclusion-fix.patch
%description java
This package contains timezone information for use by Java runtimes.
@ -55,7 +56,8 @@ sed -e 's|@objpfx@|'`pwd`'/obj/|' \
mkdir javazic
tar zxf %{SOURCE3} -C javazic
pushd javazic
%patch0
%patch100
%patch101
# Hack alert! sun.tools may be defined and installed in the
# VM. In order to guarantee that we are using IcedTea/OpenJDK
@ -111,6 +113,9 @@ rm -rf %{buildroot}
%{_datadir}/javazi
%changelog
* Thu Nov 3 2011 Petr Machata <pmachata@redhat.com> - 2011n-2
- Fix building of Java zones. Patch by Deepak Bhole
* Mon Oct 31 2011 Petr Machata <pmachata@redhat.com> - 2011l-1
- Rebase to 2011n
- Drop all patches, including the Kemerovo patch, which is not in