Skip to content

Commit 1804917

Browse files
committed
Backport a9a3463afb33b9df4cbf64d1866255bff638824f
1 parent 10e109d commit 1804917

15 files changed

+60
-105
lines changed

test/jdk/java/util/Locale/Bug8179071.java renamed to test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @bug 8179071 8202537 8231273 8251317
2727
* @summary Test that language aliases of CLDR supplemental metadata are handled correctly.
2828
* @modules jdk.localedata
29-
* @run junit/othervm -Djava.locale.providers=CLDR Bug8179071
29+
* @run junit/othervm -Djava.locale.providers=CLDR AliasesShouldBeRecognizedInCLDR
3030
*/
3131

3232
/*
@@ -49,7 +49,7 @@
4949
import static org.junit.jupiter.api.Assertions.assertEquals;
5050
import static org.junit.jupiter.api.Assertions.assertTrue;
5151

52-
public class Bug8179071 {
52+
public class AliasesShouldBeRecognizedInCLDR {
5353

5454
/*
5555
* Deprecated and Legacy tags.

test/jdk/java/util/Locale/Bug4518797.java renamed to test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 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
@@ -24,14 +24,18 @@
2424
* @test
2525
* @bug 4518797
2626
* @summary Make sure that hashCode() and read/writeObject() are thread-safe.
27-
* @run main Bug4518797 10
27+
* @run main HashCodeShouldBeThreadSafe 10
2828
*/
2929

30-
import java.util.*;
31-
import java.io.*;
30+
import java.io.ByteArrayInputStream;
31+
import java.io.ByteArrayOutputStream;
32+
import java.io.IOException;
33+
import java.io.ObjectInputStream;
34+
import java.io.ObjectOutputStream;
35+
import java.util.Locale;
3236

