|
1 | 1 | /* |
2 | | - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
48 | 48 | import java.util.ArrayList; |
49 | 49 | import java.util.Currency; |
50 | 50 | import java.util.Locale; |
| 51 | +import java.util.Objects; |
51 | 52 | import java.util.concurrent.atomic.AtomicInteger; |
52 | 53 | import java.util.concurrent.atomic.AtomicLong; |
53 | 54 |
|
@@ -2811,9 +2812,11 @@ public String getPositivePrefix () { |
2811 | 2812 | * Set the positive prefix. |
2812 | 2813 | * <P>Examples: +123, $123, sFr123 |
2813 | 2814 | * |
2814 | | - * @param newValue the new positive prefix |
| 2815 | + * @param newValue the new positive prefix. Non-null. |
| 2816 | + * @throws NullPointerException if {@code newValue} is {@code null} |
2815 | 2817 | */ |
2816 | 2818 | public void setPositivePrefix (String newValue) { |
| 2819 | + Objects.requireNonNull(newValue, "prefix must not be null"); |
2817 | 2820 | positivePrefix = newValue; |
2818 | 2821 | posPrefixPattern = null; |
2819 | 2822 | positivePrefixFieldPositions = null; |
@@ -2853,9 +2856,11 @@ public String getNegativePrefix () { |
2853 | 2856 | * Set the negative prefix. |
2854 | 2857 | * <P>Examples: -123, ($123) (with negative suffix), sFr-123 |
2855 | 2858 | * |
2856 | | - * @param newValue the new negative prefix |
| 2859 | + * @param newValue the new negative prefix. Non-null. |
| 2860 | + * @throws NullPointerException if {@code newValue} is {@code null} |
2857 | 2861 | */ |
2858 | 2862 | public void setNegativePrefix (String newValue) { |
| 2863 | + Objects.requireNonNull(newValue, "prefix must not be null"); |
2859 | 2864 | negativePrefix = newValue; |
2860 | 2865 | negPrefixPattern = null; |
2861 | 2866 | fastPathCheckNeeded = true; |
@@ -2894,9 +2899,11 @@ public String getPositiveSuffix () { |
2894 | 2899 | * Set the positive suffix. |
2895 | 2900 | * <P>Example: 123% |
2896 | 2901 | * |
2897 | | - * @param newValue the new positive suffix |
| 2902 | + * @param newValue the new positive suffix. Non-null. |
| 2903 | + * @throws NullPointerException if {@code newValue} is {@code null} |
2898 | 2904 | */ |
2899 | 2905 | public void setPositiveSuffix (String newValue) { |
| 2906 | + Objects.requireNonNull(newValue, "suffix must not be null"); |
2900 | 2907 | positiveSuffix = newValue; |
2901 | 2908 | posSuffixPattern = null; |
2902 | 2909 | fastPathCheckNeeded = true; |
@@ -2935,9 +2942,11 @@ public String getNegativeSuffix () { |
2935 | 2942 | * Set the negative suffix. |
2936 | 2943 | * <P>Examples: 123% |
2937 | 2944 | * |
2938 | | - * @param newValue the new negative suffix |
| 2945 | + * @param newValue the new negative suffix. Non-null. |
| 2946 | + * @throws NullPointerException if {@code newValue} is {@code null} |
2939 | 2947 | */ |
2940 | 2948 | public void setNegativeSuffix (String newValue) { |
| 2949 | + Objects.requireNonNull(newValue, "suffix must not be null"); |
2941 | 2950 | negativeSuffix = newValue; |
2942 | 2951 | negSuffixPattern = null; |
2943 | 2952 | fastPathCheckNeeded = true; |
|
0 commit comments