]> granicus.if.org Git - icu/commitdiff
ICU-10876 document Collator thread-safe only when frozen
authorMarkus Scherer <markus.icu@gmail.com>
Thu, 10 Jul 2014 22:39:05 +0000 (22:39 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Thu, 10 Jul 2014 22:39:05 +0000 (22:39 +0000)
X-SVN-Rev: 36022

icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java
icu4j/main/classes/collate/src/com/ibm/icu/text/RuleBasedCollator.java

index 03e7765793fcb025cb06e30ce16cf1752d64dc58..d1650939ea7c958f29a75641139f5bf1c0013236 100644 (file)
@@ -35,6 +35,8 @@ import com.ibm.icu.util.VersionInfo;
 * subclass, RuleBasedCollator, allows customization of the collation
 * ordering by the use of rule sets.</p>
 *
+* <p>A Collator is thread-safe only when frozen. See {{@link #isFrozen()} and {@link Freezable}.
+*
 * <p>Following the <a href=http://www.unicode.org>Unicode
 * Consortium</a>'s specifications for the
 * <a href="http://www.unicode.org/unicode/reports/tr10/">Unicode Collation
@@ -1411,6 +1413,10 @@ public abstract class Collator implements Comparator<Object>, Freezable<Collator
     
     /**
      * Determines whether the object has been frozen or not.
+     *
+     * <p>An 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<Object>, Freezable<Collator
     }
 
     /**
-     * Freezes the collaotr.
+     * Freezes the collator.
      * @return the collator itself.
      * @stable ICU 4.8
      */
index ab7d23066af850117dbaec631a2aab7870bd455a..ec6de2940a45aaecd98ad92bceac4f23c3b44f88 100644 (file)
@@ -43,7 +43,9 @@ import com.ibm.icu.util.VersionInfo;
  * sets. RuleBasedCollator is designed to be fully compliant to the <a
  * href="http://www.unicode.org/unicode/reports/tr10/">Unicode Collation Algorithm (UCA)</a> and conforms to ISO 14651.
  * </p>
- * 
+ *
+ * <p>A Collator is thread-safe only when frozen. See {{@link #isFrozen()} and {@link com.ibm.icu.util.Freezable}.
+ *
  * <p>
  * Users are strongly encouraged to read the <a href="http://userguide.icu-project.org/collation">User
  * Guide</a> 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.
+     *
+     * <p>An unfrozen Collator is mutable and not thread-safe.
+     * A frozen Collator is immutable and thread-safe.
+     *
      * @stable ICU 4.8
      */
     @Override