]> granicus.if.org Git - icu/commitdiff
ICU-12410 switch CaseMap from ULocale to Locale (only)
authorMarkus Scherer <markus.icu@gmail.com>
Thu, 2 Feb 2017 19:38:50 +0000 (19:38 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Thu, 2 Feb 2017 19:38:50 +0000 (19:38 +0000)
X-SVN-Rev: 39634

icu4j/main/classes/core/src/com/ibm/icu/lang/UCharacter.java
icu4j/main/classes/core/src/com/ibm/icu/text/CaseMap.java

index c2385f84ff82682e812352d737d6b78381e50544..0029df2c080c55ed91a9e2c55e9ce46692c16710 100644 (file)
@@ -4949,18 +4949,6 @@ public final class UCharacter implements ECharacterCategory, ECharacterDirection
      */
     public static String toLowerCase(Locale locale, String str)
     {
-        return toLowerCase(ULocale.forLocale(locale), str);
-    }
-
-    /**
-     * Returns the lowercase version of the argument string.
-     * Casing is dependent on the argument locale and context-sensitive
-     * @param locale which string is to be converted in
-     * @param str source string to be performed on
-     * @return lowercase version of the argument string
-     * @stable ICU 3.2
-     */
-    public static String toLowerCase(ULocale locale, String str) {
         // TODO: remove package path
         if (str.length() <= 100) {
             if (str.isEmpty()) {
@@ -4979,6 +4967,18 @@ public final class UCharacter implements ECharacterCategory, ECharacterDirection
         }
     }
 
+    /**
+     * Returns the lowercase version of the argument string.
+     * Casing is dependent on the argument locale and context-sensitive
+     * @param locale which string is to be converted in
+     * @param str source string to be performed on
+     * @return lowercase version of the argument string
+     * @stable ICU 3.2
+     */
+    public static String toLowerCase(ULocale locale, String str) {
+        return toLowerCase(locale.toLocale(), str);
+    }
+
     private static String applyEdits(String str, StringBuilder replacementChars, Edits edits) {
         if (!edits.hasChanges()) {
             return str;
index 6eb64d62ff6975299cc817f4dd5c964907fab5b0..6d2c6dd2ca51bf361ae02c97908a24a5d1bc4745 100644 (file)
@@ -2,12 +2,12 @@
 // License & terms of use: http://www.unicode.org/copyright.html#License
 package com.ibm.icu.text;
 
+import java.util.Locale;
+
 import com.ibm.icu.impl.UCaseProps;
 import com.ibm.icu.lang.UCharacter;
-import com.ibm.icu.util.ULocale;
 
 // TODO: issues/questions
-// - add java.util.Locale overloads when signatures are settled
 // - optimizing strategies for unstyled text: stop after number of changes or length of replacement?
 
 /**
@@ -39,14 +39,14 @@ public final class CaseMap {
      *                  This function calls edits.reset() first. edits can be null.
      * @return dest with the result string (or only changes) appended.
      *
-     * @see UCharacter#toLowerCase(ULocale, String)
+     * @see UCharacter#toLowerCase(Locale, String)
      * @draft ICU 59
      * @provisional This API might change or be removed in a future release.
      */
      public static <A extends Appendable> A toLower(
-             ULocale locale, int options, CharSequence src, A dest, Edits edits) {
+             Locale locale, int options, CharSequence src, A dest, Edits edits) {
          if (locale == null) {
-             locale = ULocale.getDefault();
+             locale = Locale.getDefault();
          }
          int caseLocale = UCaseProps.getCaseLocale(locale);
          // TODO: remove package path
@@ -67,12 +67,12 @@ public final class CaseMap {
      *                  This function calls edits.reset() first. edits can be null.
      * @return dest with the result string (or only changes) appended.
      *
-     * @see UCharacter#toUpperCase(ULocale, String)
+     * @see UCharacter#toUpperCase(Locale, String)
      * @draft ICU 59
      * @provisional This API might change or be removed in a future release.
      */
      public static <A extends Appendable> A toUpper(
-             ULocale locale, int options, CharSequence src, A dest, Edits edits) {
+             Locale locale, int options, CharSequence src, A dest, Edits edits) {
          return null;
      }
 
@@ -101,12 +101,12 @@ public final class CaseMap {
      *                  This function calls edits.reset() first. edits can be null.
      * @return dest with the result string (or only changes) appended.
      *
-     * @see UCharacter#toTitleCase(ULocale, String, BreakIterator, int)
+     * @see UCharacter#toTitleCase(Locale, String, BreakIterator, int)
      * @draft ICU 59
      * @provisional This API might change or be removed in a future release.
      */
      public static <A extends Appendable> A toTitle(
-             ULocale locale, int options, BreakIterator iter,
+             Locale locale, int options, BreakIterator iter,
              CharSequence src, A dest, Edits edits) {
          return null;
      }