Skip to content

Commit b98baff

Browse files
committed
fixes: jakartaee#360 challenge for NumberFormatCustomizationTest
A @JsonbNumberFormat(value = "###,###.##") without any specified locale results in a JSON serialisation which is depending on the Locale of the box you run the TCK on. This is not reproducible. There are 2 ways to define the Locale: * with the JsonbNumberFormat#locale attribute * with JsonbConfig#withLocale This test at least pins down the Locale to guarantee reproducible builds.
1 parent f3a2332 commit b98baff

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

tck/src/main/java/ee/jakarta/tck/json/bind/customizedmapping/numberformat/NumberFormatCustomizationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at

tck/src/main/java/ee/jakarta/tck/json/bind/customizedmapping/numberformat/model/AccessorCustomizedDoubleContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -29,7 +29,7 @@ public class AccessorCustomizedDoubleContainer
2929
private Double instance;
3030

3131
@Override
32-
@JsonbNumberFormat(value = "###,###.##")
32+
@JsonbNumberFormat(value = "###,###.##", locale = "en_US")
3333
public Double getInstance() {
3434
return instance;
3535
}

tck/src/main/java/ee/jakarta/tck/json/bind/customizedmapping/numberformat/model/TypeCustomizedDoubleContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -24,7 +24,7 @@
2424

2525
import ee.jakarta.tck.json.bind.TypeContainer;
2626

27-
@JsonbNumberFormat(value = "###,###.##")
27+
@JsonbNumberFormat(value = "###,###.##", locale = "en_US")
2828
public class TypeCustomizedDoubleContainer implements TypeContainer<Double> {
2929
private Double instance;
3030

tck/src/main/java/ee/jakarta/tck/json/bind/customizedmapping/numberformat/model/TypeCustomizedFieldOverriddenDoubleContainer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -24,10 +24,10 @@
2424

2525
import ee.jakarta.tck.json.bind.TypeContainer;
2626

27-
@JsonbNumberFormat(value = "###,###.##")
27+
@JsonbNumberFormat(value = "###,###.##", locale = "en_US")
2828
public class TypeCustomizedFieldOverriddenDoubleContainer
2929
implements TypeContainer<Double> {
30-
@JsonbNumberFormat(value = "###,###.#")
30+
@JsonbNumberFormat(value = "###,###.#", locale = "en_US")
3131
private Double instance;
3232

3333
@Override

tck/src/main/java/ee/jakarta/tck/json/bind/customizedmapping/numberformat/model/customized/PackageCustomizedTypeOverriddenDoubleContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -24,7 +24,7 @@
2424

2525
import ee.jakarta.tck.json.bind.TypeContainer;
2626

27-
@JsonbNumberFormat(value = "###,###.##")
27+
@JsonbNumberFormat(value = "###,###.##", locale = "en_US")
2828
public class PackageCustomizedTypeOverriddenDoubleContainer
2929
implements TypeContainer<Double> {
3030
private Double instance;

0 commit comments

Comments
 (0)