directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r365732 - /directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java
Date Tue, 03 Jan 2006 20:16:41 GMT
Author: akarasulu
Date: Tue Jan  3 12:16:39 2006
New Revision: 365732

URL: http://svn.apache.org/viewcvs?rev=365732&view=rev
Log:
adding computeLength() method

Modified:
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java?rev=365732&r1=365731&r2=365732&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java
(original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/pojo/psearch/PSearchControl.java
Tue Jan  3 12:16:39 2006
@@ -1,6 +1,7 @@
 package org.apache.ldap.common.asn1.pojo.psearch;
 
 import org.apache.asn1.ber.tlv.Length;
+import org.apache.asn1.ber.tlv.Value;
 
 
 public class PSearchControl
@@ -30,18 +31,16 @@
      */
     private int changeTypes;
 
-    /** temporarily holds computed length */
-    private transient int length;
-    
-    
+
     /**
      * Compute the PSearchControl length
      */
     public int computeLength()
     {
-
-        length = 1 + 1 + 1; 
-        return 1 + Length.getNbBytes( length ) + length;
+        int changeTypesLength = 2 + Value.getNbBytes( changeTypes );
+        return  1 + Length.getNbBytes( changeTypesLength + 6 ) +
+                changeTypesLength + // for changeTypes 
+                6;                  // for two boolean values 
     }
 
     



Mime
View raw message