From 51a7ff65949e77c58c66f724e9047ca591e5c6d4 Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Mon, 21 Oct 2024 17:08:50 +0000 Subject: [PATCH] 8335271: Specify the MessageFormat ArgumentIndex Implementation Limit Reviewed-by: darcy, iris, naoto, rriggs --- src/java.base/share/classes/java/text/MessageFormat.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/text/MessageFormat.java b/src/java.base/share/classes/java/text/MessageFormat.java index 83cc3ec4647..4a3ca0b2dcb 100644 --- a/src/java.base/share/classes/java/text/MessageFormat.java +++ b/src/java.base/share/classes/java/text/MessageFormat.java @@ -110,17 +110,21 @@ import java.util.Objects; * * *

- * The ArgumentIndex value is a non-negative integer written + * The {@code ArgumentIndex} value is a non-negative integer written * using the digits {@code '0'} through {@code '9'}, and represents an index into the * {@code arguments} array passed to the {@code format} methods * or the result array returned by the {@code parse} methods. *

- * The FormatType and FormatStyle values are used to create + * Any constructor or method that takes a String pattern parameter will throw an {@code IllegalArgumentException} if the + * pattern contains an {@code ArgumentIndex} value that is equal to or exceeds an implementation limit. + *

+ * The {@code FormatType} and {@code FormatStyle} values are used to create * a {@code Format} instance for the format element. The following * table shows how the values map to {@code Format} instances. These values * are case-insensitive when passed to {@link #applyPattern(String)}. Combinations * not shown in the table are illegal. A SubformatPattern must * be a valid pattern string for the {@code Format} subclass used. + * @implNote In the reference implementation, the limit of {@code ArgumentIndex} is 10,000. * * *
Shows how FormatType and FormatStyle values map to Format instances