From 16b1911eae0fcf8738983ecec75c4182f03cd002 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Sun, 20 Oct 2024 15:07:02 +0200 Subject: [PATCH 1/2] fixes: #362 Locale problem with JsonbNumberFormat --- .../jakarta/json/bind/annotation/JsonbNumberFormat.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java b/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java index 476fbe11..629afd96 100644 --- a/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java +++ b/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java @@ -20,6 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import java.util.Locale; /** *

Annotation provides way how to set custom number format to field or JavaBean property.

@@ -36,6 +37,11 @@ *
  • package
  • * * + *

    Note that even when specifying a pattern format your JSON is depending on the Locale of the JVM you run on. + * For best portability it is recommended to either specify the {@link #locale()} or define a default Locale via + * {@link jakarta.json.bind.JsonbConfig#withLocale(Locale)}. + *

    + * * @since JSON Binding 1.0 */ @JsonbAnnotation From 272d158bba8758c67d8919612e5121eaa971e592 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Mon, 28 Oct 2024 14:14:08 +0100 Subject: [PATCH 2/2] fixes: #362 Locale with JsonbNumberFormat improvements in wording, copyright updated and unnecessary import removed. --- .../jakarta/json/bind/annotation/JsonbNumberFormat.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java b/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java index 629afd96..b8c21024 100644 --- a/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java +++ b/api/src/main/java/jakarta/json/bind/annotation/JsonbNumberFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,7 +20,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.util.Locale; /** *

    Annotation provides way how to set custom number format to field or JavaBean property.

    @@ -37,9 +36,9 @@ *
  • package
  • * * - *

    Note that even when specifying a pattern format your JSON is depending on the Locale of the JVM you run on. - * For best portability it is recommended to either specify the {@link #locale()} or define a default Locale via - * {@link jakarta.json.bind.JsonbConfig#withLocale(Locale)}. + *

    Note that even when specifying a pattern, the format of the JSON value also depends on the Locale. + * For best portability it is recommended to either specify the {@link #locale()} or define a default Locale + * for JSON-B via {@link jakarta.json.bind.JsonbConfig#withLocale(java.util.Locale)}. *

    * * @since JSON Binding 1.0