directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491032 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
Date Fri, 29 Dec 2006 15:48:56 GMT
Author: elecharny
Date: Fri Dec 29 07:48:56 2006
New Revision: 491032

URL: http://svn.apache.org/viewvc?view=rev&rev=491032
Log:
Fixed the bidi
Created a shortcut for prohibit() method, to speedup the execution
Created a chaining call for normalization

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java?view=diff&rev=491032&r1=491031&r2=491032
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
Fri Dec 29 07:48:56 2006
@@ -22,7 +22,6 @@
 
 import java.io.IOException;
 
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.unicode.InvalidCharacterException;
 // import org.apache.directory.shared.ldap.util.unicode.Normalizer;
 
@@ -68,6 +67,23 @@
         };
     
     /**
+     * The type of String we have to normalize
+     */
+    public enum StringType 
+    {
+        NOT_STRING,         
+        NUMERIC_STRING,
+        CASE_EXACT,
+        CASE_EXACT_IA5,
+        CASE_IGNORE_IA5,
+        CASE_IGNORE_LIST,
+        CASE_IGNORE,
+        DIRECTORY_STRING,
+        TELEPHONE_NUMBER,
+        WORD
+    }
+    
+    /**
      * Tells if a char is a combining mark.
      *
      * @param c The char to check
@@ -87,32 +103,51 @@
     }
     
     /**
-     * 
-     * We have to go through 6 steps :
-     * 
-     * 1) Transcode
-     * 2) Map
-     * 3) Normalize
-     * 4) Prohibit
-     * 5) Bidi
-     * 6) Insignifiant Character Handling
-     * 
-     * The first step is already done, the step (3) is not done.
-     *
-     * @param str
-     * @return
-     * @throws IOException
-     */
-    public static String normalize( String str ) throws IOException
-    {
-        String res = map( str );
-        prohibit( res );
-        res = bidi( res );
-        res = insignifiantSpacesString( res );
-        
-        return res;
-    }
-    
+    *
+    * We have to go through 6 steps :
+    *
+    * 1) Transcode
+    * 2) Map
+    * 3) Normalize
+    * 4) Prohibit
+    * 5) Bidi
+    * 6) Insignifiant Character Handling
+    *
+    * The first step is already done, the step (3) is not done.
+    *
+    * @param str
+    * @return
+    * @throws IOException
+    */
+   public static String normalize( String str, StringType type ) throws IOException
+   {
+       switch ( type )
+       {
+           case NUMERIC_STRING :
+               return insignifiantCharNumericString( bidi( prohibit( map( str ) ) ) );
+
+           case TELEPHONE_NUMBER :
+               return insignifiantCharTelephoneNumber( bidi( prohibit( map( str ) ) ) );
+
+           case CASE_EXACT :
+           case CASE_EXACT_IA5 :
+           case DIRECTORY_STRING :
+               return insignifiantSpacesString( bidi( prohibit( map( str ) ) ) );
+
+           case CASE_IGNORE_IA5 :
+           case CASE_IGNORE_LIST :
+           case CASE_IGNORE :
+               return str;
+               
+           case WORD :
+               return str;
+
+           default :  
+               return str;
+               
+       }
+   }
+   
     /**
      * Execute the mapping step of the string preparation :
      * - suppress useless chars
@@ -3941,38 +3976,17 @@
      * @param str The String to analyze
      * @throws InvalidCharacterException If any character is prohibited
      */
