Skip to content

Commit dd930c5

Browse files
committed
8329787: Fix typo in CLDRConverter
Reviewed-by: jlu, iris, lancea, bpb
1 parent 115f419 commit dd930c5

File tree

3 files changed

+17
-34
lines changed

3 files changed

+17
-34
lines changed

make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class CLDRConverter {
9797
private static final String DST = "dst";
9898
private static final String NO_SUBST = "-";
9999

100-
private static SupplementDataParseHandler handlerSuppl;
100+
private static SupplementalDataParseHandler handlerSuppl;
101101
private static LikelySubtagsParseHandler handlerLikelySubtags;
102102
private static WinZonesParseHandler handlerWinZones;
103103
static PluralsParseHandler handlerPlurals;
@@ -471,7 +471,7 @@ private static void parseSupplemental() throws Exception {
471471
// SupplementalData file also provides the "parent" locales which
472472
// are othrwise not to be fallen back. Process them here as well.
473473
//
474-
handlerSuppl = new SupplementDataParseHandler();
474+
handlerSuppl = new SupplementalDataParseHandler();
475475
parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl);
476476
Map<String, Object> parentData = handlerSuppl.getData("root");
477477
parentData.keySet().stream()

make/jdk/src/classes/build/tools/cldrconverter/SupplementDataParseHandler.java renamed to make/jdk/src/classes/build/tools/cldrconverter/SupplementalDataParseHandler.java

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,11 +38,11 @@
3838
import org.xml.sax.SAXException;
3939

4040
/**
41-
* Handles parsing of files in Locale Data Markup Language for SupplementData.xml
41+
* Handles parsing of files in Locale Data Markup Language for supplementalData.xml
4242
* and produces a map that uses the keys and values of JRE locale data.
4343
*/
4444

45-
class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
45+
class SupplementalDataParseHandler extends AbstractLDMLHandler<Object> {
4646
//UNM49 region and composition code used in supplementalData.xml
4747
private static final String WORLD = "001";
4848

@@ -73,7 +73,7 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
7373
// "component" specific to this parent locale chain
7474
private String currentParentLocaleComponent;
7575

76-
SupplementDataParseHandler() {
76+
SupplementalDataParseHandler() {
7777
firstDayMap = new HashMap<>();
7878
minDaysMap = new HashMap<>();
7979
parentLocalesMap = new HashMap<>();
@@ -132,32 +132,15 @@ public void startElement(String uri, String localName, String qName, Attributes
132132
switch (qName) {
133133
case "firstDay":
134134
if (!isIgnored(attributes)) {
135-
String fd;
136-
137-
switch (attributes.getValue("day")) {
138-
case "sun":
139-
fd = "1";
140-
break;
141-
default:
142-
case "mon":
143-
fd = "2";
144-
break;
145-
case "tue":
146-
fd = "3";
147-
break;
148-
case "wed":
149-
fd = "4";
150-
break;
151-
case "thu":
152-
fd = "5";
153-
break;
154-
case "fri":
155-
fd = "6";
156-
break;
157-
case "sat":
158-
fd = "7";
159-
break;
160-
}
135+
String fd = switch (attributes.getValue("day")) {
136+
case "sun" -> "1";
137+
case "tue" -> "3";
138+
case "wed" -> "4";
139+
case "thu" -> "5";
140+
case "fri" -> "6";
141+
case "sat" -> "7";
142+
default -> "2"; // Mon
143+
};
161144
firstDayMap.put(attributes.getValue("territories"), fd);
162145
}
163146
break;

make/jdk/src/classes/build/tools/cldrconverter/SupplementalMetadataParseHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
3636

3737
/**
3838
* Handles parsing of files in Locale Data Markup Language for
39-
* SupplementalMetadata.xml
39+
* supplementalMetadata.xml
4040
*/
4141

4242
class SupplementalMetadataParseHandler extends AbstractLDMLHandler<Object> {

0 commit comments

Comments
 (0)