Skip to content

Commit

Permalink
Enhance parsing of TZDB as lower-case
Browse files Browse the repository at this point in the history
* TZDB data can be any case, so parser needs to adapt
* Handle the full range of potential field separators
  • Loading branch information
jodastephen committed Sep 16, 2024
1 parent 2678e18 commit a0fe056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,14 @@ private void parseFile(File file) throws Exception {
if (line.trim().length() == 0) { // ignore blank lines
continue;
}
StringTokenizer st = new StringTokenizer(line, " \t");
StringTokenizer st = new StringTokenizer(line, " \f\r\t\u000b");
if (openZone != null && Character.isWhitespace(line.charAt(0)) && st.hasMoreTokens()) {
if (parseZoneLine(st, openZone)) {
openZone = null;
}
} else {
if (st.hasMoreTokens()) {
String first = st.nextToken();
String first = st.nextToken().toLowerCase(Locale.ENGLISH);
if (ZONE_LOOKUP.contains(first)) {
if (st.countTokens() < 3) {
printVerbose("Invalid Zone line in file: " + file + ", line: " + line);
Expand Down

0 comments on commit a0fe056

Please sign in to comment.