]> granicus.if.org Git - icu/commitdiff
ICU-9406 deprecate isHiraganaQuaternary(), setHiraganaQuaternary(boolean flag) and...
authorMarkus Scherer <markus.icu@gmail.com>
Wed, 15 Aug 2012 17:09:39 +0000 (17:09 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 15 Aug 2012 17:09:39 +0000 (17:09 +0000)
X-SVN-Rev: 32176

icu4j/main/classes/collate/src/com/ibm/icu/text/RuleBasedCollator.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationAPITest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationKanaTest.java

index 4b2fa8d9181b3d875eaff406542e0a6670ef6d9f..d230b506523145ccdb7cadf8ac4b0041a0ad9be0 100644 (file)
@@ -327,37 +327,41 @@ public final class RuleBasedCollator extends Collator {
      * Sets the Hiragana Quaternary mode to be on or off. When the Hiragana Quaternary mode is turned on, the collator
      * positions Hiragana characters before all non-ignorable characters in QUATERNARY strength. This is to produce a
      * correct JIS collation order, distinguishing between Katakana and Hiragana characters.
+     *
+     * This attribute is an implementation detail of the CLDR Japanese tailoring.
+     * The implementation might change to use a different mechanism
+     * to achieve the same Japanese sort order.
+     * Since ICU 50, this attribute is not settable any more via API functions.
      * 
      * @param flag
      *            true if Hiragana Quaternary mode is to be on, false otherwise
      * @see #setHiraganaQuaternaryDefault
      * @see #isHiraganaQuaternary
-     * @stable ICU 2.8
+     * @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
      */
     public void setHiraganaQuaternary(boolean flag) {
         if (isFrozen()) {
             throw new UnsupportedOperationException("Attempt to modify frozen object");
         }
-
-        m_isHiragana4_ = flag;
-        updateInternalState();
     }
 
     /**
      * Sets the Hiragana Quaternary mode to the initial mode set during construction of the RuleBasedCollator. See
      * setHiraganaQuaternary(boolean) for more details.
+     *
+     * This attribute is an implementation detail of the CLDR Japanese tailoring.
+     * The implementation might change to use a different mechanism
+     * to achieve the same Japanese sort order.
+     * Since ICU 50, this attribute is not settable any more via API functions.
      * 
      * @see #setHiraganaQuaternary(boolean)
      * @see #isHiraganaQuaternary
-     * @stable ICU 2.8
+     * @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
      */
     public void setHiraganaQuaternaryDefault() {
         if (isFrozen()) {
             throw new UnsupportedOperationException("Attempt to modify frozen object");
         }
-
-        m_isHiragana4_ = m_defaultIsHiragana4_;
-        updateInternalState();
     }
 
     /**
@@ -1187,11 +1191,16 @@ public final class RuleBasedCollator extends Collator {
 
     /**
      * Checks if the Hiragana Quaternary mode is set on. See setHiraganaQuaternary(boolean) for more details.
+     *
+     * This attribute is an implementation detail of the CLDR Japanese tailoring.
+     * The implementation might change to use a different mechanism
+     * to achieve the same Japanese sort order.
+     * Since ICU 50, this attribute is not settable any more via API functions.
      * 
      * @return flag true if Hiragana Quaternary mode is on, false otherwise
      * @see #setHiraganaQuaternaryDefault
      * @see #setHiraganaQuaternary(boolean)
-     * @stable ICU 2.8
+     * @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
      */
     public boolean isHiraganaQuaternary() {
         return m_isHiragana4_;
index 6b6cb63e7ad0fbd91369ce920e630fbd9915df8d..75c37ae3dae17ba5fd2a76bf4d50464a237aa686 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *******************************************************************************
- * Copyright (C) 2002-2011, International Business Machines Corporation and         *
- * others. All Rights Reserved.                                                *
+ * Copyright (C) 2002-2012, International Business Machines Corporation and
+ * others. All Rights Reserved.
  *******************************************************************************
  */
 
@@ -830,8 +830,8 @@ public class CollationAPITest extends TestFmwk {
             errln("Setting french collation failed");
         }
         collator.setHiraganaQuaternary(!hquart);
-        if (collator.isHiraganaQuaternary() == hquart) {
-            errln("Setting hiragana quartenary failed");
+        if (collator.isHiraganaQuaternary() != hquart) {
+            errln("Setting hiragana quartenary worked but should be a no-op since ICU 50");
         }
         collator.setLowerCaseFirst(!lowercase);
         if (collator.isLowerCaseFirst() == lowercase) {
index 797530568686b0917041c71a6832f6cf31ea6a35..76b373f2510589c72b5d52669cc9a907ab5bc343 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *******************************************************************************
- * Copyright (C) 2002-2010, International Business Machines Corporation and    *
- * others. All Rights Reserved.                                                *
+ * Copyright (C) 2002-2012, International Business Machines Corporation and
+ * others. All Rights Reserved.
  *******************************************************************************
  */
 
@@ -172,8 +172,7 @@ public class CollationKanaTest extends TestFmwk{
         int result;
         String string1 = new String(tmp1);
         String string2 = new String(tmp2);
-        RuleBasedCollator rb = (RuleBasedCollator)Collator.getInstance(ULocale.JAPAN);
-        rb.setHiraganaQuaternary(true);
+        RuleBasedCollator rb = (RuleBasedCollator)Collator.getInstance(ULocale.JAPANESE);
         rb.setStrength(Collator.QUATERNARY);
         rb.setAlternateHandlingShifted(false);