Skip to content

Commit

Permalink
8264792: The NumberFormat for locale sq_XK formats price incorrectly.
Browse files Browse the repository at this point in the history
Backport-of: 41dc795d6c08af84aa6544cc5a5704dcf99386cf
  • Loading branch information
GoeLin committed Jul 28, 2022
1 parent 98f6737 commit 25ad9d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion make/data/currency/CurrencyData.properties
@@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -317,6 +317,8 @@ KI=AUD
KP=KPW
# KOREA (THE REPUBLIC OF)
KR=KRW
# KOSOVO - Not in ISO 3166/4217
XK=EUR
# KUWAIT
KW=KWD
# KYRGYZSTAN
Expand Down
7 changes: 4 additions & 3 deletions test/jdk/java/util/Currency/CurrencyTest.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,7 +23,8 @@
/*
* @test
* @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
* 6488442 7036905 8008577 8039317 8074350 8074351 8150324 8167143
* 6488442 7036905 8008577 8039317 8074350 8074351 8150324 8167143
* 8264792
* @summary Basic tests for Currency class.
* @modules java.base/java.util:open
* jdk.localedata
Expand Down Expand Up @@ -104,7 +105,7 @@ static void testLocaleMapping() {
int ctryLength = ctryCode.length();
if (ctryLength == 0 ||
ctryLength == 3 || // UN M.49 code
ctryCode.matches("AA|Q[M-Z]|X[A-Z]|ZZ" + // user defined codes
ctryCode.matches("AA|Q[M-Z]|X[A-JL-Z]|ZZ" + // user defined codes, excluding "XK" (Kosovo)
"AC|CP|DG|EA|EU|FX|IC|SU|TA|UK")) { // exceptional reservation codes
boolean gotException = false;
try {
Expand Down
9 changes: 6 additions & 3 deletions test/jdk/java/util/Currency/ValidateISO4217.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -24,7 +24,7 @@
* @test
* @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
* 8039317 8074350 8074351 8145952 8187946 8193552 8202026 8204269
* 8208746 8209775 8274658
* 8208746 8209775 8264792 8274658
* @summary Validate ISO 4217 data for Currency class.
* @modules java.base/java.util:open
* jdk.localedata
Expand Down Expand Up @@ -77,7 +77,7 @@ public class ValidateISO4217 {

/*
* Defined in ISO 4217 list, but don't have code and minor unit info in
* it. On the othe hand, both code and minor unit are defined in
* it. On the other hand, both code and minor unit are defined in
* .properties file. I don't know why, though.
*/
{"GS", "GBP", "826", "2"}, // South Georgia And The South Sandwich Islands
Expand All @@ -92,6 +92,9 @@ public class ValidateISO4217 {
{"IM", "GBP", "826", "2"}, // Isle of Man
{"BL", "EUR", "978", "2"}, // Saint Barthelemy
{"MF", "EUR", "978", "2"}, // Saint Martin

/* Defined neither in ISO 4217 nor ISO 3166 list */
{"XK", "EUR", "978", "2"}, // Kosovo
};

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

3 comments on commit 25ad9d6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member Author

@GoeLin GoeLin commented on 25ad9d6 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 25ad9d6 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-25ad9d6b in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 25ad9d6b from the openjdk/jdk17u-dev repository.

The commit being backported was authored by Goetz Lindenmaier on 28 Jul 2022 and had no reviewers.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-25ad9d6b:GoeLin-backport-25ad9d6b
$ git checkout GoeLin-backport-25ad9d6b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-25ad9d6b

Please sign in to comment.