Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit b3aec28

Browse files
author
Yuri Nesterenko
committed
8264792: The NumberFormat for locale sq_XK formats price incorrectly.
Backport-of: 41dc795d6c08af84aa6544cc5a5704dcf99386cf
1 parent 315ad27 commit b3aec28

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

make/data/currency/CurrencyData.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2000, 2021, 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
@@ -317,6 +317,8 @@ KI=AUD
317317
KP=KPW
318318
# KOREA (THE REPUBLIC OF)
319319
KR=KRW
320+
# KOSOVO - Not in ISO 3166/4217
321+
XK=EUR
320322
# KUWAIT
321323
KW=KWD
322324
# KYRGYZSTAN

test/jdk/java/util/Currency/CurrencyTest.java

+4-3
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, 2021, 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
@@ -23,7 +23,8 @@
2323
/*
2424
* @test
2525
* @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
26-
* 6488442 7036905 8008577 8039317 8074350 8074351 8150324 8167143
26+
* 6488442 7036905 8008577 8039317 8074350 8074351 8150324 8167143
27+
* 8264792
2728
* @summary Basic tests for Currency class.
2829
* @modules java.base/java.util:open
2930
* jdk.localedata
@@ -104,7 +105,7 @@ static void testLocaleMapping() {
104105
int ctryLength = ctryCode.length();
105106
if (ctryLength == 0 ||
106107
ctryLength == 3 || // UN M.49 code
107-
ctryCode.matches("AA|Q[M-Z]|X[A-Z]|ZZ" + // user defined codes
108+
ctryCode.matches("AA|Q[M-Z]|X[A-JL-Z]|ZZ" + // user defined codes, excluding "XK" (Kosovo)
108109
"AC|CP|DG|EA|EU|FX|IC|SU|TA|UK")) { // exceptional reservation codes
109110
boolean gotException = false;
110111
try {

test/jdk/java/util/Currency/ValidateISO4217.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, 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,7 +24,7 @@
2424
* @test
2525
* @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
2626
* 8039317 8074350 8074351 8145952 8187946 8193552 8202026 8204269
27-
* 8208746 8209775 8274658
27+
* 8208746 8209775 8264792 8274658
2828
* @summary Validate ISO 4217 data for Currency class.
2929
* @modules java.base/java.util:open
3030
* jdk.localedata
@@ -77,7 +77,7 @@ public class ValidateISO4217 {
7777

7878
/*
7979
* Defined in ISO 4217 list, but don't have code and minor unit info in
80-
* it. On the othe hand, both code and minor unit are defined in
80+
* it. On the other hand, both code and minor unit are defined in
8181
* .properties file. I don't know why, though.
8282
*/
8383
{"GS", "GBP", "826", "2"}, // South Georgia And The South Sandwich Islands
@@ -92,6 +92,9 @@ public class ValidateISO4217 {
9292
{"IM", "GBP", "826", "2"}, // Isle of Man
9393
{"BL", "EUR", "978", "2"}, // Saint Barthelemy
9494
{"MF", "EUR", "978", "2"}, // Saint Martin
95+
96+
/* Defined neither in ISO 4217 nor ISO 3166 list */
97+
{"XK", "EUR", "978", "2"}, // Kosovo
9598
};
9699

97100
/* Codes that are obsolete, do not have related country, extra currency */

0 commit comments

Comments
 (0)