commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1158279 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java
Date Tue, 16 Aug 2011 14:06:46 GMT
Author: ggregory
Date: Tue Aug 16 14:06:45 2011
New Revision: 1158279

URL: http://svn.apache.org/viewvc?rev=1158279&view=rev
Log:
[LANG-736] CharUtils static final array CHAR_STRING is not needed to compute CHAR_STRING_ARRAY.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java?rev=1158279&r1=1158278&r2=1158279&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java Tue Aug
16 14:06:45 2011
@@ -29,24 +29,6 @@ package org.apache.commons.lang3;
  */
 public class CharUtils {
     
-    private static final String CHAR_STRING = 
-        "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007" +
-        "\b\t\n\u000b\f\r\u000e\u000f" +
-        "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017" +
-        "\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f" +
-        "\u0020\u0021\"\u0023\u0024\u0025\u0026\u0027" +
-        "\u0028\u0029\u002a\u002b\u002c\u002d\u002e\u002f" +
-        "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037" +
-        "\u0038\u0039\u003a\u003b\u003c\u003d\u003e\u003f" +
-        "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047" +
-        "\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f" +
-        "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057" +
-        "\u0058\u0059\u005a\u005b\\\u005d\u005e\u005f" +
-        "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067" +
-        "\u0068\u0069\u006a\u006b\u006c\u006d\u006e\u006f" +
-        "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077" +
-        "\u0078\u0079\u007a\u007b\u007c\u007d\u007e\u007f";
-    
     private static final String[] CHAR_STRING_ARRAY = new String[128];
     
     /**
@@ -69,8 +51,8 @@ public class CharUtils {
     
 
     static {
-        for (int i = 127; i >= 0; i--) {
-            CHAR_STRING_ARRAY[i] = CHAR_STRING.substring(i, i + 1);
+        for (char c = 0; c < CHAR_STRING_ARRAY.length; c++) {
+            CHAR_STRING_ARRAY[c] = String.valueOf(c);
         }
     }
 



Mime
View raw message