directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491690 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java
Date Mon, 01 Jan 2007 23:20:50 GMT
Author: elecharny
Date: Mon Jan  1 15:20:50 2007
New Revision: 491690

URL: http://svn.apache.org/viewvc?view=rev&rev=491690
Log:
Fixed a lot of potential pb if bytes when > 0x7F (considering a byte could be unsigned,
which is not the case)
Removed dead declarations

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java?view=diff&rev=491690&r1=491689&r2=491690
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/DNUtils.java
Mon Jan  1 15:20:50 2007
@@ -178,16 +178,6 @@
     /** "OID." static */
     public static final String OID_UPPER = "OID.";
 
-    /** "oid." static */
-    public static final byte[] OID_LOWER_BYTES = new byte[]
-        { 'o', 'i', 'd', '.' };
-
-    /** "OID." static */
-    public static final byte[] OID_UPPER_BYTES = new byte[]
-        { 'O', 'I', 'D', '.' };
-
-
-
     // ~ Methods
     // ------------------------------------------------------------------------------------
 
@@ -214,7 +204,7 @@
         {
             byte c = byteArray[index];
 
-            if ( ( c > 127 ) || ( SAFE_INIT_CHAR[c] == false ) )
+            if ( ( ( c | 0x7F ) != 0x7F ) || ( SAFE_INIT_CHAR[c] == false ) )
             {
                 return -1;
             }
@@ -225,7 +215,7 @@
             {
                 c = byteArray[index];
 
-                if ( ( c > 127 ) || ( SAFE_CHAR[c] == false ) )
+                if ( ( ( c | 0x7F ) != 0x7F ) || ( SAFE_CHAR[c] == false ) )
                 {
                     break;
                 }
@@ -322,7 +312,7 @@
         {
             byte c = byteArray[index];
 
-            if ( ( c > 127 ) || ( PAIR_CHAR[c] == false ) )
+            if ( ( ( c | 0x7F ) != 0x7F )  || ( PAIR_CHAR[c] == false ) )
             {
                 return false;
             }
@@ -361,7 +351,7 @@
         {
             char c = charArray[index];
 
-            if ( ( c > 127 ) || ( PAIR_CHAR[c] == false ) )
+            if ( ( ( c | 0x7F ) != 0x7F )  || ( PAIR_CHAR[c] == false ) )
             {
                 return false;
             }
@@ -408,7 +398,7 @@
         {
             char c = string.charAt( index );
 
-            if ( ( c > 127 ) || ( PAIR_CHAR[c] == false ) )
+            if ( ( ( c | 0x7F ) != 0x7F )  || ( PAIR_CHAR[c] == false ) )
             {
                 return PARSING_ERROR;
             }
@@ -448,7 +438,7 @@
         {
             byte c = byteArray[index];
 
-            if ( c < 0x40 )
+            if ( ( c | 0x3F ) == 0x3F )
             {
                 return STRING_CHAR[ c ];
             }
@@ -521,7 +511,7 @@
         {
             char c = string.charAt( index );
 
-            if ( c < 0x40 )
+            if ( ( c | 0x3F) == 0x3F )
             {
                 return STRING_CHAR[ c ];
             }
@@ -894,7 +884,7 @@
         {
             byte c = byteArray[index];
 
-            if ( ( c > 127 ) || ( BASE64_CHAR[c] == false ) )
+            if ( ( ( c | 0x7F ) != 0x7F )  || ( BASE64_CHAR[c] == false ) )
             {
                 return -1;
             }
@@ -905,7 +895,7 @@
             {
                 c = byteArray[index];
 
-                if ( ( c > 127 ) || ( BASE64_CHAR[c] == false ) )
+                if ( ( ( c | 0x7F ) != 0x7F )  || ( BASE64_CHAR[c] == false ) )
                 {
                     break;
                 }



Mime
View raw message