-    public static void prohibit( String str ) throws InvalidCharacterException
-    {
-        if ( !StringTools.isEmpty( str ) )
-        {
-            prohibit( str.toCharArray() );
-        }
-    }
-    
-    /**
-     * 
-     * Prohibit characters described in RFC 4518 :
-     *  - Table A.1 of RFC 3454
-     *  - Table C.3 of RFC 3454
-     *  - Table C.4 of RFC 3454
-     *  - Table C.5 of RFC 3454
-     *  - Table C.8 of RFC 3454
-     *  - character U-FFFD
-     *
-     * @param array The char array to analyze
-     * @throws InvalidCharacterException If any character is prohibited
-     */
-    public static void prohibit( char[] array ) throws InvalidCharacterException
+    public static String prohibit( String str ) throws InvalidCharacterException
     {
-        if ( array == null )
+        if ( str == null )
         {
-            return;
+            return null;
         }
 
-        for ( char c:array )
+        for ( char c:str.toCharArray() )
         {
-            // Shortcut ASCII chars
-            if ( c < 0x0221 )
+            // Shortcut chars above 0x0221
+            if ( c < 0x221 )
             {
                 continue;
             }
@@ -4538,1539 +4552,45 @@
                 throw new InvalidCharacterException( c );
             }
         }
