Compare commits
No commits in common. 'c9' and 'c9-beta' have entirely different histories.
@ -1,4 +1,4 @@
|
||||
SOURCES/javazic-1.8-37392f2f5d59.tar.xz
|
||||
SOURCES/javazic.tar.gz
|
||||
SOURCES/tzcode2025a.tar.gz
|
||||
SOURCES/tzdata2025a.tar.gz
|
||||
SOURCES/tzcode2024a.tar.gz
|
||||
SOURCES/tzdata2024a.tar.gz
|
||||
|
@ -1,4 +1,4 @@
|
||||
77292e1839952807567570118e01405b405af80c SOURCES/javazic-1.8-37392f2f5d59.tar.xz
|
||||
ee8ad215161cd132e65e2be447b279457158b540 SOURCES/javazic.tar.gz
|
||||
31e24f86fda44de2409c8d49708c2145f1ed8030 SOURCES/tzcode2025a.tar.gz
|
||||
e5b9eeb4388c91e462447cafb342d6584243f546 SOURCES/tzdata2025a.tar.gz
|
||||
96c682391618d0f053d70ccb98cd65d969d014cd SOURCES/tzcode2024a.tar.gz
|
||||
310a281e4551e4e9a11db4f9ceea85a6529af4af SOURCES/tzdata2024a.tar.gz
|
||||
|
@ -1,42 +0,0 @@
|
||||
/* Smoke test to ensure that tzdb.data can be loaded.
|
||||
Copyright (c) 2024 Red Hat, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
import java.time.zone.ZoneRulesProvider;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class ZoneTest {
|
||||
public static void main(String[] args) {
|
||||
// This is what failed in OpenJDK's build.tools.cldrconverter.
|
||||
new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"),
|
||||
Locale.US).get(Calendar.YEAR);
|
||||
|
||||
// In some OpenJDK versions, this exercises a different parser.
|
||||
Set<String> available = ZoneRulesProvider.getAvailableZoneIds();
|
||||
boolean errors = false;
|
||||
if (available.contains("ROC"))
|
||||
System.out.println("error: ROC zone is present");
|
||||
if (!available.contains("America/New_York"))
|
||||
System.out.println("error: America/New_York is missing");
|
||||
if (errors)
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -1,86 +0,0 @@
|
||||
Modified for downstream inclusion in tzdata-java.
|
||||
|
||||
commit 1bc13a1c10a580f84f1b7686c95344ec2633f611
|
||||
Author: Florian Weimer <fweimer@openjdk.org>
|
||||
Date: Thu Sep 26 22:37:45 2024 +0000
|
||||
|
||||
8340552: Harden TzdbZoneRulesCompiler against missing zone names
|
||||
|
||||
Reviewed-by: andrew, jlu, naoto
|
||||
|
||||
diff -ur tzdata-2024b.orig/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java tzdata-2024b/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java
|
||||
--- tzdata-2024b.orig/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java 2014-04-22 19:46:49.000000000 +0200
|
||||
+++ tzdata-2024b/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java 2024-09-20 21:10:12.748483767 +0200
|
||||
@@ -248,7 +248,7 @@
|
||||
// link version-region-rules
|
||||
out.writeShort(builtZones.size());
|
||||
for (Map.Entry<String, ZoneRules> entry : builtZones.entrySet()) {
|
||||
- int regionIndex = Arrays.binarySearch(regionArray, entry.getKey());
|
||||
+ int regionIndex = findRegionIndex(regionArray, entry.getKey());
|
||||
int rulesIndex = rulesList.indexOf(entry.getValue());
|
||||
out.writeShort(regionIndex);
|
||||
out.writeShort(rulesIndex);
|
||||
@@ -256,8 +256,8 @@
|
||||
// alias-region
|
||||
out.writeShort(links.size());
|
||||
for (Map.Entry<String, String> entry : links.entrySet()) {
|
||||
- int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey());
|
||||
- int regionIndex = Arrays.binarySearch(regionArray, entry.getValue());
|
||||
+ int aliasIndex = findRegionIndex(regionArray, entry.getKey());
|
||||
+ int regionIndex = findRegionIndex(regionArray, entry.getValue());
|
||||
out.writeShort(aliasIndex);
|
||||
out.writeShort(regionIndex);
|
||||
}
|
||||
@@ -269,6 +269,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ private static int findRegionIndex(String[] regionArray, String region) {
|
||||
+ int index = Arrays.binarySearch(regionArray, region);
|
||||
+ if (index < 0) {
|
||||
+ throw new IllegalArgumentException("Unknown region: " + region);
|
||||
+ }
|
||||
+ return index;
|
||||
+ }
|
||||
+
|
||||
private static final Pattern YEAR = Pattern.compile("(?i)(?<min>min)|(?<max>max)|(?<only>only)|(?<year>[0-9]+)");
|
||||
private static final Pattern MONTH = Pattern.compile("(?i)(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)");
|
||||
private static final Matcher DOW = Pattern.compile("(?i)(mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun)").matcher("");
|
||||
@@ -607,22 +615,20 @@
|
||||
}
|
||||
builtZones.put(aliasId, realRules);
|
||||
}
|
||||
- // remove UTC and GMT
|
||||
- // builtZones.remove("UTC");
|
||||
- // builtZones.remove("GMT");
|
||||
- // builtZones.remove("GMT0");
|
||||
- builtZones.remove("GMT+0");
|
||||
- builtZones.remove("GMT-0");
|
||||
- links.remove("GMT+0");
|
||||
- links.remove("GMT-0");
|
||||
- // remove ROC, which is not supported in j.u.tz
|
||||
- builtZones.remove("ROC");
|
||||
- links.remove("ROC");
|
||||
- // remove EST, HST and MST. They are supported via
|
||||
- // the short-id mapping
|
||||
- builtZones.remove("EST");
|
||||
- builtZones.remove("HST");
|
||||
- builtZones.remove("MST");
|
||||
+
|
||||
+ List<String> zonesToRemove = Arrays.asList(
|
||||
+ // remove UTC and GMT
|
||||
+ "GMT+0",
|
||||
+ "GMT-0",
|
||||
+ // remove ROC, which is not supported in j.u.tz
|
||||
+ "ROC",
|
||||
+ // remove EST, HST and MST. They are supported via
|
||||
+ // the short-id mapping
|
||||
+ "EST",
|
||||
+ "HST",
|
||||
+ "MST");
|
||||
+ builtZones.keySet().removeAll(zonesToRemove);
|
||||
+ links.keySet().removeAll(zonesToRemove);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in new issue