You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/10/13 14:28:02 UTC
svn commit: r824720 -
/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java
Author: tellison
Date: Tue Oct 13 12:28:02 2009
New Revision: 824720
URL: http://svn.apache.org/viewvc?rev=824720&view=rev
Log:
Simplify static initializer.
Modified:
harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java
Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java?rev=824720&r1=824719&r2=824720&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java (original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Collator.java Tue Oct 13 12:28:02 2009
@@ -157,21 +157,13 @@
static {
// CACHE_SIZE includes key and value, so needs to be double
- String cacheSize = AccessController
- .doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty("collator.cache"); //$NON-NLS-1$
+ Integer value = AccessController
+ .doPrivileged(new PrivilegedAction<Integer>() {
+ public Integer run() {
+ return Integer.getInteger("collator.cache"); //$NON-NLS-1$
}
});
- if (cacheSize != null) {
- try {
- CACHE_SIZE = Integer.parseInt(cacheSize);
- } catch (NumberFormatException e) {
- CACHE_SIZE = 6;
- }
- } else {
- CACHE_SIZE = 6;
- }
+ CACHE_SIZE = value == null ? 6 : value.intValue();
}
private static Vector<Collator> cache = new Vector<Collator>(CACHE_SIZE);