+        
+        return  str;
     }
     
     /**
      * 
-     * Remove all bidirectionnal chars
+     * Remove all bidirectionnal chars. This is not really clear in RFC 4518
+     * what we should do with bidi chars :
+     * "Bidirectional characters are ignored."
+     * 
+     * But it's not explained what is a bidi chars...
+     * 
+     * So this method just do nothing atm.
      *
      * @param str The string where bidi chars are to be removed
      * @return The cleaned string
      */
     public static String bidi( String str )
     {
-        return ( str == null ? str : bidi( str.toCharArray() ).toString() );
+        return str;
     }
     
     /**
      * 
-     * Remove all bidirectionnal chars
+     * Remove all bidirectionnal chars. This is not really clear in RFC 4518
+     * what we should do with bidi chars :
+     * "Bidirectional characters are ignored."
+     * 
+     * But it's not explained what is a bidi chars...
+     * 
+     * So this method just do nothing atm.
      *
      * @param array The char array where bidi chars are to be removed
      * @return The cleaned StringBuilder
      */
     public static StringBuilder bidi( char[] array )
     {
-        if ( array == null )
-        {
-            return null;
-        }
-
-        StringBuilder sb = new StringBuilder( array.length );
-        
-        for ( char c:array )
-        {
-            // RFC 3454, Table D1
-            switch ( c )
-            {
-                case 0x05BE :
-                case 0x05C0 :
-                case 0x05C3 :
-                case 0x061B :
-                case 0x061F :
-                case 0x06DD :
-                case 0x0710 :
-                case 0x07B1 :
-                case 0x200F :
-                case 0xFB1D :
-                case 0xFB3E :
-                    continue;
-            }
-            
-            // RFC 3454, Table D1, intervals
-            if ( ( c >= 0x05D0 ) && ( c <= 0x05EA ) )
-            {
-                continue;
-            }
-            
-            if ( ( c >= 0x05F0 ) && ( c <= 0x05F4 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0621 ) && ( c <= 0x063A ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0640 ) && ( c <= 0x064A ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x066D ) && ( c <= 0x066F ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0671 ) && ( c <= 0x06D5 ) )
-            {
-                continue;
-            }
-            
-            if ( ( c >= 0x06E5 ) && ( c <= 0x06E6 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x06FA ) && ( c <= 0x06FE ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0700 ) && ( c <= 0x070D ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0712 ) && ( c <= 0x072C ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0780 ) && ( c <= 0x07A5 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB1F ) && ( c <= 0xFB28 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB2A ) && ( c <= 0xFB36 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB38 ) && ( c <= 0xFB3C ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB40 ) && ( c <= 0xFB41 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB43 ) && ( c <= 0xFB44 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB46 ) && ( c <= 0xFBB1 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFBD3 ) && ( c <= 0xFD3D ) )
-            {
-                continue;
-            }
-            
-            if ( ( c >= 0xFD50 ) && ( c <= 0xFD8F ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFD92 ) && ( c <= 0xFDC7 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFDF0 ) && ( c <= 0xFDFC ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFE70 ) && ( c <= 0xFE74 ) )
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFE76 ) && ( c <= 0xFEFC ) )
-            {
-                continue;
-            }
-            
-            // RFC 3454, Table D.2
-            switch ( c ) 
-            {
-                case 0x00AA :
-                case 0x00B5 :
-                case 0x00BA :
-                case 0x02EE :
-                case 0x037A :
-                case 0x0386 :
-                case 0x038C :
-                case 0x0589 :
-                case 0x0903 :
-                case 0x0950 :
-                case 0x09B2 :
-                case 0x09D7 :
-                case 0x0A5E :
-                case 0x0A83 :
-                case 0x0A8D :
-                case 0x0AC9 :
-                case 0x0AD0 :
-                case 0x0AE0 :
-                case 0x0B40 :
-                case 0x0B57 :
-                case 0x0B83 :
-                case 0x0B9C :
-                case 0x0BD7 :
-                case 0x0CBE :
-                case 0x0CDE :
-                case 0x0D57 :
-                case 0x0DBD :
-                case 0x0E84 :
-                case 0x0E8A :
-                case 0x0E8D :
-                case 0x0EA5 :
-                case 0x0EA7 :
-                case 0x0EBD :
-                case 0x0EC6 :
-                case 0x0F36 :
-                case 0x0F38 :
-                case 0x0F7F :
-                case 0x0F85 :
-                case 0x0FCF :
-                case 0x102C :
-                case 0x1031 :
-                case 0x1038 :
-                case 0x10FB :
-                case 0x1248 :
-                case 0x1258 :
-                case 0x1288 :
-                case 0x12B0 :
-                case 0x12C0 :
-                case 0x1310 :
-                case 0x17DC :
-                case 0x1F59 :
-                case 0x1F5B :
-                case 0x1F5D :
-                case 0x1FBE :
-                case 0x200E :
-                case 0x2071 :
-                case 0x207F :
-                case 0x2102 :
-                case 0x2107 :
-                case 0x2115 :
-                case 0x2124 :
-                case 0x2126 :
-                case 0x2128 :
-                    continue;
-            }
-            
-            // RFC 3454, Table D.2 intervals
-            if ( ( c >= 0x0041 ) && ( c <= 0x005A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0061 ) && ( c <= 0x007A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x00C0 ) && ( c <= 0x00D6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x00D8 ) && ( c <= 0x00F6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x00F8 ) && ( c <= 0x0220 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0222 ) && ( c <= 0x0233 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0250 ) && ( c <= 0x02AD ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x02B0 ) && ( c <= 0x02B8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x02BB ) && ( c <= 0x02C1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x02D0 ) && ( c <= 0x02D1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x02E0 ) && ( c <= 0x02E4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0388 ) && ( c <= 0x038A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x038E ) && ( c <= 0x03A1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x03A3 ) && ( c <= 0x03CE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x03D0 ) && ( c <= 0x03F5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0400 ) && ( c <= 0x0482 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x048A ) && ( c <= 0x04CE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x04D0 ) && ( c <= 0x04F5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x04F8 ) && ( c <= 0x04F9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0500 ) && ( c <= 0x050F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0531 ) && ( c <= 0x0556 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0559 ) && ( c <= 0x055F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0561 ) && ( c <= 0x0587 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0905 ) && ( c <= 0x0939 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x093D ) && ( c <= 0x0940 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0949 ) && ( c <= 0x094C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0958 ) && ( c <= 0x0961 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0964 ) && ( c <= 0x0970 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0982 ) && ( c <= 0x0983 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0985 ) && ( c <= 0x098C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x098F ) && ( c <= 0x0990 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0993 ) && ( c <= 0x09A8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09AA ) && ( c <= 0x09B0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09B6 ) && ( c <= 0x09B9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09BE ) && ( c <= 0x09C0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09C7 ) && ( c <= 0x09C8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09CB ) && ( c <= 0x09CC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09DC ) && ( c <= 0x09DD ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09DF ) && ( c <= 0x09E1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09E6 ) && ( c <= 0x09F1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x09F4 ) && ( c <= 0x09FA ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A05 ) && ( c <= 0x0A0A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A0F ) && ( c <= 0x0A10 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A13 ) && ( c <= 0x0A28 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A2A ) && ( c <= 0x0A30 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A32 ) && ( c <= 0x0A33 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A35 ) && ( c <= 0x0A36 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A38 ) && ( c <= 0x0A39 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A3E ) && ( c <= 0x0A40 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A59 ) && ( c <= 0x0A5C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A66 ) && ( c <= 0x0A6F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A72 ) && ( c <= 0x0A74 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A85 ) && ( c <= 0x0A8B ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A8F ) && ( c <= 0x0A91 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0A93 ) && ( c <= 0x0AA8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0AAA ) && ( c <= 0x0AB0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0AB2 ) && ( c <= 0x0AB3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0AB5 ) && ( c <= 0x0AB9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0ABD ) && ( c <= 0x0AC0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0ACB ) && ( c <= 0x0ACC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0AE6 ) && ( c <= 0x0AEF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B02 ) && ( c <= 0x0B03 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B05 ) && ( c <= 0x0B0C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B0F ) && ( c <= 0x0B10 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B13 ) && ( c <= 0x0B28 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B2A ) && ( c <= 0x0B30 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B32 ) && ( c <= 0x0B33 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B36 ) && ( c <= 0x0B39 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B3D ) && ( c <= 0x0B3E ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B47 ) && ( c <= 0x0B48 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B4B ) && ( c <= 0x0B4C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B5C ) && ( c <= 0x0B5D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B5F ) && ( c <= 0x0B61 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B66 ) && ( c <= 0x0B70 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B85 ) && ( c <= 0x0B8A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B8E ) && ( c <= 0x0B90 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B92 ) && ( c <= 0x0B95 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B99 ) && ( c <= 0x0B9A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0B9E ) && ( c <= 0x0B9F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BA3 ) && ( c <= 0x0BA4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BA8 ) && ( c <= 0x0BAA ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BAE ) && ( c <= 0x0BB5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BB7 ) && ( c <= 0x0BB9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BBE ) && ( c <= 0x0BBF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BC1 ) && ( c <= 0x0BC2 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BC6 ) && ( c <= 0x0BC8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BCA ) && ( c <= 0x0BCC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0BE7 ) && ( c <= 0x0BF2 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C01 ) && ( c <= 0x0C03 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C05 ) && ( c <= 0x0C0C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C0E ) && ( c <= 0x0C10 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C12 ) && ( c <= 0x0C28 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C2A ) && ( c <= 0x0C33 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C35 ) && ( c <= 0x0C39 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C41 ) && ( c <= 0x0C44 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C60 ) && ( c <= 0x0C61 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C66 ) && ( c <= 0x0C6F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C82 ) && ( c <= 0x0C83 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C85 ) && ( c <= 0x0C8C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C8E ) && ( c <= 0x0C90 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0C92 ) && ( c <= 0x0CA8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CAA ) && ( c <= 0x0CB3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CB5 ) && ( c <= 0x0CB9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CC0 ) && ( c <= 0x0CC4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CC7 ) && ( c <= 0x0CC8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CCA ) && ( c <= 0x0CCB ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CD5 ) && ( c <= 0x0CD6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CE0 ) && ( c <= 0x0CE1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0CE6 ) && ( c <= 0x0CEF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D02 ) && ( c <= 0x0D03 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D05 ) && ( c <= 0x0D0C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D0E ) && ( c <= 0x0D10 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D12 ) && ( c <= 0x0D28 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D2A ) && ( c <= 0x0D39 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D3E ) && ( c <= 0x0D40 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D46 ) && ( c <= 0x0D48 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D4A ) && ( c <= 0x0D4C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D60 ) && ( c <= 0x0D61 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D66 ) && ( c <= 0x0D6F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D82 ) && ( c <= 0x0D83 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D85 ) && ( c <= 0x0D96 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0D9A ) && ( c <= 0x0DB1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0DB3 ) && ( c <= 0x0DBB ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0DC0 ) && ( c <= 0x0DC6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0DCF ) && ( c <= 0x0DD1 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0DD8 ) && ( c <= 0x0DDF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0DF2 ) && ( c <= 0x0DF4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E01 ) && ( c <= 0x0E30 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E32 ) && ( c <= 0x0E33 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E40 ) && ( c <= 0x0E46 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E4F ) && ( c <= 0x0E5B ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E81 ) && ( c <= 0x0E82 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E87 ) && ( c <= 0x0E88 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E94 ) && ( c <= 0x0E97 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0E99 ) && ( c <= 0x0E9F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EA1 ) && ( c <= 0x0EA3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EAA ) && ( c <= 0x0EAB ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EAD ) && ( c <= 0x0EB0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EB2 ) && ( c <= 0x0EB3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EC0 ) && ( c <= 0x0EC4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0ED0 ) && ( c <= 0x0ED9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0EDC ) && ( c <= 0x0EDD ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0F00 ) && ( c <= 0x0F17 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0F1A ) && ( c <= 0x0F34 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0F3E ) && ( c <= 0x0F47 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0F49 ) && ( c <= 0x0F6A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0F88 ) && ( c <= 0x0F8B ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0FBE ) && ( c <= 0x0FC5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x0FC7 ) && ( c <= 0x0FCC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1000 ) && ( c <= 0x1021 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1023 ) && ( c <= 0x1027 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1029 ) && ( c <= 0x102A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1040 ) && ( c <= 0x1057 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x10A0 ) && ( c <= 0x10C5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x10D0 ) && ( c <= 0x10F8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1100 ) && ( c <= 0x1159 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x115F ) && ( c <= 0x11A2 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x11A8 ) && ( c <= 0x11F9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1200 ) && ( c <= 0x1206 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1208 ) && ( c <= 0x1246 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x124A ) && ( c <= 0x124D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1250 ) && ( c <= 0x1256 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x125A ) && ( c <= 0x125D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1260 ) && ( c <= 0x1286 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x128A ) && ( c <= 0x128D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1290 ) && ( c <= 0x12AE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12B2 ) && ( c <= 0x12B5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12B8 ) && ( c <= 0x12BE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12C2 ) && ( c <= 0x12C5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12C8 ) && ( c <= 0x12CE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12D0 ) && ( c <= 0x12D6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12D8 ) && ( c <= 0x12EE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x12F0 ) && ( c <= 0x130E ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1312 ) && ( c <= 0x1315 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1318 ) && ( c <= 0x131E ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1320 ) && ( c <= 0x1346 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1348 ) && ( c <= 0x135A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1361 ) && ( c <= 0x137C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x13A0 ) && ( c <= 0x13F4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1401 ) && ( c <= 0x1676 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1681 ) && ( c <= 0x169A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x16A0 ) && ( c <= 0x16F0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1700 ) && ( c <= 0x170C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x170E ) && ( c <= 0x1711 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1720 ) && ( c <= 0x1731 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1735 ) && ( c <= 0x1736 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1740 ) && ( c <= 0x1751 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1760 ) && ( c <= 0x176C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x176E ) && ( c <= 0x1770 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1780 ) && ( c <= 0x17B6 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x17BE ) && ( c <= 0x17C5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x17C7 ) && ( c <= 0x17C8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x17D4 ) && ( c <= 0x17DA ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x17E0 ) && ( c <= 0x17E9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1810 ) && ( c <= 0x1819 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1820 ) && ( c <= 0x1877 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1880 ) && ( c <= 0x18A8 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1E00 ) && ( c <= 0x1E9B ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1EA0 ) && ( c <= 0x1EF9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F00 ) && ( c <= 0x1F15 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F18 ) && ( c <= 0x1F1D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F20 ) && ( c <= 0x1F45 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F48 ) && ( c <= 0x1F4D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F50 ) && ( c <= 0x1F57 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F5F ) && ( c <= 0x1F7D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1F80 ) && ( c <= 0x1FB4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FB6 ) && ( c <= 0x1FBC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FC2 ) && ( c <= 0x1FC4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FC6 ) && ( c <= 0x1FCC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FD0 ) && ( c <= 0x1FD3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FD6 ) && ( c <= 0x1FDB ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FE0 ) && ( c <= 0x1FEC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FF2 ) && ( c <= 0x1FF4 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x1FF6 ) && ( c <= 0x1FFC ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x210A ) && ( c <= 0x2113 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x2119 ) && ( c <= 0x211D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x212A ) && ( c <= 0x212D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x212F ) && ( c <= 0x2131 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x2133 ) && ( c <= 0x2139 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x213D ) && ( c <= 0x213F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x2145 ) && ( c <= 0x2149 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x2160 ) && ( c <= 0x2183 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x2336 ) && ( c <= 0x237A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x249C ) && ( c <= 0x24E9 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3005 ) && ( c <= 0x3007 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3021 ) && ( c <= 0x3029 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3031 ) && ( c <= 0x3035 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3038 ) && ( c <= 0x303C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3041 ) && ( c <= 0x3096 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x309D ) && ( c <= 0x309F ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x30A1 ) && ( c <= 0x30FA ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x30FC ) && ( c <= 0x30FF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3105 ) && ( c <= 0x312C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3131 ) && ( c <= 0x318E ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3190 ) && ( c <= 0x31B7 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x31F0 ) && ( c <= 0x321C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3220 ) && ( c <= 0x3243 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3260 ) && ( c <= 0x327B ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x327F ) && ( c <= 0x32B0 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x32C0 ) && ( c <= 0x32CB ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x32D0 ) && ( c <= 0x32FE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3300 ) && ( c <= 0x3376 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x337B ) && ( c <= 0x33DD ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x33E0 ) && ( c <= 0x33FE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x3400 ) && ( c <= 0x4DB5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0x4E00 ) && ( c <= 0x9FA5 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xA000 ) && ( c <= 0xA48C ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xAC00 ) && ( c <= 0xD7A3 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xD800 ) && ( c <= 0xFA2D ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFA30 ) && ( c <= 0xFA6A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB00 ) && ( c <= 0xFB06 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFB13 ) && ( c <= 0xFB17 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFF21 ) && ( c <= 0xFF3A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFF41 ) && ( c <= 0xFF5A ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFF66 ) && ( c <= 0xFFBE ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFFC2 ) && ( c <= 0xFFC7 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFFCA ) && ( c <= 0xFFCF ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFFD2 ) && ( c <= 0xFFD7 ) ) 
-            {
-                continue;
-            }
-
-            if ( ( c >= 0xFFDA ) && ( c <= 0xFFDC ) ) 
-            {
-                continue;
-            }
-
-            // Now, fo every other chars, add them to the buffer.
-            sb.append( c );
-        }
+        StringBuilder sb = new StringBuilder( array == null ? 0 : array.length );
+        sb.append( array );
         
         return sb;
     }
@@ -6090,7 +4610,7 @@
      */
     public static String insignifiantCharTelephoneNumber( String str )
     {
-        return insignifiantCharTelephoneNumber( str.toCharArray() ).toString();
+        return ( ( str == null ) ? "" : insignifiantCharTelephoneNumber( str.toCharArray()
).toString() );
     }
     
     /**
@@ -6159,7 +4679,7 @@
      */
     public static String insignifiantCharNumericString( String str )
     {
-        return ( str == null ? null : insignifiantCharNumericString( str.toCharArray() ).toString()
);
+        return ( str == null ? "" : insignifiantCharNumericString( str.toCharArray() ).toString()
);
     }
     
     /**



Mime
View raw message