From 8336756ab8ac37e0595ea1d47082910b3f2d0dfb Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 25 Oct 2023 16:50:31 +0000 Subject: [PATCH] 8318487: Specification of the ListFormat.equals() method can be improved Reviewed-by: joehw, rriggs, lancea, iris --- src/java.base/share/classes/java/text/ListFormat.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/text/ListFormat.java b/src/java.base/share/classes/java/text/ListFormat.java index 920cd9a076214..cd26f68bf4639 100644 --- a/src/java.base/share/classes/java/text/ListFormat.java +++ b/src/java.base/share/classes/java/text/ListFormat.java @@ -500,11 +500,12 @@ public AttributedCharacterIterator formatToCharacterIterator(Object arguments) { } /** - * Checks if this {@code ListFormat} is equal to another {@code ListFormat}. - * The comparison is based on the {@code Locale} and formatting patterns, given or - * generated with {@code Locale}, {@code Type}, and {@code Style}. - * @param obj the object to check, {@code null} returns {@code false} - * @return {@code true} if this is equals to the other {@code ListFormat} + * Compares the specified object with this {@code ListFormat} for equality. + * Returns {@code true} if the specified object is also a {@code ListFormat}, and + * {@code locale} and {@code patterns}, returned from {@link #getLocale()} + * and {@link #getPatterns()} respectively, are equal. + * @param obj the object to be compared for equality. + * @return {@code true} if the specified object is equal to this {@code ListFormat} */ @Override public boolean equals(Object obj) {