33-
// Usage: java Bug4518797 [duration]
34-
public class Bug4518797 {
37+
// Usage: java HashCodeShouldBeThreadSafe [duration]
38+
public class HashCodeShouldBeThreadSafe {
3539
static volatile boolean runrun = true;
3640
static volatile String message = null;
3741

test/jdk/java/util/Locale/Bug4184873Test.java renamed to test/jdk/java/util/Locale/LegacyCodesClassInvariant.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 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
@@ -22,10 +22,10 @@
2222
*/
2323
/*
2424
@test
25+
@bug 4184873
2526
@summary test that locale invariants are preserved across serialization
2627
@library /java/text/testlib
27-
@run main Bug4184873Test
28-
@bug 4184873
28+
@run main LegacyCodesClassInvariant
2929
*/
3030
/*
3131
* This file is available under and governed by the GNU General Public
@@ -61,18 +61,22 @@
6161
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
6262
*/
6363

64-
import java.util.*;
65-
import java.io.*;
64+
import java.io.File;
65+
import java.io.FileInputStream;
66+
import java.io.FileOutputStream;
67+
import java.io.ObjectInputStream;
68+
import java.io.ObjectOutputStream;
69+
import java.util.Locale;
6670

6771
/**
6872
* A Locale can never contain the following language codes: he, yi or id.
6973
*/
70-
public class Bug4184873Test extends IntlTest {
74+
public class LegacyCodesClassInvariant extends IntlTest {
7175
public static void main(String[] args) throws Exception {
7276
if (args.length == 1 && args[0].equals("prepTest")) {
7377
prepTest();
7478
} else {
75-
new Bug4184873Test().run(args);
79+
new LegacyCodesClassInvariant().run(args);
7680
}
7781
}
7882

@@ -104,7 +108,7 @@ private void verify(String lang) {
104108

105109
private ObjectInputStream getStream(String lang) {
106110
try {
107-
final File f = new File(System.getProperty("test.src", "."), "Bug4184873_"+lang);
111+
final File f = new File(System.getProperty("test.src", "."), "LegacyCodesClassInvariant_"+lang);
108112
return new ObjectInputStream(new FileInputStream(f));
109113
} catch (Exception e) {
110114
errln(e.toString());
@@ -125,7 +129,7 @@ private static void prepTest() {
125129
private static void outputLocale(String lang) {
126130
try {
127131
ObjectOutputStream out = new ObjectOutputStream(
128-
new FileOutputStream("Bug4184873_"+lang));
132+
new FileOutputStream("LegacyCodesClassInvariant_"+lang));
129133
out.writeObject(new Locale(lang, "XX"));
130134
out.close();
131135
} catch (Exception e) {
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/jdk/java/util/Locale/Bug7069824.java renamed to test/jdk/java/util/Locale/LocaleMatchingTest.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 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
@@ -25,19 +25,27 @@
2525
* @test
2626
* @bug 7069824 8042360 8032842 8175539 8210443 8242010
2727
* @summary Verify implementation for Locale matching.
28-
* @run testng/othervm Bug7069824
28+
* @run testng/othervm LocaleMatchingTest
2929
*/
3030

31-
import java.util.*;
32-
import java.util.Locale.*;
31+
import java.util.ArrayList;
32+
import java.util.HashMap;
33+
import java.util.Iterator;
34+
import java.util.LinkedHashMap;
35+
import java.util.List;
36+
import java.util.Locale;
37+
import java.util.Locale.FilteringMode;
38+
import java.util.Locale.LanguageRange;
39+
import java.util.Map;
40+
3341
import static java.util.Locale.FilteringMode.*;
3442
import static java.util.Locale.LanguageRange.*;
3543
import static org.testng.Assert.*;
3644

3745
import org.testng.annotations.DataProvider;
3846
import org.testng.annotations.Test;
3947

40-
public class Bug7069824 {
48+
public class LocaleMatchingTest {
4149

4250
@DataProvider(name = "LRConstructorData")
4351
Object[][] LRConstructorData() {

test/jdk/java/util/Locale/Bug4152725.java renamed to test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 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
@@ -26,24 +26,24 @@
2626
* @summary Verify that the default locale can be specified from the
2727
* command line.
2828
* @run main/othervm -Duser.language=de -Duser.country=DE -Duser.variant=EURO
29-
* Bug4152725 de_DE_EURO
29+
* LocaleShouldSetFromCLI de_DE_EURO
3030
* @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant=
31-
* Bug4152725 ja
31+
* LocaleShouldSetFromCLI ja
3232
* @run main/othervm -Duser.language=en -Duser.country=SG -Duser.variant=
33-
* Bug4152725 en_SG
33+
* LocaleShouldSetFromCLI en_SG
3434
* @run main/othervm -Duser.language= -Duser.country=DE -Duser.variant=EURO
35-
* Bug4152725 _DE_EURO
35+
* LocaleShouldSetFromCLI _DE_EURO
3636
* @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant=YOMI
37-
* Bug4152725 ja__YOMI
37+
* LocaleShouldSetFromCLI ja__YOMI
3838
* @run main/othervm -Duser.language= -Duser.country= -Duser.variant=EURO
39-
* Bug4152725 __EURO
39+
* LocaleShouldSetFromCLI __EURO
4040
* @run main/othervm -Duser.language=de -Duser.region=DE_EURO
41-
* Bug4152725 de_DE_EURO
41+
* LocaleShouldSetFromCLI de_DE_EURO
4242
*/
4343

4444
import java.util.Locale;
4545

46-
public class Bug4152725 {
46+
public class LocaleShouldSetFromCLI {
4747

4848
public static void main(String[] args) {
4949

test/jdk/java/util/Locale/Bug8135061.java renamed to test/jdk/java/util/Locale/LookupOnValidRangeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @bug 8135061
2727
* @summary Checks that the Locale.lookup executes properly without throwing
2828
* any exception for some specific language ranges
29-
* @run junit Bug8135061
29+
* @run junit LookupOnValidRangeTest
3030
*/
3131

3232
import java.util.Collection;
@@ -40,7 +40,7 @@
4040
import static org.junit.jupiter.api.Assertions.assertEquals;
4141
import static org.junit.jupiter.api.Assertions.assertNull;
4242

43-
public class Bug8135061 {
43+
public class LookupOnValidRangeTest {
4444

4545
/**
4646
* Lookup should run without throwing any exception and return null as

test/jdk/java/util/Locale/Bug8035133.java renamed to test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @bug 8035133
2626
* @summary Checks that the tags matching the range with quality weight q=0
2727
* e.g. en;q=0 must be elimited and must not be the part of output
28-
* @run junit Bug8035133
28+
* @run junit MatchEmptyWeightCorrectly
2929
*/
3030

3131
import java.util.ArrayList;
@@ -40,7 +40,7 @@
4040

4141
import static org.junit.jupiter.api.Assertions.assertEquals;
4242

43-
public class Bug8035133 {
43+
public class MatchEmptyWeightCorrectly {
4444

4545
// Ensure weights with 'q=0' work as expected during lookup
4646
@ParameterizedTest

0 commit comments

Comments
 (0)