directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1036646 - /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
Date Thu, 18 Nov 2010 21:44:39 GMT
Author: felixk
Date: Thu Nov 18 21:44:38 2010
New Revision: 1036646

URL: http://svn.apache.org/viewvc?rev=1036646&view=rev
Log:
- The first byte containing the number of unused bits isn't of use here, but gives a false
result
- IMO value should contain the new int value after quitting this method and not the old value
(getBytes() holds still the old bytes value, the new bytes value is set on the following line

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java?rev=1036646&r1=1036645&r2=1036646&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
Thu Nov 18 21:44:38 2010
@@ -56,7 +56,8 @@ public abstract class AbstractKerberosFl
     public AbstractKerberosFlags( byte[] flags )
     {
         super( flags );
-        value = ( ( getBytes()[0] & 0x00F ) << 24 ) | ( ( getBytes()[1] & 0x00FF
) << 16 ) | ( ( getBytes()[2] & 0x00FF ) << 8 ) | ( 0x00FF & getBytes()[3]
); 
+        // Remember getBytes() "A first byte containing the number of unused bits is added"
+        value = ( ( getBytes()[1] & 0x00F ) << 24 ) | ( ( getBytes()[2] & 0x00FF
) << 16 ) | ( ( getBytes()[3] & 0x00FF ) << 8 ) | ( 0x00FF & getBytes()[4]
); 
     }
     
     
@@ -162,7 +163,7 @@ public abstract class AbstractKerberosFl
             value = -1;
         }
         
-        value = ( ( getBytes()[0] & 0x00F ) << 24 ) | ( ( getBytes()[1] & 0x00FF
) << 16 ) | ( ( getBytes()[2] & 0x00FF ) << 8 ) | ( 0x00FF & getBytes()[3]
); 
+        value = ( ( bytes[0] & 0x00F ) << 24 ) | ( ( bytes[1] & 0x00FF ) <<
16 ) | ( ( bytes[2] & 0x00FF ) << 8 ) | ( 0x00FF & bytes[3] ); 
         setData( bytes );
     }
     



Mime
View raw message