Skip to content

Commit e4167bd

Browse files
committed
Merge
2 parents 67a5ed9 + 02875e7 commit e4167bd

File tree

681 files changed

+14732
-6557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

681 files changed

+14732
-6557
lines changed

make/CompileToolsJdk.gmk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2023, 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
@@ -69,6 +69,13 @@ $(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
6969

7070
TARGETS += $(COPY_NIMBUS_TEMPLATES)
7171

72+
$(eval $(call SetupCopyFiles,COPY_CLDRCONVERTER_PROPERTIES, \
73+
SRC := $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter, \
74+
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/cldrconverter, \
75+
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties)))
76+
77+
TARGETS += $(COPY_CLDRCONVERTER_PROPERTIES)
78+
7279
################################################################################
7380

7481
$(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \

make/ReleaseFile.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ define create-info-file
5151
$(if $(VENDOR_VERSION_STRING), \
5252
$(call info-file-item, "IMPLEMENTOR_VERSION", "$(VENDOR_VERSION_STRING)"))
5353
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
54+
$(call info-file-item, "JAVA_RUNTIME_VERSION", "$(VERSION_STRING)")
5455
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
5556
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
5657
$(call info-file-item, "LIBC", "$(RELEASE_FILE_LIBC)")

make/autoconf/flags-cflags.m4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
476476
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 \
477477
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
478478
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 \
479-
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE \
480-
-D_WINSOCK_DEPRECATED_NO_WARNINGS"
479+
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE"
481480
fi
482481
483482
###############################################################################

make/autoconf/libraries.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
171171
if test "x$OPENJDK_TARGET_OS" = xwindows; then
172172
BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
173173
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib powrprof.lib uuid.lib \
174-
wsock32.lib winmm.lib version.lib psapi.lib"
174+
ws2_32.lib winmm.lib version.lib psapi.lib"
175175
fi
176176
LIB_SETUP_JVM_LIBS(BUILD)
177177
LIB_SETUP_JVM_LIBS(TARGET)

make/data/cldr/common/main/en.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,8 @@ annotations.
11931193
<territory type="TM">Turkmenistan</territory>
11941194
<territory type="TN">Tunisia</territory>
11951195
<territory type="TO">Tonga</territory>
1196-
<territory type="TR">Turkey</territory>
1197-
<territory type="TR" alt="variant">Türkiye</territory>
1196+
<territory type="TR">Türkiye</territory>
1197+
<territory type="TR" alt="variant">Turkey</territory>
11981198
<territory type="TT">Trinidad &amp; Tobago</territory>
11991199
<territory type="TV">Tuvalu</territory>
12001200
<territory type="TW">Taiwan</territory>
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# coverageLevels.txt
2+
# Copyright © 2022 Unicode, Inc.
3+
# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
4+
# For terms of use, see http://www.unicode.org/copyright.html
5+
#
6+
# Provides the Coverage Level of locales at Basic or Above.
7+
# For more info,see the Locale Coverage Chart for this version.
8+
# Generated by ShowLocaleCoverage.
9+
#
10+
#Locale ; Level
11+
af ; modern
12+
am ; modern
13+
ar ; modern
14+
as ; modern
15+
ast ; basic
16+
az ; modern
17+
be ; modern
18+
bg ; modern
19+
bgc ; basic
20+
bho ; basic
21+
bn ; modern
22+
br ; moderate
23+
brx ; basic
24+
bs ; modern
25+
bs_Cyrl ; basic
26+
ca ; modern
27+
ceb ; moderate
28+
chr ; modern
29+
cs ; modern
30+
cv ; moderate
31+
cy ; modern
32+
da ; modern
33+
de ; modern
34+
doi ; basic
35+
dsb ; modern
36+
el ; modern
37+
en ; modern
38+
es ; modern
39+
et ; modern
40+
eu ; modern
41+
fa ; modern
42+
ff_Adlm ; basic
43+
fi ; modern
44+
fil ; modern
45+
fo ; basic
46+
fr ; modern
47+
ga ; modern
48+
gd ; modern
49+
gl ; modern
50+
gu ; modern
51+
ha ; modern
52+
he ; modern
53+
hi ; modern
54+
hi_Latn ; modern
55+
hr ; modern
56+
hsb ; modern
57+
hu ; modern
58+
hy ; modern
59+
ia ; basic
60+
id ; modern
61+
ig ; modern
62+
is ; modern
63+
it ; modern
64+
ja ; modern
65+
jv ; modern
66+
ka ; modern
67+
kea ; basic
68+
kgp ; basic
69+
kk ; modern
70+
km ; modern
71+
kn ; modern
72+
ko ; modern
73+
kok ; modern
74+
ks ; basic
75+
ks_Deva ; basic
76+
ky ; modern
77+
lo ; modern
78+
lt ; modern
79+
lv ; modern
80+
mai ; basic
81+
mi ; basic
82+
mk ; modern
83+
ml ; modern
84+
mn ; modern
85+
mni ; basic
86+
mr ; modern
87+
ms ; modern
88+
my ; modern
89+
ne ; modern
90+
nl ; modern
91+
nn ; modern
92+
no ; modern
93+
or ; modern
94+
pa ; modern
95+
pcm ; modern
96+
pl ; modern
97+
ps ; modern
98+
pt ; modern
99+
qu ; moderate
100+
raj ; basic
101+
rm ; basic
102+
ro ; modern
103+
ru ; modern
104+
sa ; basic
105+
sat ; basic
106+
sc ; moderate
107+
sd ; modern
108+
sd_Deva ; basic
109+
si ; modern
110+
sk ; modern
111+
sl ; modern
112+
so ; modern
113+
sq ; modern
114+
sr ; modern
115+
su ; basic
116+
sv ; modern
117+
sw ; modern
118+
ta ; modern
119+
te ; modern
120+
tg ; basic
121+
th ; modern
122+
ti ; basic
123+
tk ; modern
124+
to ; basic
125+
tr ; modern
126+
tt ; basic
127+
uk ; modern
128+
ur ; modern
129+
uz ; modern
130+
uz_Cyrl ; basic
131+
vi ; modern
132+
wo ; basic
133+
xh ; moderate
134+
yo ; modern
135+
yrl ; basic
136+
yue ; modern
137+
yue_Hans ; modern
138+
zh ; modern
139+
zh_Hant ; modern
140+
zu ; modern
141+
#EOF

make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public final class JdkIdeaAntLogger extends DefaultLogger {
5454
/**
5555
* This is just a way to pass in customized binary string predicates;
5656
*
57-
* TODO: replace with @code{BiPredicate<String, String>} and method reference when moving to 8
57+
* TODO: replace with {@code BiPredicate<String, String>} and method reference when moving to 8
5858
*/
5959
enum StringBinaryPredicate {
6060
CONTAINS() {

make/ide/idea/langtools/template/src/idea/LangtoolsIdeaAntLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public final class LangtoolsIdeaAntLogger extends DefaultLogger {
5454
/**
5555
* This is just a way to pass in customized binary string predicates;
5656
*
57-
* TODO: replace with @code{BiPredicate<String, String>} and method reference when moving to 8
57+
* TODO: replace with {@code BiPredicate<String, String>} and method reference when moving to 8
5858
*/
5959
enum StringBinaryPredicate {
6060
CONTAINS() {

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

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public class CLDRConverter {
6969
private static String WINZONES_SOURCE_FILE;
7070
private static String PLURALS_SOURCE_FILE;
7171
private static String DAYPERIODRULE_SOURCE_FILE;
72+
private static String COVERAGELEVELS_FILE;
7273
static String DESTINATION_DIR = "build/gensrc";
7374

7475
static final String LOCALE_NAME_PREFIX = "locale.displayname.";
@@ -258,6 +259,7 @@ public static void main(String[] args) throws Exception {
258259
WINZONES_SOURCE_FILE = CLDR_BASE + "/supplemental/windowsZones.xml";
259260
PLURALS_SOURCE_FILE = CLDR_BASE + "/supplemental/plurals.xml";
260261
DAYPERIODRULE_SOURCE_FILE = CLDR_BASE + "/supplemental/dayPeriods.xml";
262+
COVERAGELEVELS_FILE = CLDR_BASE + "/properties/coverageLevels.txt";
261263

262264
if (BASE_LOCALES.isEmpty()) {
263265
setupBaseLocales("en-US");
@@ -359,13 +361,18 @@ private static void enableFileAccess(SAXParser parser) throws SAXNotSupportedExc
359361
private static List<Bundle> readBundleList() throws Exception {
360362
List<Bundle> retList = new ArrayList<>();
361363
Path path = FileSystems.getDefault().getPath(SOURCE_FILE_DIR);
364+
var coverageMap = coverageLevelsMap();
362365
try (DirectoryStream<Path> dirStr = Files.newDirectoryStream(path)) {
363366
for (Path entry : dirStr) {
364367
String fileName = entry.getFileName().toString();
365368
if (fileName.endsWith(".xml")) {
366369
String id = fileName.substring(0, fileName.indexOf('.'));
367370
Locale cldrLoc = Locale.forLanguageTag(toLanguageTag(id));
368-
StringBuilder sb = getCandLocales(cldrLoc);
371+
List<Locale> candList = getCandidateLocales(cldrLoc);
372+
if (!"root".equals(id) && candList.stream().noneMatch(coverageMap::containsKey)) {
373+
continue;
374+
}
375+
StringBuilder sb = getCandLocales(candList);
369376
if (sb.indexOf("root") == -1) {
370377
sb.append("root");
371378
}
@@ -510,8 +517,7 @@ private static void parseLDMLFile(File srcfile, AbstractLDMLHandler<?> handler)
510517
parser.parse(srcfile, handler);
511518
}
512519

513-
private static StringBuilder getCandLocales(Locale cldrLoc) {
514-
List<Locale> candList = getCandidateLocales(cldrLoc);
520+
private static StringBuilder getCandLocales(List<Locale> candList) {
515521
StringBuilder sb = new StringBuilder();
516522
for (Locale loc : candList) {
517523
if (!loc.equals(Locale.ROOT)) {
@@ -1195,6 +1201,26 @@ private static Map<String, String> generateRules(AbstractLDMLHandler<Map<String,
11951201
}));
11961202
}
11971203

1204+
private static Map<Locale, String> coverageLevelsMap() throws Exception {
1205+
// First, parse `coverageLevels.txt` file
1206+
var covMap = Files.readAllLines(Path.of(COVERAGELEVELS_FILE)).stream()
1207+
.filter(line -> !line.isBlank() && !line.startsWith("#"))
1208+
.map(line -> line.split("[\s\t]*;[\s\t]*", 3))
1209+
.filter(a -> a[1].matches("basic|moderate|modern|comprehensive"))
1210+
.collect(Collectors.toMap(
1211+
a -> Locale.forLanguageTag(a[0].replaceAll("_", "-")),
1212+
a -> a[1],
1213+
(v1, v2) -> v2, // should never happen
1214+
HashMap::new));
1215+
1216+
// Add other common (non-seed) locales (below `basic` coverage level) as of v42
1217+
ResourceBundle.getBundle(CLDRConverter.class.getPackageName() + ".OtherCommonLocales")
1218+
.keySet()
1219+
.forEach(k -> covMap.put(Locale.forLanguageTag(k), ""));
1220+
1221+
return covMap;
1222+
}
1223+
11981224
// for debug
11991225
static void dumpMap(Map<String, Object> map) {
12001226
map.entrySet().stream()

0 commit comments

Comments
 (0)