directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491288 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
Date Sat, 30 Dec 2006 18:40:29 GMT
Author: elecharny
Date: Sat Dec 30 10:40:28 2006
New Revision: 491288

URL: http://svn.apache.org/viewvc?view=rev&rev=491288
Log:
Remove useless newString( xxx) calls when xxx is already a String
Call the new method StringTools.getHexValue( char )

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java?view=diff&rev=491288&r1=491287&r2=491288
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
Sat Dec 30 10:40:28 2006
@@ -252,8 +252,8 @@
    {
        super();
        nbAtavs = rdn.getNbAtavs();
-       this.normName = new String( rdn.normName );
-       this.upName = new String( rdn.getUpName() );
+       this.normName = rdn.normName;
+       this.upName = rdn.getUpName();
        this.start = rdn.start;
        this.length = rdn.length;
 
@@ -965,7 +965,7 @@
            {
                if ( StringTools.isHex( chars, i ) && StringTools.isHex( chars, i
+ 1 ) )
                {
-                   hexValue[pos++] = ( byte ) ( ( StringTools.HEX_VALUE[chars[i]] <<
4 ) + StringTools.HEX_VALUE[chars[i + 1]] );
+                   hexValue[pos++] = StringTools.getHexValue( chars[i], chars[i + 1] );
                }
                else
                {
@@ -1009,7 +1009,7 @@
                            if ( StringTools.isHex( chars, i ) )
                            {
                                isHex = true;
-                               pair = ( ( byte ) ( StringTools.HEX_VALUE[chars[i]] <<
4 ) );
+                               pair = ( (byte)( StringTools.getHexValue( chars[i] ) <<
4 ) );
                            }
                    }
                }
@@ -1019,7 +1019,7 @@
                    {
                        if ( StringTools.isHex( chars, i ) )
                        {
-                           pair += StringTools.HEX_VALUE[chars[i]];
+                           pair += StringTools.getHexValue( chars[i] );
                            bytes[pos++] = pair;
                        }
                    }



Mime
View raw message