directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1073260 - in /directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name: Rdn.java RdnSerializer.java
Date Tue, 22 Feb 2011 08:58:10 GMT
Author: elecharny
Date: Tue Feb 22 08:58:10 2011
New Revision: 1073260

URL: http://svn.apache.org/viewvc?rev=1073260&view=rev
Log:
Suppress useless fields

Modified:
    directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
    directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java

Modified: directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java?rev=1073260&r1=1073259&r2=1073260&view=diff
==============================================================================
--- directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
(original)
+++ directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
Tue Feb 22 08:58:10 2011
@@ -40,7 +40,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.util.*;
+import org.apache.directory.shared.util.Chars;
+import org.apache.directory.shared.util.Hex;
+import org.apache.directory.shared.util.StringConstants;
+import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -134,13 +138,6 @@ public class Rdn implements Cloneable, C
     /** The normalized Rdn */
     private String normName = null;
 
-    /** The starting position of this Rdn in the given string from which
-     * we have extracted the upName */
-    private int start;
-
-    /** The length of this Rdn upName */
-    private int length;
-
     /**
      * Stores all couple type = value. We may have more than one type, if the
      * '+' character appears in the AttributeTypeAndValue. This is a TreeSet,
@@ -230,8 +227,6 @@ public class Rdn implements Cloneable, C
      */
     public Rdn(String rdn, SchemaManager schemaManager) throws LdapInvalidDnException
     {
-        start = 0;
-
         if ( Strings.isNotEmpty(rdn) )
         {
             // Parse the string. The Rdn will be updated.
@@ -252,13 +247,11 @@ public class Rdn implements Cloneable, C
             }
 
             upName = rdn;
-            length = rdn.length();
         }
         else
         {
             upName = "";
             normName = "";
-            length = 0;
             normalized.set( false );
         }
     }
@@ -296,8 +289,6 @@ public class Rdn implements Cloneable, C
         addAVA( upType, normType, new StringValue( upValue ), new StringValue( normValue
) );
 
         upName = upType + '=' + upValue;
-        start = 0;
-        length = upName.length();
 
         // create the internal normalized form
         normalize();
@@ -346,8 +337,6 @@ public class Rdn implements Cloneable, C
         addAVA( upType, upType, new StringValue( upValue ), new StringValue( upValue ) );
 
         upName = upType + '=' + upValue;
-        start = 0;
-        length = upName.length();
 
         if( schemaManager != null )
         {
@@ -390,8 +379,6 @@ public class Rdn implements Cloneable, C
      */
     Rdn(int start, int length, String upName, String normName)
     {
-        this.start = start;
-        this.length = length;
         this.upName = upName;
         this.normName = normName;
         normalized.set( true );
@@ -409,8 +396,6 @@ public class Rdn implements Cloneable, C
         nbAtavs = rdn.getNbAtavs();
         this.normName = rdn.normName;
         this.upName = rdn.getName();
-        this.start = rdn.start;
-        this.length = rdn.length;
         normalized.set(rdn.normalized.get());
 
         switch ( rdn.getNbAtavs() )
@@ -679,8 +664,6 @@ public class Rdn implements Cloneable, C
         nbAtavs = 0;
         normName = "";
         upName = "";
-        start = -1;
-        length = 0;
         normalized.set( false );
     }
 
@@ -742,28 +725,6 @@ public class Rdn implements Cloneable, C
 
 
     /**
-     * Get the start position
-     *
-     * @return The start position in the Dn
-     */
-    public int getStart()
-    {
-        return start;
-    }
-
-
-    /**
-     * Get the Rdn length
-     *
-     * @return the Rdn length
-     */
-    public int getLength()
-    {
-        return length;
-    }
-
-
-    /**
      * Get the AttributeTypeAndValue which type is given as an argument. If we
      * have more than one value associated with the type, we will return only
      * the first one.
@@ -1553,9 +1514,6 @@ public class Rdn implements Cloneable, C
             Unicode.writeUTF(out, normName);
         }
 
-        out.writeInt( start );
-        out.writeInt( length );
-
         switch ( nbAtavs )
         {
             case 0:
@@ -1602,9 +1560,6 @@ public class Rdn implements Cloneable, C
             normName = upName;
         }
 
-        start = in.readInt();
-        length = in.readInt();
-
         switch ( nbAtavs )
         {
             case 0:

Modified: directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java?rev=1073260&r1=1073259&r2=1073260&view=diff
==============================================================================
--- directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java
(original)
+++ directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java
Tue Feb 22 08:58:10 2011
@@ -74,8 +74,6 @@ public final class RdnSerializer
         out.writeInt( rdn.getNbAtavs() );
         Unicode.writeUTF(out, rdn.getName());
         Unicode.writeUTF(out, rdn.getNormName());
-        out.writeInt( rdn.getStart() );
-        out.writeInt( rdn.getLength() );
         
         switch ( rdn.getNbAtavs() )
         {
@@ -124,12 +122,8 @@ public final class RdnSerializer
             normName = upName;
         }
         
-        // Read the Rdn's position and length
-        int start = in.readInt();
-        int length = in.readInt();
-        
         // Now creates the Rdn
-        Rdn rdn = new Rdn( length, start, upName, normName );
+        Rdn rdn = new Rdn( 0, 0, upName, normName );
 
         // Read through the Atavs
         switch ( nbAtavs )



Mime
View raw message