Skip to content

Commits on Source 2

......@@ -14,3 +14,4 @@ samples/out
tools/build/out
tools/misc/out
*.jar
!main/shared/data/*.jar
This diff is collapsed.
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2009-2016, International Business Machines Corporation and *
#* others. All Rights Reserved. *
#*******************************************************************************
api.report.version = 60
api.report.prev.version = 59
release.file.ver = 60_2
api.doc.version = 60.2
maven.pom.ver = 60.2
api.report.version = 62
api.report.prev.version = 61
release.file.ver = 62_1
api.doc.version = 62.1
maven.pom.ver = 62.1
......@@ -102,10 +102,25 @@
<matches string="${java.version}" pattern="9((-.|\.\d).*)?"/>
</condition>
<condition property="is.java10">
<matches string="${java.version}" pattern="10((-.|\.\d).*)?"/>
</condition>
<condition property="is.java11">
<matches string="${java.version}" pattern="11((-.|\.\d).*)?"/>
</condition>
<condition property="is.java12">
<matches string="${java.version}" pattern="12((-.|\.\d).*)?"/>
</condition>
<condition property="is.java8.plus">
<or>
<isset property="is.java8"/>
<isset property="is.java9"/>
<isset property="is.java10"/>
<isset property="is.java11"/>
<isset property="is.java12"/>
</or>
</condition>
......@@ -1735,7 +1750,7 @@
</java>
</target>
<target name="draftAPIs" depends="info, gatherapi" description="Run API collector tool and generate draft API report">
<target name="draftAPIs" depends="info, gatherapi" description="Run API collector tool and generate draft API report in html">
<java classname="com.ibm.icu.dev.tool.docs.CollectAPI"
classpath="${icu4j.build-tools.jar}"
failonerror="true">
......@@ -1747,6 +1762,19 @@
</java>
</target>
<target name="draftAPIsTSV" depends="info, gatherapi" description="Run API collector tool and generate draft API report in TSV">
<java classname="com.ibm.icu.dev.tool.docs.CollectAPI"
classpath="${icu4j.build-tools.jar}"
failonerror="true">
<arg value="-f"/>
<arg value="Draft"/>
<arg value="-o"/>
<arg value="${out.dir}/draftAPIs.tsv"/>
<arg value="-t"/>
<arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
</java>
</target>
<target name="swatDeprecated" depends="build-tools" description="Convert @deprecated @draft tags to @provisional">
<antcall target="_runSwatDeprecated">
<param name="swat.deprecated.opt" value="-dep"/>
......
# © 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2009, International Business Machines Corporation and *
#* others. All Rights Reserved. *
......
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2010-2016, International Business Machines Corporation and *
#* others. All Rights Reserved. *
#*******************************************************************************
icu4j.plugin.impl.version.string=60.2.0
icu4j.plugin.impl.version.string=62.1.0
copyright.eclipse=(C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html#License
icu4j.data.version.number=60
icu4j.data.version.number=62
#*
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2008-2011, International Business Machines Corporation and *
#* others. All Rights Reserved. *
......
......@@ -9,7 +9,7 @@
<body lang="EN-US">
<h2>About This Content</h2>
<p>September 28, 2017</p>
<p>May 25, 2018</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
......@@ -32,7 +32,7 @@ did not receive this Content directly from the Eclipse Foundation, the following
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><strong>ICU4J 60.1.0 plug-in</strong></p>
<p><strong>ICU4J 62.1.0 plug-in</strong></p>
<p>The plug-in includes software (&quot;ICU4J&quot;) developed by Unicode Inc. and others.
Your use of ICU4J is subject to the terms and conditions of the ICU license. A copy of the
......
......@@ -9,7 +9,7 @@
<body lang="EN-US">
<h2>About This Content</h2>
<p>September 28, 2017</p>
<p>May 25, 2018</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
......@@ -32,7 +32,7 @@ did not receive this Content directly from the Eclipse Foundation, the following
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><strong>ICU4J 60.1.0 base plug-in</strong></p>
<p><strong>ICU4J 62.1.0 base plug-in</strong></p>
<p>The plug-in includes software (&quot;ICU4J&quot;) developed by Unicode Inc. and others.
Your use of ICU4J is subject to the terms and conditions of the ICU license. A copy of the
......
###############################################################################
# © 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (c) 2003-2015 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
......
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2009-2012, International Business Machines Corporation and *
#* others. All Rights Reserved. *
......
......@@ -89,13 +89,14 @@ public class CharsetCallback {
* To avoid dependency on other code, this list is hard coded here.
* When an ignorable code point is found and is unmappable, the default callbacks
* will ignore them.
* For a list of the default ignorable code points, use this link: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3ADI%3A]&g=
*
* This list should be sync with the one in ucnv_err.c
* For a list of the default ignorable code points, use this link:
* https://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3ADI%3A%5D&abb=on&g=&i=
*
* This list should be sync with the one in ucnv_err.cpp.
*/
private static boolean IS_DEFAULT_IGNORABLE_CODE_POINT(int c) {
return ((c == 0x00AD) ||
return
(c == 0x00AD) ||
(c == 0x034F) ||
(c == 0x061C) ||
(c == 0x115F) ||
......@@ -104,26 +105,15 @@ public class CharsetCallback {
(0x180B <= c && c <= 0x180E) ||
(0x200B <= c && c <= 0x200F) ||
(0x202A <= c && c <= 0x202E) ||
(c == 0x2060) ||
(0x2066 <= c && c <= 0x2069) ||
(0x2061 <= c && c <= 0x2064) ||
(0x206A <= c && c <= 0x206F) ||
(0x2060 <= c && c <= 0x206F) ||
(c == 0x3164) ||
(0x0FE00 <= c && c <= 0x0FE0F) ||
(c == 0x0FEFF) ||
(c == 0x0FFA0) ||
(0x01BCA0 <= c && c <= 0x01BCA3) ||
(0x01D173 <= c && c <= 0x01D17A) ||
(c == 0x0E0001) ||
(0x0E0020 <= c && c <= 0x0E007F) ||
(0x0E0100 <= c && c <= 0x0E01EF) ||
(c == 0x2065) ||
(0x0FFF0 <= c && c <= 0x0FFF8) ||
(c == 0x0E0000) ||
(0x0E0002 <= c && c <= 0x0E001F) ||
(0x0E0080 <= c && c <= 0x0E00FF) ||
(0x0E01F0 <= c && c <= 0x0E0FFF)
);
(0xFE00 <= c && c <= 0xFE0F) ||
(c == 0xFEFF) ||
(c == 0xFFA0) ||
(0xFFF0 <= c && c <= 0xFFF8) ||
(0x1BCA0 <= c && c <= 0x1BCA3) ||
(0x1D173 <= c && c <= 0x1D17A) ||
(0xE0000 <= c && c <= 0xE0FFF);
}
/**
* Decoder Callback interface
......
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2009-2012, International Business Machines Corporation and *
#* others. All Rights Reserved. *
......
......@@ -123,27 +123,27 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,1,1,2,3,0,0,0,0,
0,0,0,0,4,0,0,0,0,0,0,0,5,6,7,0,
8,0,9,0xa,0,0,0xb,0xc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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x42,0x43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x44,0x45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
......@@ -244,7 +244,7 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x44,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x19,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
......@@ -254,27 +254,27 @@ public final class CollationFCD {
0xb,0xc,0,0,0,0,0,0,1,1,0xd,0xe,0xf,0x10,0x11,0,
0x12,0x13,0x14,0x15,0x16,0,0x17,0x18,0,0,0,0,0x19,0x1a,0x1b,0,
0x1c,0x1d,0x1e,0x1f,0,0,0x20,0x21,0x22,0x23,0x24,0,0,0,0,0x25,
0x26,0x27,0x28,0,0,0,0x29,0x2a,0,0x2b,0x2c,0,0,0x2d,0x2e,0,
0,0x2f,0x30,0,0,0x2d,0x31,0,0,0x2d,0x32,0,0,0,0x31,0,
0,0,0x33,0,0,0x2d,0x31,0,0,0x34,0x31,0,0,0,0x35,0,
0,0x36,0x37,0,0,0x38,0x37,0,0x38,0x39,0,0x3a,0x3b,0,0x3c,0,
0,0x3d,0,0,0x31,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x3e,0,0,0,0,0,
0x26,0x27,0x28,0,0,0,0x29,0x2a,0,0x2b,0x2c,0,0,0x2d,0x2e,0x2f,
0,0x30,0x31,0,0,0x2d,0x32,0,0,0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,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
......@@ -375,27 +375,27 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x3e,0x74,0x75,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x3f,0x76,0x77,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0xe,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
private static final int[] lcccBits={
0,0xffffffff,0xffff7fff,0xffff,0xf8,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0xfffff800,0x10000,0x9fc00000,0x3d9f,0x20000,0xffff0000,0x7ff,
0xff800,0xfbc00000,0x3eef,0xe000000,0xfff00000,0xfffffffb,0x10000000,0x1e2000,0x2000,0x602000,0x18000000,0x400,0x7000000,0xf00,0x3000000,0x2a00000,
0x3c3e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,
0x31021fd,0xfbffffff,0x1fff0000,0x1ffe2,0x38000,0x80000000,0xfc00,0x6000000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,
2,0x400000,0x40000f5,0x5108000,0x40000000
0x200ff800,0xfbc00000,0x3eef,0xe000000,0xfff80000,0xfffffffb,0x10000000,0x1e2000,0x2000,0x40000000,0x602000,0x18000000,0x400,0x7000000,0xf00,0x3000000,
0x2a00000,0x3c3e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xff800,0xc00,0xc0040,
0x800000,0xfff70000,0x31021fd,0xfbffffff,0x1fff0000,0x1ffe2,0x38000,0x80000000,0xfc00,0x6000000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,
1,0xc19d0000,2,0x400000,0x40000fd,0x5108000
};
private static final int[] tcccBits={
0,0xffffffff,0x3e7effbf,0xbe7effbf,0xfffcffff,0x7ef1ff3f,0xfff3f1f8,0x7fffff3f,0x18003,0xdfffe000,0xff31ffcf,0xcfffffff,0xfffc0,0xffff7fff,0xffff,0x1d760,
0x1fc00,0x187c00,0x200708b,0x2000000,0x708b0000,0xc00000,0xf8,0xfccf0006,0x33ffcfc,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0x7c,0xfffff800,0x10000,
0x9fc80005,0x3d9f,0x20000,0xffff0000,0x7ff,0xff800,0xfbc00000,0x3eef,0xe000000,0xfff00000,0xfffffffb,0x10120200,0xff1e2000,0x10000000,0xb0002000,0x10480000,
0x4e002000,0x2000,0x30002000,0x602100,0x18000000,0x24000400,0x7000000,0xf00,0x3000000,0x2a00000,0x3d7e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,
0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xfbffffff,0xbffffff,0x3ffffff,0x3f3fffff,0xaaff3f3f,
0x3fffffff,0x1fdfffff,0xefcfffde,0x1fdc7fff,0x1fff0000,0x1ffe2,0x800,0xc000000,0x4000,0xe000,0x1210,0x50,0x292,0x333e005,0x333,0xf000,
0x3c0f,0x38000,0x80000000,0xfc00,0x55555000,0x36db02a5,0x46100000,0x47900000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,
2,0x400000,0x40000f5,0x5108000,0x5f7ffc00,0x7fdb
0x9fc80005,0x3d9f,0x20000,0xffff0000,0x7ff,0x200ff800,0xfbc00000,0x3eef,0xe000000,0xfff80000,0xfffffffb,0x10120200,0xff1e2000,0x10000000,0xb0002000,0x40000000,
0x10480000,0x4e002000,0x2000,0x30002000,0x602100,0x18000000,0x24000400,0x7000000,0xf00,0x3000000,0x2a00000,0x3d7e0000,0xdf,0x40,0x6800000,0xe0000000,
0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xff800,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xfbffffff,0xbffffff,0x3ffffff,
0x3f3fffff,0xaaff3f3f,0x3fffffff,0x1fdfffff,0xefcfffde,0x1fdc7fff,0x1fff0000,0x1ffe2,0x800,0xc000000,0x4000,0xe000,0x1210,0x50,0x292,0x333e005,
0x333,0xf000,0x3c0f,0x38000,0x80000000,0xfc00,0x55555000,0x36db02a5,0x46100000,0x47900000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,
1,0xc19d0000,2,0x400000,0x40000fd,0x5108000,0x5f7ffc00,0x7fdb
};
}
......@@ -523,7 +523,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
*/
private void addIndexExemplars(ULocale locale) {
UnicodeSet exemplars = LocaleData.getExemplarSet(locale, 0, LocaleData.ES_INDEX);
if (exemplars != null) {
if (exemplars != null && !exemplars.isEmpty()) {
initialLabels.addAll(exemplars);
return;
}
......@@ -534,7 +534,7 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
exemplars = exemplars.cloneAsThawed();
// question: should we add auxiliary exemplars?
if (exemplars.containsSome('a', 'z') || exemplars.size() == 0) {
if (exemplars.containsSome('a', 'z') || exemplars.isEmpty()) {
exemplars.addAll('a', 'z');
}
if (exemplars.containsSome(0xAC00, 0xD7A3)) { // Hangul syllables
......@@ -549,13 +549,9 @@ public final class AlphabeticIndex<V> implements Iterable<Bucket<V>> {
// cut down to small list
// make use of the fact that Ethiopic is allocated in 8's, where
// the base is 0 mod 8.
UnicodeSet ethiopic = new UnicodeSet("[[:Block=Ethiopic:]&[:Script=Ethiopic:]]");
UnicodeSetIterator it = new UnicodeSetIterator(ethiopic);
while (it.next() && it.codepoint != UnicodeSetIterator.IS_STRING) {
if ((it.codepoint & 0x7) != 0) {
exemplars.remove(it.codepoint);
}
}
UnicodeSet ethiopic = new UnicodeSet("[ሀለሐመሠረሰሸቀቈቐቘበቨተቸኀኈነኘአከኰኸዀወዐዘዠየደዸጀገጐጘጠጨጰጸፀፈፐፘ]");
ethiopic.retainAll(exemplars);
exemplars.remove('ሀ', 0x137F).addAll(ethiopic);
}
// Upper-case any that aren't already so.
......
#* © 2016 and later: Unicode, Inc. and others.
#* License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#*******************************************************************************
#* Copyright (C) 2009-2015, International Business Machines Corporation and *
#* others. All Rights Reserved. *
......
......@@ -30,6 +30,21 @@ public final class CaseMapImpl {
dir=0;
}
/**
* Constructor.
* @param src String to iterate over.
* @param cpStart Start index of the current code point.
* @param cpLimit Limit index of the current code point.
*/
public StringContextIterator(CharSequence src, int cpStart, int cpLimit) {
s = src;
index = 0;
limit = src.length();
this.cpStart = cpStart;
this.cpLimit = cpLimit;
dir = 0;
}
/**
* Set the iteration limit for nextCaseMapCP() to an index within the string.
* If the limit parameter is negative or past the string, then the
......@@ -77,6 +92,11 @@ public final class CaseMapImpl {
}
}
public void setCPStartAndLimit(int s, int l) {
cpStart = s;
cpLimit = l;
dir = 0;
}
/**
* Returns the start of the code point that was last returned
* by nextCaseMapCP().
......@@ -400,14 +420,163 @@ public final class CaseMapImpl {
return result.toString();
}
private static void internalToLower(int caseLocale, int options, StringContextIterator iter,
private static final Trie2_16 CASE_TRIE = UCaseProps.getTrie();
/**
* caseLocale >= 0: Lowercases [srcStart..srcLimit[ but takes context [0..srcLength[ into account.
* caseLocale < 0: Case-folds [srcStart..srcLimit[.
*/
private static void internalToLower(int caseLocale, int options,
CharSequence src, int srcStart, int srcLimit, StringContextIterator iter,
Appendable dest, Edits edits) throws IOException {
byte[] latinToLower;
if (caseLocale == UCaseProps.LOC_ROOT ||
(caseLocale >= 0 ?
!(caseLocale == UCaseProps.LOC_TURKISH || caseLocale == UCaseProps.LOC_LITHUANIAN) :
(options & UCaseProps.FOLD_CASE_OPTIONS_MASK) == UCharacter.FOLD_CASE_DEFAULT)) {
latinToLower = UCaseProps.LatinCase.TO_LOWER_NORMAL;
} else {
latinToLower = UCaseProps.LatinCase.TO_LOWER_TR_LT;
}
int prev = srcStart;
int srcIndex = srcStart;
outerLoop:
for (;;) {
// fast path for simple cases
char lead;
for (;;) {
if (srcIndex >= srcLimit) {
break outerLoop;
}
lead = src.charAt(srcIndex);
int delta;
if (lead < UCaseProps.LatinCase.LONG_S) {
byte d = latinToLower[lead];
if (d == UCaseProps.LatinCase.EXC) { break; }
++srcIndex;
if (d == 0) { continue; }
delta = d;
} else if (lead >= 0xd800) {
break; // surrogate or higher
} else {
int props = CASE_TRIE.getFromU16SingleLead(lead);
if (UCaseProps.propsHasException(props)) { break; }
++srcIndex;
if (!UCaseProps.isUpperOrTitleFromProps(props) ||
(delta = UCaseProps.getDelta(props)) == 0) {
continue;
}
}
lead += delta;
appendUnchanged(src, prev, srcIndex - 1 - prev, dest, options, edits);
dest.append(lead);
if (edits != null) {
edits.addReplace(1, 1);
}
prev = srcIndex;
}
// slow path
int cpStart = srcIndex++;
char trail;
int c;
while ((c = iter.nextCaseMapCP()) >= 0) {
if (Character.isHighSurrogate(lead) && srcIndex < srcLimit &&
Character.isLowSurrogate(trail = src.charAt(srcIndex))) {
c = Character.toCodePoint(lead, trail);
++srcIndex;
} else {
c = lead;
}
if (caseLocale >= 0) {
if (iter == null) {
iter = new StringContextIterator(src, cpStart, srcIndex);
} else {
iter.setCPStartAndLimit(cpStart, srcIndex);
}
c = UCaseProps.INSTANCE.toFullLower(c, iter, dest, caseLocale);
appendResult(c, dest, iter.getCPLength(), options, edits);
} else {
c = UCaseProps.INSTANCE.toFullFolding(c, dest, options);
}
if (c >= 0) {
appendUnchanged(src, prev, cpStart - prev, dest, options, edits);
appendResult(c, dest, srcIndex - cpStart, options, edits);
prev = srcIndex;
}
}
appendUnchanged(src, prev, srcIndex - prev, dest, options, edits);
}
private static void internalToUpper(int caseLocale, int options,
CharSequence src, Appendable dest, Edits edits) throws IOException {
StringContextIterator iter = null;
byte[] latinToUpper;
if (caseLocale == UCaseProps.LOC_TURKISH) {
latinToUpper = UCaseProps.LatinCase.TO_UPPER_TR;
} else {
latinToUpper = UCaseProps.LatinCase.TO_UPPER_NORMAL;
}
int prev = 0;
int srcIndex = 0;
int srcLength = src.length();
outerLoop:
for (;;) {
// fast path for simple cases
char lead;
for (;;) {
if (srcIndex >= srcLength) {
break outerLoop;
}
lead = src.charAt(srcIndex);
int delta;
if (lead < UCaseProps.LatinCase.LONG_S) {
byte d = latinToUpper[lead];
if (d == UCaseProps.LatinCase.EXC) { break; }
++srcIndex;
if (d == 0) { continue; }
delta = d;
} else if (lead >= 0xd800) {
break; // surrogate or higher
} else {
int props = CASE_TRIE.getFromU16SingleLead(lead);
if (UCaseProps.propsHasException(props)) { break; }
++srcIndex;
if (UCaseProps.getTypeFromProps(props) != UCaseProps.LOWER ||
(delta = UCaseProps.getDelta(props)) == 0) {
continue;
}
}
lead += delta;
appendUnchanged(src, prev, srcIndex - 1 - prev, dest, options, edits);
dest.append(lead);
if (edits != null) {
edits.addReplace(1, 1);
}
prev = srcIndex;
}
// slow path
int cpStart = srcIndex++;
char trail;
int c;
if (Character.isHighSurrogate(lead) && srcIndex < srcLength &&
Character.isLowSurrogate(trail = src.charAt(srcIndex))) {
c = Character.toCodePoint(lead, trail);
++srcIndex;
} else {
c = lead;
}
if (iter == null) {
iter = new StringContextIterator(src, cpStart, srcIndex);
} else {
iter.setCPStartAndLimit(cpStart, srcIndex);
}
c = UCaseProps.INSTANCE.toFullUpper(c, iter, dest, caseLocale);
if (c >= 0) {
appendUnchanged(src, prev, cpStart - prev, dest, options, edits);
appendResult(c, dest, srcIndex - cpStart, options, edits);
prev = srcIndex;
}
}
appendUnchanged(src, prev, srcIndex - prev, dest, options, edits);
}
public static String toLower(int caseLocale, int options, CharSequence src) {
if (src.length() <= 100 && (options & OMIT_UNCHANGED_TEXT) == 0) {
......@@ -432,8 +601,7 @@ public final class CaseMapImpl {
if (edits != null) {
edits.reset();
}
StringContextIterator iter = new StringContextIterator(src);
internalToLower(caseLocale, options, iter, dest, edits);
internalToLower(caseLocale, options, src, 0, src.length(), null, dest, edits);
return dest;
} catch (IOException e) {
throw new ICUUncheckedIOException(e);
......@@ -466,12 +634,7 @@ public final class CaseMapImpl {
if (caseLocale == UCaseProps.LOC_GREEK) {
return GreekUpper.toUpper(options, src, dest, edits);
}
StringContextIterator iter = new StringContextIterator(src);
int c;
while ((c = iter.nextCaseMapCP()) >= 0) {
c = UCaseProps.INSTANCE.toFullUpper(c, iter, dest, caseLocale);
appendResult(c, dest, iter.getCPLength(), options, edits);
}
internalToUpper(caseLocale, options, src, dest, edits);
return dest;
} catch (IOException e) {
throw new ICUUncheckedIOException(e);
......@@ -589,12 +752,13 @@ public final class CaseMapImpl {
if(titleLimit<index) {
if((options&UCharacter.TITLECASE_NO_LOWERCASE)==0) {
// Normal operation: Lowercase the rest of the word.
internalToLower(caseLocale, options, iter, dest, edits);
internalToLower(caseLocale, options,
src, titleLimit, index, iter, dest, edits);
} else {
// Optionally just copy the rest of the word unchanged.
appendUnchanged(src, titleLimit, index-titleLimit, dest, options, edits);
iter.moveToLimit();
}
iter.moveToLimit();
}
}
}
......@@ -629,14 +793,7 @@ public final class CaseMapImpl {
if (edits != null) {
edits.reset();
}
int length = src.length();
for (int i = 0; i < length;) {
int c = Character.codePointAt(src, i);
int cpLength = Character.charCount(c);
i += cpLength;
c = UCaseProps.INSTANCE.toFullFolding(c, dest, options);
appendResult(c, dest, cpLength, options, edits);
}
internalToLower(-1, options, src, 0, src.length(), null, dest, edits);
return dest;
} catch (IOException e) {
throw new ICUUncheckedIOException(e);
......
// © 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
package com.ibm.icu.impl;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
/**
* A wrapper around java.util.Collection that implements java.util.Set. This class keeps a pointer to the
* Collection and does not persist any data on its own.
*
* Useful when you need a Set but creating a HashSet is too expensive.
*
* IMPORTANT: The elements of the Collection *must* be unique! This class does not check.
*/
public class CollectionSet<E> implements Set<E> {
private final Collection<E> data;
public CollectionSet(Collection<E> data) {
this.data = data;
}
@Override
public int size() {
return data.size();
}
@Override
public boolean isEmpty() {
return data.isEmpty();
}
@Override
public boolean contains(Object o) {
return data.contains(o);
}
@Override
public Iterator<E> iterator() {
return data.iterator();
}
@Override
public Object[] toArray() {
return data.toArray();
}
@Override
public <T> T[] toArray(T[] a) {
return data.toArray(a);
}
@Override
public boolean add(E e) {
return data.add(e);
}
@Override
public boolean remove(Object o) {
return data.remove(o);
}
@Override
public boolean containsAll(Collection<?> c) {
return data.containsAll(c);
}
@Override
public boolean addAll(Collection<? extends E> c) {
return data.addAll(c);
}
@Override
public boolean retainAll(Collection<?> c) {
return data.retainAll(c);
}
@Override
public boolean removeAll(Collection<?> c) {
return data.removeAll(c);
}
@Override
public void clear() {
data.clear();
}
}
......@@ -29,7 +29,6 @@ public class CurrencyData {
public abstract Map<String, String> getUnitPatterns();
public abstract CurrencyFormatInfo getFormatInfo(String isoCode);
public abstract CurrencySpacingInfo getSpacingInfo();
public abstract String getNarrowSymbol(String isoCode);
}
public static final class CurrencyFormatInfo {
......
......@@ -91,8 +91,7 @@ public class LocaleDisplayNamesImpl extends LocaleDisplayNames {
CaseMap.toTitle().wholeString().noLowercase();
private static String toTitleWholeStringNoLowercase(ULocale locale, String s) {
return TO_TITLE_WHOLE_STRING_NO_LOWERCASE.apply(
locale.toLocale(), null, s, new StringBuilder(), null).toString();
return TO_TITLE_WHOLE_STRING_NO_LOWERCASE.apply(locale.toLocale(), null, s);
}
public static LocaleDisplayNames getInstance(ULocale locale, DialectHandling dialectHandling) {
......