|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
38 | 38 | import org.xml.sax.SAXException; |
39 | 39 |
|
40 | 40 | /** |
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 |
42 | 42 | * and produces a map that uses the keys and values of JRE locale data. |
43 | 43 | */ |
44 | 44 |
|
45 | | -class SupplementDataParseHandler extends AbstractLDMLHandler<Object> { |
| 45 | +class SupplementalDataParseHandler extends AbstractLDMLHandler<Object> { |
46 | 46 | //UNM49 region and composition code used in supplementalData.xml |
47 | 47 | private static final String WORLD = "001"; |
48 | 48 |
|
@@ -73,7 +73,7 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> { |
73 | 73 | // "component" specific to this parent locale chain |
74 | 74 | private String currentParentLocaleComponent; |
75 | 75 |
|
76 | | - SupplementDataParseHandler() { |
| 76 | + SupplementalDataParseHandler() { |
77 | 77 | firstDayMap = new HashMap<>(); |
78 | 78 | minDaysMap = new HashMap<>(); |
79 | 79 | parentLocalesMap = new HashMap<>(); |
@@ -132,32 +132,15 @@ public void startElement(String uri, String localName, String qName, Attributes |
132 | 132 | switch (qName) { |
133 | 133 | case "firstDay": |
134 | 134 | 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 | + }; |
161 | 144 | firstDayMap.put(attributes.getValue("territories"), fd); |
162 | 145 | } |
163 | 146 | break; |
|
0 commit comments