mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-7434 switch BreakIterator.iterCache from SoftReference to CacheValue
X-SVN-Rev: 38737
This commit is contained in:
parent
c1633486ae
commit
fa28f03bf6
1 changed files with 3 additions and 3 deletions
|
@ -7,13 +7,13 @@
|
|||
|
||||
package com.ibm.icu.text;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
import com.ibm.icu.impl.ICUDebug;
|
||||
import com.ibm.icu.impl.CacheValue;
|
||||
import com.ibm.icu.util.ICUCloneNotSupportedException;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
||||
|
@ -556,7 +556,7 @@ public abstract class BreakIterator implements Cloneable
|
|||
*/
|
||||
private static final int KIND_COUNT = 5;
|
||||
|
||||
private static final SoftReference<?>[] iterCache = new SoftReference<?>[5];
|
||||
private static final CacheValue<?>[] iterCache = new CacheValue<?>[5];
|
||||
|
||||
/**
|
||||
* Returns a new instance of BreakIterator that locates word boundaries.
|
||||
|
@ -867,7 +867,7 @@ s */
|
|||
BreakIterator result = getShim().createBreakIterator(where, kind);
|
||||
|
||||
BreakIteratorCache cache = new BreakIteratorCache(where, result);
|
||||
iterCache[kind] = new SoftReference<BreakIteratorCache>(cache);
|
||||
iterCache[kind] = CacheValue.getInstance(cache);
|
||||
if (result instanceof RuleBasedBreakIterator) {
|
||||
RuleBasedBreakIterator rbbi = (RuleBasedBreakIterator)result;
|
||||
rbbi.setBreakType(kind);
|
||||
|
|
Loading…
Add table
Reference in a new issue