directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1073274 - in /directory/shared/trunk/ldap-model/src: main/java/org/apache/directory/shared/ldap/model/name/ test/java/org/apache/directory/shared/ldap/model/name/
Date Tue, 22 Feb 2011 09:26:50 GMT
Author: elecharny
Date: Tue Feb 22 09:26:50 2011
New Revision: 1073274

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

Modified:
    directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
    directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java
    directory/shared/trunk/ldap-model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java

Modified: directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java?rev=1073274&r1=1073273&r2=1073274&view=diff
==============================================================================
--- directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
(original)
+++ directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
Tue Feb 22 09:26:50 2011
@@ -82,13 +82,6 @@ public class Ava implements Cloneable, C
     /** The user provided Ava */
     private String upName;
 
-    /** The starting position of this atav in the given string from which
-     * we have extracted the upName */
-    private int start;
-
-    /** The length of this atav upName */
-    private int length;
-
     /** Two values used for comparison, case sensitive */
     private static final boolean CASE_SENSITIVE = true;
 
@@ -106,8 +99,6 @@ public class Ava implements Cloneable, C
         normValue = null;
         upValue = null;
         upName = "";
-        start = -1;
-        length = 0;
     }
 
     
@@ -201,8 +192,6 @@ public class Ava implements Cloneable, C
         this.upValue = upValue;
         
         upName = this.upType + '=' + ( this.upValue == null ? "" : this.upValue.getString()
);
-        start = 0;
-        length = upName.length();
     }
 
 
@@ -258,8 +247,6 @@ public class Ava implements Cloneable, C
         this.upValue = upValue;
 
         this.upName = upName;
-        start = 0;
-        length = upName.length();
     }
 
 
@@ -316,28 +303,6 @@ public class Ava implements Cloneable, C
 
 
     /**
-     * Get the upName length
-     *
-     * @return the upName length
-     */
-    public int getLength()
-    {
-        return length;
-    }
-
-
-    /**
-     * get the position in the original upName where this atav starts.
-     *
-     * @return The starting position of this atav
-     */
-    public int getStart()
-    {
-        return start;
-    }
-
-
-    /**
      * Get the user provided form of this attribute type and value
      *
      * @return The user provided form of this atav
@@ -748,8 +713,6 @@ public class Ava implements Cloneable, C
         if ( Strings.isEmpty(upName)
             || Strings.isEmpty(upType)
             || Strings.isEmpty(normType)
-            || ( start < 0 )
-            || ( length < 2 ) // At least a type and '='
             || ( upValue.isNull() )
             || ( normValue.isNull() ) )
         {
@@ -767,14 +730,6 @@ public class Ava implements Cloneable, C
             {
                 message += "the normType should not be null or empty";
             }
-            else if ( start < 0 )
-            {
-                message += "the start should not be < 0";
-            }
-            else if ( length < 2 )
-            {
-                message += "the length should not be < 2";
-            }
             else if ( upValue.isNull() )
             {
                 message += "the upValue should not be null";
@@ -789,8 +744,6 @@ public class Ava implements Cloneable, C
         }
         
         Unicode.writeUTF(out, upName);
-        out.writeInt( start );
-        out.writeInt( length );
         Unicode.writeUTF(out, upType);
         Unicode.writeUTF(out, normType);
         
@@ -823,8 +776,6 @@ public class Ava implements Cloneable, C
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         upName = Unicode.readUTF(in);
-        start = in.readInt();
-        length = in.readInt();
         upType = Unicode.readUTF(in);
         normType = Unicode.readUTF(in);
         

Modified: directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java?rev=1073274&r1=1073273&r2=1073274&view=diff
==============================================================================
--- directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java
(original)
+++ directory/shared/trunk/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java
Tue Feb 22 09:26:50 2011
@@ -83,8 +83,6 @@ public final class AvaSerializer
         if ( Strings.isEmpty(atav.getUpName())
             || Strings.isEmpty(atav.getUpType())
             || Strings.isEmpty(atav.getNormType())
-            || ( atav.getStart() < 0 )
-            || ( atav.getLength() < 2 ) // At least a type and '='
             || ( atav.getUpValue().isNull() )
             || ( atav.getNormValue().isNull() ) )
         {
@@ -102,14 +100,6 @@ public final class AvaSerializer
             {
                 message += "the normType should not be null or empty";
             }
-            else if ( atav.getStart() < 0 )
-            {
-                message += "the start should not be < 0";
-            }
-            else if ( atav.getLength() < 2 )
-            {
-                message += "the length should not be < 2";
-            }
             else if ( atav.getUpValue().isNull() )
             {
                 message += "the upValue should not be null";
@@ -124,8 +114,6 @@ public final class AvaSerializer
         }
         
         Unicode.writeUTF(out, atav.getUpName());
-        out.writeInt( atav.getStart() );
-        out.writeInt( atav.getLength() );
         Unicode.writeUTF(out, atav.getUpType());
         Unicode.writeUTF(out, atav.getNormType());
         
@@ -162,8 +150,6 @@ public final class AvaSerializer
     public static Ava deserialize( ObjectInput in ) throws IOException
     {
         String upName = Unicode.readUTF(in);
-        in.readInt(); // start
-        in.readInt(); // length
         String upType = Unicode.readUTF(in);
         String normType = Unicode.readUTF(in);
         

Modified: directory/shared/trunk/ldap-model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java?rev=1073274&r1=1073273&r2=1073274&view=diff
==============================================================================
--- directory/shared/trunk/ldap-model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
(original)
+++ directory/shared/trunk/ldap-model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
Tue Feb 22 09:26:50 2011
@@ -20,26 +20,24 @@
 package org.apache.directory.shared.ldap.model.name;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.directory.shared.ldap.model.name.Ava;
-import org.apache.directory.shared.ldap.model.name.AvaSerializer;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the class AttributeTypeAndValue
@@ -61,8 +59,6 @@ public class AvaTest
         Ava atav = new Ava();
         assertEquals( "", atav.toString() );
         assertEquals( "", atav.getUpName() );
-        assertEquals( -1, atav.getStart() );
-        assertEquals( 0, atav.getLength() );
     }
 
 
@@ -153,8 +149,6 @@ public class AvaTest
         Ava atav = new Ava( "a", "a", "b", "b" );
         assertEquals( "a=b", atav.toString() );
         assertEquals( "a=b", atav.getUpName() );
-        assertEquals( 0, atav.getStart() );
-        assertEquals( 3, atav.getLength() );
     }
 
 



Mime
View raw message