directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r928092 - in /directory: apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/lda...
Date Fri, 26 Mar 2010 22:58:48 GMT
Author: elecharny
Date: Fri Mar 26 22:58:48 2010
New Revision: 928092

URL: http://svn.apache.org/viewvc?rev=928092&view=rev
Log:
o Moved the fields from ServerBinaryValue to ClientBinaryValue
o Moved the clone() method
This is a first step toward a merge of those two classes

Modified:
    directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerBinaryValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java?rev=928092&r1=928091&r2=928092&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
Fri Mar 26 22:58:48 2010
@@ -296,7 +296,7 @@ public class ServerBinaryValueTest
         AttributeType at1 = TestServerEntryUtils.getBytesAttributeType();
         ServerBinaryValue sbv = new ServerBinaryValue( at1, null );
         
-        ServerBinaryValue sbv1 = sbv.clone();
+        ClientBinaryValue sbv1 = sbv.clone();
         
         assertEquals( sbv, sbv1 );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerBinaryValue.java?rev=928092&r1=928091&r2=928092&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerBinaryValue.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerBinaryValue.java
Fri Mar 26 22:58:48 2010
@@ -36,8 +36,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.comparators.ByteArrayComparator;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * A server side schema aware wrapper around a binary attribute value.
@@ -50,20 +48,6 @@ import org.slf4j.LoggerFactory;
  */
 public class ServerBinaryValue extends ClientBinaryValue
 {
-    /** Used for serialization */
-    private static final long serialVersionUID = 2L;
-
-    /** logger for reporting errors that might not be handled properly upstream */
-    private static final Logger LOG = LoggerFactory.getLogger( ServerBinaryValue.class );
-
-    /** used to dynamically lookup the attributeType when/if deserializing */
-    //@SuppressWarnings ( { "FieldCanBeLocal", "UnusedDeclaration" } )
-    //private final String oid;
-
-    /** reference to the attributeType which is not serialized */
-    private transient AttributeType attributeType;
-
-
     // -----------------------------------------------------------------------
     // utility methods
     // -----------------------------------------------------------------------
@@ -578,23 +562,6 @@ public class ServerBinaryValue extends C
 
 
     /**
-     * @return a copy of the current value
-     */
-    public ServerBinaryValue clone()
-    {
-        ServerBinaryValue clone = ( ServerBinaryValue ) super.clone();
-
-        if ( normalizedValue != null )
-        {
-            clone.normalizedValue = new byte[normalizedValue.length];
-            System.arraycopy( normalizedValue, 0, clone.normalizedValue, 0, normalizedValue.length
);
-        }
-
-        return clone;
-    }
-
-
-    /**
      * @see Externalizable#writeExternal(ObjectOutput)
      * 
      * We can't use this method for a ServerBinaryValue, as we have to feed the value

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java?rev=928092&r1=928091&r2=928092&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
Fri Mar 26 22:58:48 2010
@@ -31,6 +31,7 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.AbstractValue;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.comparators.ByteArrayComparator;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -50,11 +51,13 @@ import org.slf4j.LoggerFactory;
 public class ClientBinaryValue extends AbstractValue<byte[]>
 {
     /** Used for serialization */
-    private static final long serialVersionUID = 2L;
+    protected static final long serialVersionUID = 2L;
     
     /** logger for reporting errors that might not be handled properly upstream */
-    private static final Logger LOG = LoggerFactory.getLogger( ClientBinaryValue.class );
-
+    protected static final Logger LOG = LoggerFactory.getLogger( ClientBinaryValue.class
);
+    
+    /** reference to the attributeType which is not serialized */
+    protected transient AttributeType attributeType;
 
     /**
      * Creates a ServerBinaryValue without an initial wrapped value.



Mime
View raw message