From 61ee3253e8f51504566babd0aec1e4f1f9217716 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Thu, 10 Jul 2014 22:39:05 +0000 Subject: [PATCH] ICU-10876 document Collator thread-safe only when frozen X-SVN-Rev: 36022 --- .../classes/collate/src/com/ibm/icu/text/Collator.java | 8 +++++++- .../collate/src/com/ibm/icu/text/RuleBasedCollator.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java b/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java index 03e7765793f..d1650939ea7 100644 --- a/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java +++ b/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java @@ -35,6 +35,8 @@ import com.ibm.icu.util.VersionInfo; * subclass, RuleBasedCollator, allows customization of the collation * ordering by the use of rule sets.

* +*

A Collator is thread-safe only when frozen. See {{@link #isFrozen()} and {@link Freezable}. +* *

Following the Unicode * Consortium's specifications for the * Unicode Collation @@ -1411,6 +1413,10 @@ public abstract class Collator implements Comparator, FreezableAn unfrozen Collator is mutable and not thread-safe. + * A frozen Collator is immutable and thread-safe. + * * @stable ICU 4.8 */ public boolean isFrozen() { @@ -1418,7 +1424,7 @@ public abstract class Collator implements Comparator, FreezableUnicode Collation Algorithm (UCA) and conforms to ISO 14651. *

- * + * + *

A Collator is thread-safe only when frozen. See {{@link #isFrozen()} and {@link com.ibm.icu.util.Freezable}. + * *

* Users are strongly encouraged to read the User * Guide for more information about the collation service before using this class. @@ -308,6 +310,10 @@ public final class RuleBasedCollator extends Collator { /** * Determines whether the object has been frozen or not. + * + *

An unfrozen Collator is mutable and not thread-safe. + * A frozen Collator is immutable and thread-safe. + * * @stable ICU 4.8 */ @Override -- 2.40.0