directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [directory-server] branch master updated: Bumped up commons-collections and commons-lang to version 4 and 3, respectively
Date Thu, 15 Nov 2018 23:02:29 GMT
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git


The following commit(s) were added to refs/heads/master by this push:
     new d5e8015  Bumped up commons-collections and commons-lang to version 4 and 3, respectively
d5e8015 is described below

commit d5e8015727c8b3b1aac0197cb879207534ee466c
Author: elecharny <elecharny@pierre-arnauds-macbook-pro.home>
AuthorDate: Fri Nov 16 00:02:27 2018 +0100

    Bumped up commons-collections and commons-lang to version 4 and 3,
    respectively
---
 apache-felix/pom.xml                               |  6 +--
 core-api/pom.xml                                   | 14 +++---
 .../server/core/api/LdapCoreSessionConnection.java | 30 ++++++------
 .../interceptor/context/BindOperationContext.java  | 14 +++---
 .../context/FilteringOperationContext.java         | 19 ++++----
 core-avl/pom.xml                                   |  5 --
 .../server/core/avltree/DefaultMarshallerTest.java | 14 +++---
 core-integ/pom.xml                                 |  5 --
 .../server/core/authn/SimpleAuthenticationIT.java  | 13 ++---
 .../core/authz/AuthorizationServiceAsAdminIT.java  | 14 +++---
 core-jndi/pom.xml                                  |  5 --
 .../server/core/jndi/LdapJndiPropertiesTest.java   | 26 +++++-----
 core/pom.xml                                       |  6 ---
 .../server/core/security/CoreKeyStoreSpi.java      | 13 ++---
 interceptors/authn/pom.xml                         | 11 ++---
 .../server/core/authn/SimpleAuthenticator.java     | 12 ++---
 interceptors/exception/pom.xml                     |  6 +--
 .../core/exception/ExceptionInterceptor.java       |  4 +-
 interceptors/hash/pom.xml                          |  9 +---
 interceptors/logger/pom.xml                        |  9 +---
 jdbm-partition/pom.xml                             |  4 +-
 .../btree/jdbm/BTreeRedirectMarshallerTest.java    | 17 +++----
 .../impl/btree/jdbm/StringSerializerTest.java      | 10 ++--
 kerberos-test/pom.xml                              |  4 +-
 .../server/kerberos/kdc/AbstractKerberosITest.java | 20 ++++----
 mavibot-partition/pom.xml                          |  5 --
 osgi/pom.xml                                       |  2 +-
 osgi/src/main/filtered-resources/features.xml      |  2 +-
 pom.xml                                            | 12 ++---
 protocol-dns/pom.xml                               |  6 +--
 .../directory/server/dns/messages/DnsMessage.java  | 21 +++++----
 .../server/dns/messages/QuestionRecord.java        | 29 +++++++-----
 protocol-ldap/pom.xml                              | 10 ++--
 .../directory/server/ldap/LdapProtocolUtils.java   | 16 +++----
 .../server/ldap/handlers/LdapRequestHandler.java   | 45 +++++++++---------
 .../StoredProcedureExtendedOperationHandler.java   | 16 ++++---
 .../ldap/handlers/request/BindRequestHandler.java  | 55 +++++++++++-----------
 .../handlers/request/ExtendedRequestHandler.java   | 11 +++--
 .../handlers/request/SearchRequestHandler.java     | 20 ++++----
 .../handlers/sasl/AbstractSaslCallbackHandler.java | 19 ++++----
 .../ldap/handlers/sasl/SimpleMechanismHandler.java | 17 ++++---
 .../consumer/ReplicationConsumerImpl.java          | 28 +++++++----
 server-integ/pom.xml                               |  6 ---
 .../server/operations/bind/MiscBindIT.java         | 18 +++----
 .../server/operations/bind/SaslBindIT.java         | 14 +++---
 server-jndi/pom.xml                                |  6 +--
 .../directory/server/configuration/ApacheDS.java   | 26 +++++-----
 xdbm-partition/pom.xml                             |  6 ---
 .../xdbm/search/cursor/DescendantCursor.java       | 39 ++++++++-------
 49 files changed, 356 insertions(+), 363 deletions(-)

diff --git a/apache-felix/pom.xml b/apache-felix/pom.xml
index 60fd75a..0d04325 100644
--- a/apache-felix/pom.xml
+++ b/apache-felix/pom.xml
@@ -97,9 +97,9 @@
                   <version>2.0.1</version>
                 </artifactItem>
                 <artifactItem>
-                  <groupId>commons-lang</groupId>
-                  <artifactId>commons-lang</artifactId>
-                  <version>2.6</version>
+                  <groupId>org.apache.commons</groupId>
+                  <artifactId>commons-lang3</artifactId>
+                  <version>3.8.1</version>
                 </artifactItem>
                 <artifactItem>
                   <groupId>commons-collections</groupId>
diff --git a/core-api/pom.xml b/core-api/pom.xml
index a0e2abe..1eabce9 100644
--- a/core-api/pom.xml
+++ b/core-api/pom.xml
@@ -43,11 +43,6 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-constants</artifactId>
     </dependency>
@@ -101,7 +96,12 @@
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-util</artifactId>
     </dependency>
-    
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+  
     <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-core</artifactId>
@@ -178,7 +178,7 @@
             <Import-Package>
                 net.sf.ehcache;version=${ehcache.version},
                 net.sf.ehcache.config;version=${ehcache.version},
-                org.apache.commons.lang;version=${commons.lang.version},
+                org.apache.commons.lang3;version=${commons.lang.version},
                 org.apache.directory.api.asn1.util;version=${org.apache.directory.api.version},
                 org.apache.directory.api.i18n;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.codec.api;version=${org.apache.directory.api.version},
diff --git a/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java b/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
index 99dbca2..9c2c86d 100644
--- a/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
+++ b/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
@@ -27,7 +27,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.api.asn1.util.Oid;
 import org.apache.directory.api.ldap.codec.api.BinaryAttributeDetector;
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
@@ -84,6 +83,7 @@ import org.apache.directory.api.ldap.model.message.SearchScope;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.name.Rdn;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.util.exception.NotImplementedException;
 import org.apache.directory.ldap.client.api.AbstractLdapConnection;
 import org.apache.directory.ldap.client.api.EntryCursorImpl;
 import org.apache.directory.ldap.client.api.SaslRequest;
@@ -227,8 +227,8 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
 
         processResponse( addResponse );
     }
-    
-    
+
+
     /**
      * Process the SASL Bind. It's a dialog with the server, we will send a first BindRequest, receive
      * a response and the, if this response is a challenge, continue by sending a new BindRequest with
@@ -238,6 +238,7 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
      * @return A {@link BindResponse} containing the result
      * @throws LdapException if some error occurred
      */
+    @Override
     public BindResponse bind( SaslRequest saslRequest ) throws LdapException
     {
         throw new NotImplementedException();
@@ -429,12 +430,13 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isRequestCompleted( int messageId )
     {
         return false;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -608,7 +610,7 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
         {
             // Special case to deal with insufficient permissions
             LOG.info( lnpe.getMessage(), lnpe );
-            
+
             return false;
         }
         catch ( LdapException le )
@@ -798,14 +800,14 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
             String msg = "Modify Dn is not allowed on Root DSE.";
             result.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
             result.setDiagnosticMessage( msg );
-            
+
             return resp;
         }
 
         try
         {
             Rdn newRdn = modDnRequest.getNewRdn();
-            
+
             if ( ( newRdn != null ) && !newRdn.isSchemaAware() )
             {
                 modDnRequest.setNewRdn( new Rdn( schemaManager, newRdn ) );
@@ -819,7 +821,7 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
                 oldRdn = modDnRequest.getName().getRdn();
             }
 
-            boolean rdnChanged = modDnRequest.getNewRdn() != null 
+            boolean rdnChanged = modDnRequest.getNewRdn() != null
                 && !newRdn.getNormName().equals( oldRdn.getNormName() );
 
             if ( rdnChanged )
@@ -1122,7 +1124,7 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
         SearchRequest searchRequest = new SearchRequestImpl();
 
         searchRequest.setBase( baseDn );
-        
+
         searchRequest.setFilter( filter );
         searchRequest.setScope( scope );
         searchRequest.addAttributes( attributes );
@@ -1299,12 +1301,12 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
         bindContext.setCredentials( bindRequest.getCredentials() );
 
         Dn bindDn =  bindRequest.getDn();
-        
+
         if ( !bindDn.isSchemaAware() )
         {
             bindDn = new Dn( directoryService.getSchemaManager(), bindDn );
         }
-        
+
         bindContext.setDn( bindDn );
         bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND ) );
 
@@ -1395,8 +1397,8 @@ public class LdapCoreSessionConnection extends AbstractLdapConnection
     {
         this.schemaManager = schemaManager;
     }
-    
-    
+
+
     /**
      * @return The session, if we have some
      */
diff --git a/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java b/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
index 8849711..72cc451 100644
--- a/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
+++ b/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
@@ -6,21 +6,21 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
  *  under the License.
- * 
+ *
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
 
-import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.NotImplementedException;
 import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
 import org.apache.directory.api.ldap.model.message.MessageTypeEnum;
@@ -66,7 +66,7 @@ public class BindOperationContext extends AbstractOperationContext
 
     /**
      * Creates a new instance of BindOperationContext.
-     * 
+     *
      * @param session The session to use
      */
     public BindOperationContext( CoreSession session )
@@ -182,6 +182,7 @@ public class BindOperationContext extends AbstractOperationContext
     /**
      * @return the operation name
      */
+    @Override
     public String getName()
     {
         return MessageTypeEnum.BIND_REQUEST.name();
@@ -191,6 +192,7 @@ public class BindOperationContext extends AbstractOperationContext
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         return "BindContext for Dn '" + getDn().getName() + "', credentials <"
@@ -203,7 +205,7 @@ public class BindOperationContext extends AbstractOperationContext
     /**
      * Tells if the current operation is considered a side effect of the
      * current context
-     * 
+     *
      * @return <tt>true</tt> if there is no collateral operation
      */
     public boolean isCollateralOperation()
diff --git a/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java b/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java
index e3694de..d0cab98 100644
--- a/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java
+++ b/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
  *  under the License.
- * 
+ *
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
@@ -23,7 +23,7 @@ package org.apache.directory.server.core.api.interceptor.context;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -69,7 +69,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
 
     /**
      * Creates a new instance of FilteringOperationContext.
-     * 
+     *
      * @param session The session to use
      */
     public FilteringOperationContext( CoreSession session )
@@ -141,7 +141,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
 
     /**
      * Tells if an attribute is present in the list of attribute to return
-     * 
+     *
      * @param schemaManager The SchemaManager instance
      * @param attribute The attribute we are looking for
      * @return true if the attribute is present
@@ -168,7 +168,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
 
     /**
      * Tells if an attribute is present in the list of attribute to return
-     * 
+     *
      * @param schemaManager The SchemaManager instance
      * @param attributeType The attributeType we are looking for
      * @return true if the attribute is present
@@ -201,7 +201,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
         {
             return true;
         }
-        
+
         // Ok, do it the slow way...
         for ( AttributeTypeOptions attributeTypeOptions : returningAttributes )
         {
@@ -221,7 +221,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
         if ( ( attributeIds != null ) && ( attributeIds.length != 0 ) && ( attributeIds[0] != null ) )
         {
             // We have something in the list
-            // first, ignore all the unkown AT and convert the strings to 
+            // first, ignore all the unkown AT and convert the strings to
             // AttributeTypeOptions
             returningAttributes = new HashSet<>();
             Set<String> attributesString = new HashSet<>();
@@ -407,6 +407,7 @@ public abstract class FilteringOperationContext extends AbstractOperationContext
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
diff --git a/core-avl/pom.xml b/core-avl/pom.xml
index 04e89f6..736cfda 100644
--- a/core-avl/pom.xml
+++ b/core-avl/pom.xml
@@ -42,11 +42,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-model</artifactId>
     </dependency>
diff --git a/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java b/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
index 18fd53f..64f778a 100644
--- a/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
+++ b/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.avltree;
 
@@ -25,8 +25,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.Serializable;
+import java.util.Objects;
 
-import org.apache.commons.lang.ArrayUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -52,7 +52,7 @@ public class DefaultMarshallerTest
         byte[] serialized = marshaller.serialize( "test" );
         Object deserialized = marshaller.deserialize( serialized );
         assertEquals( "test", deserialized );
-        assertTrue( ArrayUtils.isEquals( serialized, marshaller.serialize( deserialized ) ) );
+        assertTrue( Objects.deepEquals( serialized, marshaller.serialize( deserialized ) ) );
     }
 
 
@@ -62,7 +62,7 @@ public class DefaultMarshallerTest
         byte[] serialized = marshaller.serialize( new Bar() );
         Object deserialized = marshaller.deserialize( serialized );
         assertNotNull( deserialized );
-        assertTrue( ArrayUtils.isEquals( serialized, marshaller.serialize( deserialized ) ) );
+        assertTrue( Objects.deepEquals( serialized, marshaller.serialize( deserialized ) ) );
     }
 
     static class Bar implements Serializable
diff --git a/core-integ/pom.xml b/core-integ/pom.xml
index a7e295d..1638824 100644
--- a/core-integ/pom.xml
+++ b/core-integ/pom.xml
@@ -96,11 +96,6 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-client-api</artifactId>
       <scope>provided</scope>
diff --git a/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java b/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
index d74f89e..7bcdffd 100644
--- a/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
+++ b/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
@@ -27,7 +27,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import org.apache.commons.lang.ArrayUtils;
+import java.util.Objects;
+
 import org.apache.directory.api.ldap.model.entry.Attribute;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
@@ -91,7 +92,7 @@ public class SimpleAuthenticationIT extends AbstractLdapTestUnit
 
         Entry entry = connection.lookup( userDn );
         performAdminAccountChecks( entry );
-        assertTrue( ArrayUtils.isEquals( entry.get( "userPassword" ).get().getBytes(), Strings
+        assertTrue( Objects.deepEquals( entry.get( "userPassword" ).get().getBytes(), Strings
             .getBytesUtf8( "secret" ) ) );
         connection.close();
 
@@ -101,7 +102,7 @@ public class SimpleAuthenticationIT extends AbstractLdapTestUnit
         connection = getConnectionAs( getService(), userDn, "secret" );
         entry = connection.lookup( userDn );
         performAdminAccountChecks( entry );
-        assertTrue( ArrayUtils.isEquals( entry.get( "userPassword" ).get().getBytes(), Strings
+        assertTrue( Objects.deepEquals( entry.get( "userPassword" ).get().getBytes(), Strings
             .getBytesUtf8( "secret" ) ) );
         connection.close();
     }
@@ -528,8 +529,8 @@ public class SimpleAuthenticationIT extends AbstractLdapTestUnit
         assertNotNull( entry );
         assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );
     }
-    
-    
+
+
     @Test
     public void testBCRYPT() throws Exception
     {
@@ -545,7 +546,7 @@ public class SimpleAuthenticationIT extends AbstractLdapTestUnit
         // now modify the password for akarasulu : 'secret', encrypted using CRYPT
         ModifyRequest modReq = new ModifyRequestImpl();
         modReq.setName( new Dn( userDn ) );
-        
+
         // The hash is for 'secret'
         modReq.replace( "userPassword", "{crypt}$2a$06$LH2xIb/TZmajuLJGDNuegeeY.SCwkg6YAVLNXTh8n4Xfb1uwmLXg6" );
         connection.modify( modReq );
diff --git a/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java b/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
index 3d53cd8..ca82726 100644
--- a/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
+++ b/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.authz;
 
@@ -26,8 +26,8 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.util.HashSet;
+import java.util.Objects;
 
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.EntryCursor;
 import org.apache.directory.api.ldap.model.entry.Entry;
@@ -94,7 +94,7 @@ public class AuthorizationServiceAsAdminIT extends AbstractLdapTestUnit
     @Test(expected = LdapNoPermissionException.class)
     public void testNoRdnChangesOnAdminByAdmin() throws Exception
     {
-        getAdminConnection().rename( new Dn( getService().getSchemaManager(), "uid=admin,ou=system" ), 
+        getAdminConnection().rename( new Dn( getService().getSchemaManager(), "uid=admin,ou=system" ),
             new Rdn( getService().getSchemaManager(), "uid=alex" ) );
     }
 
@@ -118,7 +118,7 @@ public class AuthorizationServiceAsAdminIT extends AbstractLdapTestUnit
 
         connection = getConnectionAs( adminDn, newPwd );
         Entry entry = connection.lookup( adminDn.getName() );
-        assertTrue( ArrayUtils.isEquals( Strings.getBytesUtf8( newPwd ), entry.get( "userPassword" ).get()
+        assertTrue( Objects.deepEquals( Strings.getBytesUtf8( newPwd ), entry.get( "userPassword" ).get()
             .getBytes() ) );
     }
 
diff --git a/core-jndi/pom.xml b/core-jndi/pom.xml
index 0e50957..7c6f5b7 100644
--- a/core-jndi/pom.xml
+++ b/core-jndi/pom.xml
@@ -60,11 +60,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-model</artifactId>
     </dependency>
diff --git a/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java b/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
index 4df8b94..f664018 100644
--- a/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
+++ b/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
@@ -6,37 +6,37 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.jndi;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.Hashtable;
+import java.util.Objects;
 
 import javax.naming.ConfigurationException;
 import javax.naming.Context;
 
-import org.apache.commons.lang.ArrayUtils;
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-
 import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.api.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
 
 /**
@@ -85,7 +85,7 @@ public class LdapJndiPropertiesTest
         env.put( Context.PROVIDER_URL, "" );
         LdapJndiProperties props = LdapJndiProperties.getLdapJndiProperties( env );
         assertEquals( AuthenticationLevel.SIMPLE, props.getAuthenticationLevel() );
-        assertTrue( ArrayUtils.isEquals( Strings.getBytesUtf8( "asdf" ), props.getCredentials() ) );
+        assertTrue( Objects.deepEquals( Strings.getBytesUtf8( "asdf" ), props.getCredentials() ) );
     }
 
 
@@ -141,6 +141,6 @@ public class LdapJndiPropertiesTest
         env.put( Context.PROVIDER_URL, "" );
         LdapJndiProperties props = LdapJndiProperties.getLdapJndiProperties( env );
         assertEquals( AuthenticationLevel.STRONG, props.getAuthenticationLevel() );
-        assertTrue( ArrayUtils.isEquals( Strings.getBytesUtf8( "asdf" ), props.getCredentials() ) );
+        assertTrue( Objects.deepEquals( Strings.getBytesUtf8( "asdf" ), props.getCredentials() ) );
     }
 }
diff --git a/core/pom.xml b/core/pom.xml
index 277c00a..57a03bb 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -130,11 +130,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-codec-core</artifactId>
     </dependency>
@@ -217,7 +212,6 @@
             </Export-Package>
             <Import-Package>
                 javax.security.auth.x500,
-                org.apache.commons.lang;version=${commons.lang.version},
                 org.apache.directory.api.ldap.codec.api;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.csn;version=${org.apache.directory.api.version},
diff --git a/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java b/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
index 0e9c402..9daa881 100644
--- a/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
+++ b/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
@@ -34,13 +34,13 @@ import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
 import java.util.Date;
 import java.util.Enumeration;
+import java.util.Objects;
 
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.util.SingletonEnumeration;
+import org.apache.directory.api.util.exception.NotImplementedException;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.i18n.I18n;
@@ -78,7 +78,7 @@ public class CoreKeyStoreSpi extends KeyStoreSpi
     private Entry getTlsEntry() throws LdapException
     {
         Dn adminDn = directoryService.getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
-        
+
         return directoryService.getAdminSession().lookup( adminDn );
     }
 
@@ -162,7 +162,8 @@ public class CoreKeyStoreSpi extends KeyStoreSpi
         try
         {
             Entry entry = getTlsEntry();
-            if ( ArrayUtils.isEquals( cert.getEncoded(), entry.get( TlsKeyGenerator.USER_CERTIFICATE_AT ).getBytes() ) )
+
+            if ( Objects.deepEquals( cert.getEncoded(), entry.get( TlsKeyGenerator.USER_CERTIFICATE_AT ).getBytes() ) )
             {
                 return APACHEDS_ALIAS;
             }
@@ -299,7 +300,7 @@ public class CoreKeyStoreSpi extends KeyStoreSpi
         {
             LOG.debug( "engineSetKeyEntry({}, key, {}, chain) called.", alias, new String( password ) );
         }
-        
+
         throw new NotImplementedException();
     }
 
@@ -314,7 +315,7 @@ public class CoreKeyStoreSpi extends KeyStoreSpi
         {
             LOG.debug( "engineSize() called." );
         }
-        
+
         return 1;
     }
 
diff --git a/interceptors/authn/pom.xml b/interceptors/authn/pom.xml
index b01340d..df06cbf 100644
--- a/interceptors/authn/pom.xml
+++ b/interceptors/authn/pom.xml
@@ -58,13 +58,8 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
     </dependency>
     
     <dependency>
@@ -154,7 +149,7 @@
                 org.apache.directory.server.core.authn.ppolicy;version=${project.version}
             </Export-Package>
             <Import-Package>
-                org.apache.commons.collections.map;version=${commons.collections.version},
+                org.apache.commons.collections4.map;version=${commons.collections.version},
                 org.apache.directory.api.ldap.extras.controls.ppolicy;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.extras.controls.ppolicy_impl;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
diff --git a/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java b/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
index d7f1e07..cd028d5 100644
--- a/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
+++ b/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
@@ -24,7 +24,7 @@ import java.net.SocketAddress;
 
 import javax.naming.Context;
 
-import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.collections4.map.LRUMap;
 import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Attribute;
@@ -96,7 +96,7 @@ public class SimpleAuthenticator extends AbstractAuthenticator
     /**
      * Creates a new instance.
      * @see AbstractAuthenticator
-     * 
+     *
      * @param baseDn The base Dn
      */
     public SimpleAuthenticator( Dn baseDn )
@@ -120,7 +120,7 @@ public class SimpleAuthenticator extends AbstractAuthenticator
 
     /**
      * Creates a new instance, with an initial cache size
-     * 
+     *
      * @param cacheSize the size of the credential cache
      * @param baseDn The base Dn
      */
@@ -222,7 +222,7 @@ public class SimpleAuthenticator extends AbstractAuthenticator
         byte[][] storedPasswords = principal.getUserPasswords();
 
         PasswordPolicyException ppe = null;
-        try 
+        try
         {
             checkPwdPolicy( bindContext.getEntry() );
         }
@@ -236,7 +236,7 @@ public class SimpleAuthenticator extends AbstractAuthenticator
         {
             if ( PasswordUtil.compareCredentials( credentials, storedPassword ) )
             {
-                if ( ppe != null ) 
+                if ( ppe != null )
                 {
                     LOG.debug( "{} Authentication failed: {}", bindContext.getDn(), ppe.getMessage() );
                     throw ppe;
@@ -281,7 +281,7 @@ public class SimpleAuthenticator extends AbstractAuthenticator
              */
             LookupOperationContext lookupContext = new LookupOperationContext( getDirectoryService().getAdminSession(),
                 bindContext.getDn(), SchemaConstants.ALL_USER_ATTRIBUTES, SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES );
-            
+
             lookupContext.setPartition( bindContext.getPartition() );
             lookupContext.setTransaction( bindContext.getTransaction() );
 
diff --git a/interceptors/exception/pom.xml b/interceptors/exception/pom.xml
index 83e1763..2d220eb 100644
--- a/interceptors/exception/pom.xml
+++ b/interceptors/exception/pom.xml
@@ -52,8 +52,8 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
     </dependency>
     
     <dependency>
@@ -112,7 +112,7 @@
                 org.apache.directory.server.core.exception;version=${project.version}
             </Export-Package>
             <Import-Package>
-                org.apache.commons.collections.map;version=${commons.collections.version},
+                org.apache.commons.collections4.map;version=${commons.collections.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.entry;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.exception;version=${org.apache.directory.api.version},
diff --git a/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java b/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
index 08a97f7..81bbefa 100644
--- a/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
+++ b/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.exception;
 
 
-import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.collections4.map.LRUMap;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Attribute;
 import org.apache.directory.api.ldap.model.entry.Entry;
@@ -327,7 +327,7 @@ public class ExceptionInterceptor extends BaseInterceptor
         HasEntryOperationContext hasEntryContext = new HasEntryOperationContext( renameContext.getSession(), newDn );
         hasEntryContext.setPartition( renameContext.getPartition() );
         hasEntryContext.setTransaction( renameContext.getTransaction() );
-        
+
         if ( nexus.hasEntry( hasEntryContext ) )
         {
             // Ok, the target entry already exists.
diff --git a/interceptors/hash/pom.xml b/interceptors/hash/pom.xml
index 656c927..802b152 100644
--- a/interceptors/hash/pom.xml
+++ b/interceptors/hash/pom.xml
@@ -65,13 +65,8 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
     </dependency>
     
     <dependency>
diff --git a/interceptors/logger/pom.xml b/interceptors/logger/pom.xml
index 2e86843..cf881f9 100644
--- a/interceptors/logger/pom.xml
+++ b/interceptors/logger/pom.xml
@@ -60,13 +60,8 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
     </dependency>
     
     <dependency>
diff --git a/jdbm-partition/pom.xml b/jdbm-partition/pom.xml
index 2cc5691..737c3ac 100644
--- a/jdbm-partition/pom.xml
+++ b/jdbm-partition/pom.xml
@@ -86,8 +86,8 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
     </dependency>
     
     <dependency>
diff --git a/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeRedirectMarshallerTest.java b/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeRedirectMarshallerTest.java
index 992eed8..93c9965 100644
--- a/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeRedirectMarshallerTest.java
+++ b/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeRedirectMarshallerTest.java
@@ -27,14 +27,15 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
+import java.util.Objects;
 import java.util.Random;
 
-import org.apache.commons.lang.ArrayUtils;
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test case for the BTreeRedirect serialization code.
@@ -66,7 +67,7 @@ public class BTreeRedirectMarshallerTest
     {
         byte[] bites = createBites();
         assertEquals( 0, marshaller.deserialize( bites ).getRecId() );
-        assertTrue( ArrayUtils.isEquals( bites, marshaller.serialize( new BTreeRedirect( 0 ) ) ) );
+        assertTrue( Objects.deepEquals( bites, marshaller.serialize( new BTreeRedirect( 0 ) ) ) );
     }
 
 
@@ -76,7 +77,7 @@ public class BTreeRedirectMarshallerTest
         byte[] bites = createBites();
         bites[8] = 1;
         assertEquals( 1, marshaller.deserialize( bites ).getRecId() );
-        assertTrue( ArrayUtils.isEquals( bites, marshaller.serialize( new BTreeRedirect( 1 ) ) ) );
+        assertTrue( Objects.deepEquals( bites, marshaller.serialize( new BTreeRedirect( 1 ) ) ) );
     }
 
 
@@ -90,7 +91,7 @@ public class BTreeRedirectMarshallerTest
         }
 
         assertEquals( -1, marshaller.deserialize( bites ).getRecId() );
-        assertTrue( ArrayUtils.isEquals( bites, marshaller.serialize( new BTreeRedirect( -1 ) ) ) );
+        assertTrue( Objects.deepEquals( bites, marshaller.serialize( new BTreeRedirect( -1 ) ) ) );
     }
 
 
@@ -100,7 +101,7 @@ public class BTreeRedirectMarshallerTest
         byte[] bites = createBites();
         bites[1] = ( byte ) 0x80;
         assertEquals( Long.MIN_VALUE, marshaller.deserialize( bites ).getRecId() );
-        assertTrue( ArrayUtils.isEquals( bites, marshaller.serialize( new BTreeRedirect( Long.MIN_VALUE ) ) ) );
+        assertTrue( Objects.deepEquals( bites, marshaller.serialize( new BTreeRedirect( Long.MIN_VALUE ) ) ) );
     }
 
 
@@ -116,7 +117,7 @@ public class BTreeRedirectMarshallerTest
         }
 
         assertEquals( Long.MAX_VALUE, marshaller.deserialize( bites ).getRecId() );
-        assertTrue( ArrayUtils.isEquals( bites, marshaller.serialize( new BTreeRedirect( Long.MAX_VALUE ) ) ) );
+        assertTrue( Objects.deepEquals( bites, marshaller.serialize( new BTreeRedirect( Long.MAX_VALUE ) ) ) );
     }
 
 
diff --git a/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java b/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java
index 13c22bc..5b8448d 100644
--- a/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java
+++ b/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
diff --git a/kerberos-test/pom.xml b/kerberos-test/pom.xml
index 743f133..0e01a6f 100644
--- a/kerberos-test/pom.xml
+++ b/kerberos-test/pom.xml
@@ -82,8 +82,8 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
     </dependency>
   </dependencies>
 
diff --git a/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java b/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
index 7e911f0..e90a659 100644
--- a/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
+++ b/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
@@ -29,14 +29,14 @@ import java.util.Collections;
 import javax.security.auth.Subject;
 import javax.security.auth.kerberos.KerberosTicket;
 
-import org.apache.directory.api.util.FileUtils;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.DefaultModification;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.entry.Modification;
 import org.apache.directory.api.ldap.model.entry.ModificationOperation;
 import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.core.api.LdapCoreSessionConnection;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -124,7 +124,7 @@ public class AbstractKerberosITest extends AbstractLdapTestUnit
 
         assertEquals( 2, subject.getPrivateCredentials().size() );
         assertEquals( 0, subject.getPublicCredentials().size() );
-        
+
         for ( KerberosTicket kt : subject.getPrivateCredentials( KerberosTicket.class ) )
         {
             // System.out.println( kt.getClient() );
@@ -149,7 +149,7 @@ public class AbstractKerberosITest extends AbstractLdapTestUnit
         // create krb5.conf with proper encryption type
         String krb5confPath = createKrb5Conf( parameters.checksumType, parameters.encryptionType, parameters.transport == TcpTransport.class );
         System.setProperty( "java.security.krb5.conf", krb5confPath );
-        
+
         // change encryption type in KDC
         kdcServer.getConfig().setEncryptionTypes( Collections.singleton( parameters.encryptionType ) );
 
@@ -168,21 +168,21 @@ public class AbstractKerberosITest extends AbstractLdapTestUnit
 
     /**
      * Creates the krb5.conf file for the test.
-     * 
+     *
      * It looks similar to this:
-     * 
+     *
      * <pre>
      * [libdefaults]
      *     default_realm = EXAMPLE.COM
      *     default_tkt_enctypes = aes256-cts-hmac-sha1-96
      *     default_tgs_enctypes = aes256-cts-hmac-sha1-96
      *     permitted_enctypes = aes256-cts-hmac-sha1-96
-     * 
+     *
      * [realms]
      *     EXAMPLE.COM = {
      *         kdc = localhost:6088
      *     }
-     * 
+     *
      * [domain_realm]
      *     .example.com = EXAMPLE.COM
      *     example.com = EXAMPLE.COM
@@ -207,12 +207,12 @@ public class AbstractKerberosITest extends AbstractLdapTestUnit
         //        data += "default_checksum = " + checksumType.getName() + SystemUtils.LINE_SEPARATOR;
         //        data += "ap_req_checksum_type = " + checksumType.getName() + SystemUtils.LINE_SEPARATOR;
         data += "default-checksum_type = " + checksumType.getName() + SystemUtils.LINE_SEPARATOR;
-        
+
         if ( isTcp )
         {
             data += "udp_preference_limit = 1" + SystemUtils.LINE_SEPARATOR;
         }
-            
+
 
         data += "[realms]" + SystemUtils.LINE_SEPARATOR;
         data += REALM + " = {" + SystemUtils.LINE_SEPARATOR;
diff --git a/mavibot-partition/pom.xml b/mavibot-partition/pom.xml
index c0aafad..fb60213 100644
--- a/mavibot-partition/pom.xml
+++ b/mavibot-partition/pom.xml
@@ -78,11 +78,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-model</artifactId>
     </dependency>
diff --git a/osgi/pom.xml b/osgi/pom.xml
index 87abb91..b6e2820 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -32,7 +32,7 @@
 
   <properties>
     <apache.directory.version>${project.version}</apache.directory.version>
-    <commons-collections.version>3.2.1</commons-collections.version>
+    <commons-collections.version>4.2</commons-collections.version>
   </properties>
   
   <dependencies>
diff --git a/osgi/src/main/filtered-resources/features.xml b/osgi/src/main/filtered-resources/features.xml
index 7f61df9..0acb5b0 100644
--- a/osgi/src/main/filtered-resources/features.xml
+++ b/osgi/src/main/filtered-resources/features.xml
@@ -29,7 +29,7 @@
       <!--<bundle>mvn:org.slf4j/slf4j-nop/1.5.6</bundle>-->
       <bundle>mvn:http://repository.springsource.com/maven/bundles/external!org.bouncycastle/com.springsource.org.bouncycastle.jce/1.39.0</bundle>
       <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-lang/2.4_2-SNAPSHOT</bundle>
-      <bundle>mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
+      <bundle>mvn:org.apache.collections/org.apache.collections/${commons-collections.version}</bundle>
       <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/3.0.1_2-SNAPSHOT</bundle>
       <bundle>mvn:org.apache.mina/mina-core/2.0.1</bundle>
       <bundle>mvn:org.apache.xbean/xbean-spring/${xbean.version}</bundle>
diff --git a/pom.xml b/pom.xml
index abec467..1d2f459 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,9 +57,9 @@
     <ant.version>1.10.1</ant.version>
     <bcprov.version>1.59</bcprov.version>
     <commons.cli.version>1.4</commons.cli.version>
-    <commons.collections.version>3.2.2</commons.collections.version>
+    <commons.collections.version>4.2</commons.collections.version>
     <commons.daemon.version>1.0.15</commons.daemon.version>
-    <commons.lang.version>2.6</commons.lang.version>
+    <commons.lang.version>3.8.1</commons.lang.version>
     <commons.net.version>3.6</commons.net.version>
     <commons.pool.version>2.6.0</commons.pool.version>
     <dnsjava.version>2.1.8</dnsjava.version>
@@ -1052,8 +1052,8 @@
       <!-- Commons dependencies -->
       
       <dependency>
-        <groupId>commons-collections</groupId>
-        <artifactId>commons-collections</artifactId>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-collections4</artifactId>
         <version>${commons.collections.version}</version>
       </dependency>
 
@@ -1064,8 +1064,8 @@
       </dependency>
 
       <dependency>
-        <groupId>commons-lang</groupId>
-        <artifactId>commons-lang</artifactId>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-lang3</artifactId>
         <version>${commons.lang.version}</version>
       </dependency>
 
diff --git a/protocol-dns/pom.xml b/protocol-dns/pom.xml
index d62aab2..246d800 100644
--- a/protocol-dns/pom.xml
+++ b/protocol-dns/pom.xml
@@ -59,8 +59,8 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
     </dependency>
 
     <dependency>
@@ -126,7 +126,7 @@
                 javax.naming,
                 javax.naming.directory,
                 javax.naming.ldap,
-                org.apache.commons.lang.builder;version=${commons.lang.version},
+                org.apache.commons.lang3.builder;version=${commons.lang.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.exception;version=${org.apache.directory.api.version},
                 org.apache.directory.api.util;version=${org.apache.directory.api.version},
diff --git a/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java b/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java
index 88b51a4..5f3dcf8 100644
--- a/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java
+++ b/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.server.dns.messages;
@@ -23,9 +23,9 @@ package org.apache.directory.server.dns.messages;
 
 import java.util.List;
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 /**
@@ -44,7 +44,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  *     +---------------------+
  *     |      Additional     | ResourceRecords holding additional information
  *     +---------------------+
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class DnsMessage
@@ -242,6 +242,7 @@ public class DnsMessage
     /**
      * @see java.lang.Object#equals(Object)
      */
+    @Override
     public boolean equals( Object object )
     {
         if ( object == this )
@@ -266,8 +267,9 @@ public class DnsMessage
 
     /**
      * @see java.lang.Object#hashCode()
-     * @return the instance's hash code 
+     * @return the instance's hash code
      */
+    @Override
     public int hashCode()
     {
         return new HashCodeBuilder( -1805208585, -276770303 ).append( this.transactionId ).append( this.answerRecords )
@@ -281,6 +283,7 @@ public class DnsMessage
     /**
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString()
     {
         return new ToStringBuilder( this ).appendSuper( super.toString() ).append( "transactionId", this.transactionId )
diff --git a/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java b/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java
index b645c8e..4e14ed5 100644
--- a/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java
+++ b/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java
@@ -6,31 +6,31 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.server.dns.messages;
 
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 /**
  * The question section is used to carry the "question" in most queries,
  * i.e., the parameters that define what is being asked.  The section
  * contains QDCOUNT (usually 1) entries, each of the following format:
- * 
+ *
  *                                     1  1  1  1  1  1
  *       0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
  *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
@@ -42,7 +42,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  *     |                     QCLASS                    |
  *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class QuestionRecord
@@ -87,7 +87,7 @@ public class QuestionRecord
     /**
      * The domain name of this query.
      * For example, www.example.com.
-     * 
+     *
      * @return The domain name.
      */
     public String getDomainName()
@@ -99,7 +99,7 @@ public class QuestionRecord
     /**
      * The type of the query.
      * For example, the type is A for address records.
-     * 
+     *
      * @return The {@link RecordType}.
      */
     public RecordType getRecordType()
@@ -111,7 +111,7 @@ public class QuestionRecord
     /**
      * The class for this query.
      * For example, the class is IN for the Internet.
-     * 
+     *
      * @return The {@link RecordClass}.
      */
     public RecordClass getRecordClass()
@@ -123,6 +123,7 @@ public class QuestionRecord
     /**
      * @see java.lang.Object#equals(Object)
      */
+    @Override
     public boolean equals( Object object )
     {
         if ( object == this )
@@ -141,8 +142,9 @@ public class QuestionRecord
 
     /**
      * @see java.lang.Object#hashCode()
-     * @return the instance's hash code 
+     * @return the instance's hash code
      */
+    @Override
     public int hashCode()
     {
         return new HashCodeBuilder( 1493545107, 315848479 ).append( this.domainName ).append( this.recordClass )
@@ -153,6 +155,7 @@ public class QuestionRecord
     /**
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString()
     {
         return new ToStringBuilder( this ).appendSuper( super.toString() ).append( "domainName", this.domainName )
diff --git a/protocol-ldap/pom.xml b/protocol-ldap/pom.xml
index 759bfe7..050b810 100644
--- a/protocol-ldap/pom.xml
+++ b/protocol-ldap/pom.xml
@@ -75,8 +75,8 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
     </dependency>
     
     <dependency>
@@ -210,9 +210,9 @@
                 jdbm,
                 jdbm.helper,
                 jdbm.recman,
-                org.apache.commons.collections.map;version=${commons.collections.version},
-                org.apache.commons.lang;version=${commons.lang.version},
-                org.apache.commons.lang.exception;version=${commons.lang.version},
+                org.apache.commons.collections4.map;version=${commons.collections.version},
+                org.apache.commons.lang3;version=${commons.lang.version},
+                org.apache.commons.lang3.exception;version=${commons.lang.version},
                 org.apache.directory.api.asn1.ber.tlv;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.codec.api;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.codec.controls.manageDsaIT;version=${org.apache.directory.api.version},
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolUtils.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolUtils.java
index 0d596f2..9aa06aa 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolUtils.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolUtils.java
@@ -20,7 +20,7 @@
 package org.apache.directory.server.ldap;
 
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.directory.api.ldap.model.csn.Csn;
 import org.apache.directory.api.ldap.model.message.Request;
 import org.apache.directory.api.ldap.model.message.Response;
@@ -44,7 +44,7 @@ public final class LdapProtocolUtils
     public static final String REPLICA_ID_PREFIX = "rid=";
 
     public static final int REPLICA_ID_PREFIX_LEN = REPLICA_ID_PREFIX.length();
-    
+
     /** the prefix for Csn value */
     public static final String CSN_PREFIX = "csn=";
 
@@ -61,7 +61,7 @@ public final class LdapProtocolUtils
     /**
      * Extracts request controls from a request to populate into an
      * OperationContext.
-     *  
+     *
      * @param opContext the context to populate with request controls
      * @param request the request to extract controls from
      */
@@ -76,9 +76,9 @@ public final class LdapProtocolUtils
 
 
     /**
-     * Extracts response controls from a an OperationContext to populate into 
+     * Extracts response controls from a an OperationContext to populate into
      * a Response object.
-     *  
+     *
      * @param opContext the context to extract controls from
      * @param response the response to populate with response controls
      */
@@ -100,7 +100,7 @@ public final class LdapProtocolUtils
     /**
      * Check the cookie syntax. A cookie must have the following syntax :
      * { rid={replicaId},csn={CSN} }
-     * 
+     *
      * @param cookieString The cookie
      * @return <tt>true</tt> if the cookie is valid
      */
@@ -145,7 +145,7 @@ public final class LdapProtocolUtils
 
     /**
      * returns the CSN present in cookie
-     * 
+     *
      * @param cookieString the cookie
      * @return The CSN
      */
@@ -158,7 +158,7 @@ public final class LdapProtocolUtils
 
     /**
      * returns the replica id present in cookie
-     * 
+     *
      * @param cookieString  the cookie
      * @return The replica Id
      */
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
index 4b1c66a..92f0e37 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
@@ -6,21 +6,21 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.ldap.handlers;
 
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
 import org.apache.directory.api.ldap.model.exception.LdapOperationException;
 import org.apache.directory.api.ldap.model.exception.LdapReferralException;
@@ -83,16 +83,16 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
 
     /**
-     * Checks to see if confidentiality requirements are met.  If the 
+     * Checks to see if confidentiality requirements are met.  If the
      * LdapServer requires confidentiality and the SSLFilter is engaged
-     * this will return true.  If confidentiality is not required this 
+     * this will return true.  If confidentiality is not required this
      * will return true.  If confidentially is required and the SSLFilter
      * is not engaged in the IoFilterChain this will return false.
-     * 
+     *
      * This method is used by handlers to determine whether to send back
      * {@link ResultCodeEnum#CONFIDENTIALITY_REQUIRED} error responses back
      * to clients.
-     * 
+     *
      * @param session the MINA IoSession to check for TLS security
      * @return true if confidentiality requirement is met, false otherwise
      */
@@ -119,8 +119,9 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
 
     /**
-     *{@inheritDoc} 
+     *{@inheritDoc}
      */
+    @Override
     public final void handleMessage( IoSession session, T message ) throws Exception
     {
         LdapSession ldapSession = ldapServer.getLdapSessionManager().getLdapSession( session );
@@ -137,7 +138,7 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
         // was a SASL BindRequest
         if ( ldapSession.isAuthPending() )
         {
-            // Only SASL BinRequest are allowed if we already are handling a 
+            // Only SASL BinRequest are allowed if we already are handling a
             // SASL BindRequest
             if ( !( message instanceof BindRequest ) || ( ( BindRequest ) message ).isSimple()
                 || ldapSession.isSimpleAuthPending() )
@@ -152,17 +153,17 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
             }
         }
 
-        // TODO - session you get from LdapServer should have the ldapServer 
+        // TODO - session you get from LdapServer should have the ldapServer
         // member already set no?  Should remove these lines where ever they
         // may be if that's the case.
         ldapSession.setLdapServer( ldapServer );
 
-        // protect against insecure conns when confidentiality is required 
+        // protect against insecure conns when confidentiality is required
         if ( !isConfidentialityRequirementSatisfied( session ) )
         {
             if ( message instanceof ExtendedRequest )
             {
-                // Reject all extended operations except StartTls  
+                // Reject all extended operations except StartTls
                 ExtendedRequest req = ( ExtendedRequest ) message;
 
                 if ( !req.getRequestName().equals( StartTlsHandler.EXTENSION_OID ) )
@@ -175,7 +176,7 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
             }
             else if ( message instanceof ResultResponseRequest )
             {
-                // Reject all other operations that have a result response  
+                // Reject all other operations that have a result response
                 rejectWithoutConfidentiality( session, ( ( ResultResponseRequest ) message )
                     .getResultResponse() );
                 return;
@@ -198,7 +199,7 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
             CoreSession coreSession = null;
 
             /*
-             * All requests except bind automatically presume the authentication 
+             * All requests except bind automatically presume the authentication
              * is anonymous if the session has not been authenticated.  Hence a
              * default bind is presumed as the anonymous identity.
              */
@@ -227,7 +228,7 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
     /**
      * Handle a Ldap message associated with a session
-     * 
+     *
      * @param session The associated session
      * @param message The message we have to handle
      * @throws Exception If there is an error during the processing of this message
@@ -237,10 +238,10 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
     /**
      * Handles processing with referrals without ManageDsaIT decorator.
-     * 
+     *
      * @param session The associated session
      * @param req The response
-     * @param e The associated exception 
+     * @param e The associated exception
      */
     public void handleException( LdapSession session, ResultResponseRequest request, ResultResponse response, Exception e )
     {
@@ -264,7 +265,7 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
         /*
          * Setup the error message to put into the request and put entire
-         * exception into the message if we are in debug mode.  Note we 
+         * exception into the message if we are in debug mode.  Note we
          * embed the result code name into the message.
          */
         String msg = code.toString() + ": failed for " + request + ": " + e.getLocalizedMessage();
@@ -309,8 +310,8 @@ public abstract class LdapRequestHandler<T extends Request> implements MessageHa
 
         session.getIoSession().write( response );
     }
-    
-    
+
+
     /**
      * @return The LDAP API Codec service
      */
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java
index 13a4ce4..ffe92c2 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.ldap.handlers.extended;
 
@@ -27,7 +27,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.lang.SerializationUtils;
+import org.apache.commons.lang3.SerializationUtils;
 import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
 import org.apache.directory.api.ldap.extras.extended.storedProcedure.StoredProcedureRequest;
 import org.apache.directory.api.ldap.extras.extended.storedProcedure.StoredProcedureResponse;
@@ -45,7 +45,7 @@ import org.apache.directory.server.ldap.LdapSession;
 
 /**
  * A Handler for the StoredProcedure extended operation
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class StoredProcedureExtendedOperationHandler implements
@@ -68,6 +68,7 @@ public class StoredProcedureExtendedOperationHandler implements
     }
 
 
+    @Override
     public void handleExtendedOperation( LdapSession session, StoredProcedureRequest req ) throws Exception
     {
         String procedure = req.getProcedureSpecification();
@@ -103,6 +104,7 @@ public class StoredProcedureExtendedOperationHandler implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getOid()
     {
         return StoredProcedureRequest.EXTENSION_OID;
@@ -122,6 +124,7 @@ public class StoredProcedureExtendedOperationHandler implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public Set<String> getExtensionOids()
     {
         return EXTENSION_OIDS;
@@ -131,6 +134,7 @@ public class StoredProcedureExtendedOperationHandler implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setLdapServer( LdapServer ldapServer )
     {
     }
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
index 599fbcc..9b3d009 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.ldap.handlers.request;
 
@@ -25,7 +25,7 @@ import java.util.Map;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.codec.decorators.BindResponseDecorator;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Entry;
@@ -72,7 +72,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
 
     /**
      * Set the mechanisms handler map.
-     * 
+     *
      * @param handlers The associations btween a machanism and its handler
      */
     public void setSaslMechanismHandlers( Map<String, MechanismHandler> handlers )
@@ -107,17 +107,17 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
 
         // Now, bind the user
 
-        // create a new Bind context, with a null session, as we don't have 
+        // create a new Bind context, with a null session, as we don't have
         // any context yet.
         BindOperationContext bindContext = new BindOperationContext( null );
 
         // Stores the Dn of the user to check, and its password
         Dn bindDn = bindRequest.getDn();
-        
+
         if ( bindDn == null )
         {
             String name = bindRequest.getName();
-            
+
             try
             {
                 bindDn = new Dn( directoryService.getSchemaManager(), name );
@@ -129,7 +129,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
                 LOG.debug( "Unable to convert the name to a DN." );
             }
         }
-        
+
         bindContext.setDn( bindRequest.getDn() );
         bindContext.setCredentials( bindRequest.getCredentials() );
         bindContext.setIoSession( ldapSession.getIoSession() );
@@ -142,18 +142,18 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
         {
             /*
              * Referral handling as specified by RFC 3296 here:
-             *    
+             *
              *      http://www.faqs.org/rfcs/rfc3296.html
-             *      
+             *
              * See section 5.6.1 where if the bind principal Dn is a referral
              * we return an invalidCredentials result response.  Optionally we
              * could support delegated authentication in the future with this
              * potential.  See the following JIRA for more on this possibility:
-             * 
+             *
              *      https://issues.apache.org/jira/browse/DIRSERVER-1217
-             *      
-             * NOTE: if this is done then this handler should extend the 
-             * a modified form of the ReferralAwareRequestHandler so it can 
+             *
+             * NOTE: if this is done then this handler should extend the
+             * a modified form of the ReferralAwareRequestHandler so it can
              * detect conditions where ancestors of the Dn are referrals
              * and delegate appropriately.
              */
@@ -190,8 +190,8 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
                 return;
             }
 
-            // TODO - might cause issues since lookups are not returning all 
-            // attributes right now - this is an optimization that can be 
+            // TODO - might cause issues since lookups are not returning all
+            // attributes right now - this is an optimization that can be
             // enabled later after determining whether or not this will cause
             // issues.
             // reuse the looked up entry so we don't incur another lookup
@@ -225,7 +225,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
         catch ( Exception e )
         {
             // Something went wrong. Write back an error message
-            // For BindRequest, it should be an InvalidCredentials, 
+            // For BindRequest, it should be an InvalidCredentials,
             // no matter what kind of exception we got.
             ResultCodeEnum code = null;
             LdapResult result = bindResponse.getLdapResult();
@@ -308,7 +308,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
 
 
     /**
-     * For challenge/response exchange, generate the challenge. 
+     * For challenge/response exchange, generate the challenge.
      * If the exchange is complete then send bind success.
      *
      * @param ldapSession
@@ -363,7 +363,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
                     CoreSession userSession = ds.getSession( ldapPrincipal.getDn(),
                         password, saslMechanism, null );
 
-                    // Set the user session into the ldap session 
+                    // Set the user session into the ldap session
                     ldapSession.setCoreSession( userSession );
 
                     // Store the IoSession in the coreSession
@@ -414,7 +414,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
     private void sendAuthMethNotSupported( LdapSession ldapSession, BindRequest bindRequest )
     {
         BindResponse bindResponse = ( BindResponse ) bindRequest.getResultResponse();
-        
+
         // First, re-init the state to Anonymous, and clear the
         // saslProperty map
         ldapSession.clearSaslProperties();
@@ -433,7 +433,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
 
     /**
      * Send back an INVALID-CREDENTIAL error message to the user. If we have an exception
-     * as a third argument, then send back the associated message to the client. 
+     * as a third argument, then send back the associated message to the client.
      */
     private void sendInvalidCredentials( LdapSession ldapSession, BindResponse bindResponse, Exception e )
     {
@@ -541,7 +541,7 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
      * <li>The user already has a session</li>
      * <li>The user has started a SASL negotiation</li>
      * </ul>
-     * 
+     *
      * In the first case, we initiate a SaslBind session, which will be used all
      * along the negotiation.<br>
      * In the second case, we first have to unbind the user, and initiate a new
@@ -626,11 +626,12 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
 
     /**
      * Deal with a received BindRequest
-     * 
+     *
      * @param ldapSession The current session
      * @param bindRequest The received BindRequest
      * @throws Exception If the authentication cannot be handled
      */
+    @Override
     public void handle( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
     {
         LOG.debug( "Received: {}", bindRequest );
@@ -639,13 +640,13 @@ public class BindRequestHandler extends LdapRequestHandler<BindRequest>
         if ( !bindRequest.getVersion3() )
         {
             BindResponse bindResponse = ( BindResponse ) bindRequest.getResultResponse();
-            
+
             LOG.error( I18n.err( I18n.ERR_162 ) );
             LdapResult bindResult = bindResponse.getLdapResult();
             bindResult.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
             bindResult.setDiagnosticMessage( I18n.err( I18n.ERR_163 ) );
             ldapSession.getIoSession().write( new BindResponseDecorator( getLdapApiService(), bindResponse ) );
-            
+
             return;
         }
 
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/ExtendedRequestHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/ExtendedRequestHandler.java
index 67c43f7..d3a6b67 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/ExtendedRequestHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/ExtendedRequestHandler.java
@@ -6,21 +6,21 @@
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
-*  
+*
 *    http://www.apache.org/licenses/LICENSE-2.0
-*  
+*
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
-*  under the License. 
-*  
+*  under the License.
+*
 */
 package org.apache.directory.server.ldap.handlers.request;
 
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.model.message.ExtendedRequest;
 import org.apache.directory.api.ldap.model.message.ExtendedResponse;
 import org.apache.directory.api.ldap.model.message.LdapResult;
@@ -41,6 +41,7 @@ public class ExtendedRequestHandler<R extends ExtendedRequest> extends LdapReque
     /**
      * {@inheritDoc}
      */
+    @Override
     public void handle( LdapSession session, ExtendedRequest req ) throws Exception
     {
         ExtendedOperationHandler<ExtendedRequest, ExtendedResponse> handler =
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
index 448657b..f5d037b 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
@@ -28,7 +28,7 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.api.ldap.codec.decorators.SearchResultDoneDecorator;
 import org.apache.directory.api.ldap.codec.decorators.SearchResultEntryDecorator;
@@ -74,6 +74,7 @@ import org.apache.directory.server.core.api.ReferralManager;
 import org.apache.directory.server.core.api.entry.ClonedServerEntry;
 import org.apache.directory.server.core.api.event.EventType;
 import org.apache.directory.server.core.api.event.NotificationCriteria;
+import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.ldap.LdapSession;
@@ -98,7 +99,7 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
     private static final Logger LOG = LoggerFactory.getLogger( SearchRequestHandler.class );
 
     private static final Logger SEARCH_TIME_LOG = LoggerFactory.getLogger( "org.apache.directory.server.ldap.handlers.request.SEARCH_TIME_LOG" );
-    
+
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
@@ -146,7 +147,7 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
             if ( done.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )
             {
                 session.getIoSession().write( new SearchResultDoneDecorator( getLdapApiService(), done ) );
-                
+
                 return;
             }
         }
@@ -176,6 +177,7 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
     /**
      * {@inheritDoc}
      */
+    @Override
     public final void handle( LdapSession session, SearchRequest req ) throws Exception
     {
         if ( IS_DEBUG )
@@ -224,7 +226,7 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
     private void handleReplication( LdapSession session, SearchRequest searchRequest ) throws LdapException
     {
         SearchResultDone done = ( SearchResultDone ) searchRequest.getResultResponse();
-        
+
         if ( replicationReqHandler != null )
         {
             replicationReqHandler.handleSyncRequest( session, searchRequest );
@@ -470,7 +472,7 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
 
         boolean hasMoreEntry = cursor.next();
 
-        // We have some entry, move back to the first one, as we just moved forward 
+        // We have some entry, move back to the first one, as we just moved forward
         // to get the first entry
         if ( hasMoreEntry )
         {
@@ -1138,19 +1140,19 @@ public class SearchRequestHandler extends LdapRequestHandler<SearchRequest>
             // ===============================================================
 
             boolean isLogSearchTime = SEARCH_TIME_LOG.isDebugEnabled();
-            
+
             long t0 = 0;
             String filter = null;
-            
+
             if ( isLogSearchTime )
             {
                 t0 = System.nanoTime();
                 filter = req.getFilter().toString();
             }
-            
+
             SearchResultDone done = doSimpleSearch( session, req );
             session.getIoSession().write( new SearchResultDoneDecorator( getLdapApiService(), done ) );
-            
+
             if ( isLogSearchTime )
             {
                 long t1 = System.nanoTime();
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/AbstractSaslCallbackHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/AbstractSaslCallbackHandler.java
index a4de00c..673d2d8 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/AbstractSaslCallbackHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/AbstractSaslCallbackHandler.java
@@ -32,7 +32,7 @@ import javax.security.auth.callback.PasswordCallback;
 import javax.security.sasl.AuthorizeCallback;
 import javax.security.sasl.RealmCallback;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.api.ldap.model.entry.Attribute;
 import org.apache.directory.api.ldap.model.exception.LdapOperationException;
@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Base class for all SASL {@link CallbackHandler}s.  Implementations of SASL mechanisms
  * selectively override the methods relevant to their mechanism.
- * 
+ *
  * @see javax.security.auth.callback.CallbackHandler
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -101,7 +101,7 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
      * Implementors use this method to access the username resulting from a callback.
      * Callback default name will be username, eg 'hnelson', for CRAM-MD5 and DIGEST-MD5.
      * The {@link NameCallback} is not used by GSSAPI.
-     * 
+     *
      * @return The user name
      */
     protected String getUsername()
@@ -114,7 +114,7 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
      * Implementors use this method to access the realm resulting from a callback.
      * Callback default text will be realm name, eg 'example.com', for DIGEST-MD5.
      * The {@link RealmCallback} is not used by GSSAPI nor by CRAM-MD5.
-     * 
+     *
      * @return The realm
      */
     protected String getRealm()
@@ -141,10 +141,10 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
     /**
      * Final check to authorize user.  Used by all SASL mechanisms.  This
      * is the only callback used by GSSAPI.
-     * 
+     *
      * Implementors use setAuthorizedID() to set the base Dn after canonicalization.
      * Implementors must setAuthorized() to <code>true</code> if authentication was successful.
-     * 
+     *
      * @param callback An {@link AuthorizeCallback}.
      * @throws Exception If the authorization failed
      */
@@ -154,9 +154,10 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
     /**
      * SaslServer will use this method to call various callbacks, depending on the SASL
      * mechanism in use for a session.
-     * 
+     *
      * @param callbacks An array of one or more callbacks.
      */
+    @Override
     public void handle( Callback[] callbacks )
     {
         for ( int i = 0; i < callbacks.length; i++ )
@@ -231,7 +232,7 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
     /**
      * Convenience method for acquiring an {@link LdapContext} for the client to use for the
      * duration of a session.
-     * 
+     *
      * @param session The current session.
      * @param bindRequest The current BindRequest.
      * @param env An environment to be used to acquire an {@link LdapContext}.
@@ -294,7 +295,7 @@ public abstract class AbstractSaslCallbackHandler implements CallbackHandler
     /**
      * Convenience method for getting an environment suitable for acquiring
      * an {@link LdapContext} for the client.
-     * 
+     *
      * @param session The current session.
      * @return An environment suitable for acquiring an {@link LdapContext} for the client.
      */
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/SimpleMechanismHandler.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/SimpleMechanismHandler.java
index 76c77d0..320f21f 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/SimpleMechanismHandler.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/sasl/SimpleMechanismHandler.java
@@ -6,23 +6,23 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.ldap.handlers.sasl;
 
 
 import javax.security.sasl.SaslServer;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.exception.LdapOperationException;
@@ -52,9 +52,10 @@ public class SimpleMechanismHandler implements MechanismHandler
     private static final Logger LOG = LoggerFactory.getLogger( SimpleMechanismHandler.class );
 
 
+    @Override
     public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
     {
-        // create a new Bind context, with a null session, as we don't have 
+        // create a new Bind context, with a null session, as we don't have
         // any context yet.
         BindOperationContext bindContext = new BindOperationContext( null );
 
@@ -88,7 +89,7 @@ public class SimpleMechanismHandler implements MechanismHandler
         }
         catch ( LdapException e )
         {
-            // Something went wrong. Write back an error message            
+            // Something went wrong. Write back an error message
             ResultCodeEnum code = null;
             LdapResult result = bindRequest.getResultResponse().getLdapResult();
 
@@ -136,6 +137,7 @@ public class SimpleMechanismHandler implements MechanismHandler
     /**
      * {@inheritDoc}
      */
+    @Override
     public void init( LdapSession ldapSession )
     {
         // Do nothing
@@ -145,6 +147,7 @@ public class SimpleMechanismHandler implements MechanismHandler
     /**
      * {@inheritDoc}
      */
+    @Override
     public void cleanup( LdapSession ldapSession )
     {
         ldapSession.clearSaslProperties();
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
index fa3a4a5..cb02982 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
@@ -26,7 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.collections4.map.LRUMap;
 import org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITDecorator;
 import org.apache.directory.api.ldap.extras.controls.SynchronizationModeEnum;
 import org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValue;
@@ -170,6 +170,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * @return the config
      */
+    @Override
     public SyncReplConfiguration getConfig()
     {
         return config;
@@ -180,6 +181,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
      * Init the replication service
      * @param directoryservice The directory service
      */
+    @Override
     public void init( DirectoryService directoryservice ) throws Exception
     {
         this.directoryService = directoryservice;
@@ -506,7 +508,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
                     CONSUMER_LOG.debug( "setting the cookie from the sync info: {}", Strings.utf8ToString( cookie ) );
                     CONSUMER_LOG.debug( "setting the cookie from the sync info: {}", Strings.utf8ToString( cookie ) );
                 }
-                
+
                 syncCookie = cookie;
 
                 String cookieString = Strings.utf8ToString( syncCookie );
@@ -544,6 +546,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public void connectionClosed()
     {
         if ( CONSUMER_LOG.isDebugEnabled() )
@@ -560,6 +563,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * Starts the synchronization operation
      */
+    @Override
     public ReplicationStatusEnum startSync()
     {
         CONSUMER_LOG.debug( "Starting the SyncRepl process for consumer {}", config.getReplicaId() );
@@ -624,6 +628,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setConfig( ReplicationConsumerConfig config )
     {
         this.config = ( SyncReplConfiguration ) config;
@@ -633,6 +638,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean connect( boolean now )
     {
         boolean connected = false;
@@ -671,6 +677,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public void ping()
     {
         boolean connected = !disconnected;
@@ -705,6 +712,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public void stop()
     {
         if ( !disconnected )
@@ -717,6 +725,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getId()
     {
         return String.valueOf( getConfig().getReplicaId() );
@@ -1090,7 +1099,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
             // If the parentDn are equals, it's a RENAME
             CONSUMER_LOG.debug( "renaming the Dn {} with new Rdn {} and deleteOldRdn flag set to {}",
                 localDn.getName(), remoteRdn.getName(), String.valueOf( deleteOldRdn ) );
-            
+
             RenameOperationContext renCtx = new RenameOperationContext( session, localDn, remoteRdn,
                 deleteOldRdn );
             renCtx.setReplEvent( true );
@@ -1106,7 +1115,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
                 remoteParentDn.getName(),
                 remoteRdn.getName(),
                 String.valueOf( deleteOldRdn ) );
-            
+
             MoveAndRenameOperationContext movRenCtx = new MoveAndRenameOperationContext( session, localDn,
                 remoteParentDn, remoteRdn, deleteOldRdn );
             movRenCtx.setReplEvent( true );
@@ -1126,9 +1135,9 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
         lookupCtx.setSyncreplLookup( true );
 
         Entry localEntry;
-        
+
         Partition partition = session.getDirectoryService().getPartitionNexus().getPartition( remoteEntry.getDn() );
-        
+
         try ( PartitionTxn partitionTxn = partition.beginReadTransaction() )
         {
             lookupCtx.setTransaction( partitionTxn );
@@ -1370,7 +1379,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
             ctx.setReplEvent( true );
             ctx.setRid( replicaId );
 
-            // DO NOT generate replication event if this is being deleted as part of 
+            // DO NOT generate replication event if this is being deleted as part of
             // e_sync_refresh_required
             if ( reload )
             {
@@ -1401,7 +1410,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
 
     /**
      * removes all child entries present under the given Dn and finally the Dn itself
-     * 
+     *
      * @param rootDn the Dn which will be removed after removing its children
      * @param rid the replica ID
      * @throws Exception If the Dn is not valid or if the deletion failed
@@ -1440,7 +1449,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
                 ctx.setReplEvent( true );
                 ctx.setRid( rid );
 
-                // DO NOT generate replication event if this is being deleted as part of 
+                // DO NOT generate replication event if this is being deleted as part of
                 // e_sync_refresh_required
                 if ( reload )
                 {
@@ -1471,6 +1480,7 @@ public class ReplicationConsumerImpl implements ConnectionClosedEventListener, R
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
diff --git a/server-integ/pom.xml b/server-integ/pom.xml
index fa9ed8f..2e73fd8 100644
--- a/server-integ/pom.xml
+++ b/server-integ/pom.xml
@@ -159,12 +159,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <scope>test</scope>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-codec-standalone</artifactId>
       <scope>test</scope>
diff --git a/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java b/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
index 84e555f..fb6fb82 100644
--- a/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
+++ b/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
  *  under the License.
- * 
+ *
  */
 package org.apache.directory.server.operations.bind;
 
@@ -29,6 +29,7 @@ import static org.junit.Assert.fail;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
+import java.util.Objects;
 
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
@@ -43,11 +44,6 @@ import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 
-import netscape.ldap.LDAPConnection;
-import netscape.ldap.LDAPException;
-import netscape.ldap.LDAPUrl;
-
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.api.asn1.util.Asn1StringUtils;
 import org.apache.directory.api.ldap.model.constants.SupportedSaslMechanisms;
 import org.apache.directory.api.ldap.model.message.Control;
@@ -74,6 +70,10 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import netscape.ldap.LDAPConnection;
+import netscape.ldap.LDAPException;
+import netscape.ldap.LDAPUrl;
+
 
 /**
  * A set of miscellaneous tests.
@@ -396,7 +396,7 @@ public class MiscBindIT extends AbstractLdapTestUnit
 
         DirContext kate = ctx.createSubcontext( "cn=Kate Bush", user );
         assertNotNull( kate );
-        assertTrue( ArrayUtils.isEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes( "" ).get(
+        assertTrue( Objects.deepEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes( "" ).get(
             "userPassword" ).get() ) );
 
         ctx.destroySubcontext( "cn=Kate Bush" );
diff --git a/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java b/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
index 0d825de..6b47063 100644
--- a/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
+++ b/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.fail;
 
 import java.lang.reflect.Field;
 import java.nio.ByteBuffer;
+import java.util.Objects;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
@@ -33,7 +34,6 @@ import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.net.SocketClient;
 import org.apache.directory.api.ldap.codec.api.AbstractMessageDecorator;
 import org.apache.directory.api.ldap.codec.api.LdapDecoder;
@@ -573,13 +573,13 @@ public class SaslBindIT extends AbstractLdapTestUnit
         BindResponse type2response = client.bindType1( "type1_test".getBytes() );
         assertEquals( 1, type2response.getMessageId() );
         assertEquals( ResultCodeEnum.SASL_BIND_IN_PROGRESS, type2response.getLdapResult().getResultCode() );
-        assertTrue( ArrayUtils.isEquals( "type1_test".getBytes(), provider.getType1Response() ) );
-        assertTrue( ArrayUtils.isEquals( "challenge".getBytes(), type2response.getServerSaslCreds() ) );
+        assertTrue( Objects.deepEquals( "type1_test".getBytes(), provider.getType1Response() ) );
+        assertTrue( Objects.deepEquals( "challenge".getBytes(), type2response.getServerSaslCreds() ) );
 
         BindResponse finalResponse = client.bindType3( "type3_test".getBytes() );
         assertEquals( 2, finalResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, finalResponse.getLdapResult().getResultCode() );
-        assertTrue( ArrayUtils.isEquals( "type3_test".getBytes(), provider.getType3Response() ) );
+        assertTrue( Objects.deepEquals( "type3_test".getBytes(), provider.getType3Response() ) );
     }
 
 
@@ -602,13 +602,13 @@ public class SaslBindIT extends AbstractLdapTestUnit
         BindResponse type2response = client.bindType1( "type1_test".getBytes() );
         assertEquals( 1, type2response.getMessageId() );
         assertEquals( ResultCodeEnum.SASL_BIND_IN_PROGRESS, type2response.getLdapResult().getResultCode() );
-        assertTrue( ArrayUtils.isEquals( "type1_test".getBytes(), provider.getType1Response() ) );
-        assertTrue( ArrayUtils.isEquals( "challenge".getBytes(), type2response.getServerSaslCreds() ) );
+        assertTrue( Objects.deepEquals( "type1_test".getBytes(), provider.getType1Response() ) );
+        assertTrue( Objects.deepEquals( "challenge".getBytes(), type2response.getServerSaslCreds() ) );
 
         BindResponse finalResponse = client.bindType3( "type3_test".getBytes() );
         assertEquals( 2, finalResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, finalResponse.getLdapResult().getResultCode() );
-        assertTrue( ArrayUtils.isEquals( "type3_test".getBytes(), provider.getType3Response() ) );
+        assertTrue( Objects.deepEquals( "type3_test".getBytes(), provider.getType3Response() ) );
     }
 
 
diff --git a/server-jndi/pom.xml b/server-jndi/pom.xml
index 79c7963..da85b71 100644
--- a/server-jndi/pom.xml
+++ b/server-jndi/pom.xml
@@ -71,8 +71,8 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
     </dependency>
 
     <dependency>
@@ -141,7 +141,7 @@
                 org.apache.directory.server.configuration;version=${project.version}
             </Export-Package>
             <Import-Package>
-                org.apache.commons.lang;version=${commons.lang.version},
+                org.apache.commons.lang3;version=${commons.lang.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.entry;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.name;version=${org.apache.directory.api.version},
diff --git a/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java b/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
index f304b3a..b42c0c6 100644
--- a/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
+++ b/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
@@ -29,7 +29,9 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.lang.StringUtils;
+import javax.naming.NamingException;
+
+import org.apache.commons.lang3.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapException;
@@ -88,7 +90,7 @@ public class ApacheDS
 
     /**
      * Creates a new instance of the ApacheDS server
-     * 
+     *
      * @param ldapServer The ldap server protocol handler
      * @throws LdapException If we can't create teh ApacheDS instance
      */
@@ -114,7 +116,7 @@ public class ApacheDS
      *  <li>start the LDAP server</li>
      *  <li>start the LDAPS server</li>
      * </ul>
-     * 
+     *
      * @throws Exception If the server cannot be started
      */
     public void startup() throws Exception
@@ -230,7 +232,7 @@ public class ApacheDS
 
     /**
      * Get the directory where the LDIF files are stored
-     * 
+     *
      * @return The directory where the LDIF files are stored
      */
     public File getLdifDirectory()
@@ -255,9 +257,9 @@ public class ApacheDS
 
     /**
      * Check that the entry where are stored the loaded Ldif files is created.
-     * 
+     *
      * If not, create it.
-     * 
+     *
      * The files are stored in ou=loadedLdifFiles,ou=configuration,ou=system
      */
     private void ensureLdifFileBase() throws LdapException
@@ -287,7 +289,7 @@ public class ApacheDS
 
     /**
      * Create a string containing a hex dump of the loaded ldif file name.
-     * 
+     *
      * It is associated with the attributeType wrt to the underlying system.
      */
     private Dn buildProtectedFileEntryDn( File ldif ) throws Exception
@@ -340,13 +342,11 @@ public class ApacheDS
 
     /**
      * Load a ldif into the directory.
-     * 
+     *
      * @param root The context in which we will inject the entries
      * @param ldifFile The ldif file to read
      * @throws NamingException If something went wrong while loading the entries
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     private void loadLdif( File ldifFile ) throws Exception
     {
         Entry fileEntry = null;
@@ -378,7 +378,7 @@ public class ApacheDS
 
     /**
      * Load the existing LDIF files in alphabetic order
-     * 
+     *
      * @throws LdapException If we can't load the ldifs
      */
     public void loadLdifs() throws LdapException
@@ -426,6 +426,7 @@ public class ApacheDS
             // get all the ldif files within the directory
             File[] ldifFiles = ldifDirectory.listFiles( new FileFilter()
             {
+                @Override
                 public boolean accept( File pathname )
                 {
                     boolean isLdif = Strings.toLowerCaseAscii( pathname.getName() ).endsWith( ".ldif" );
@@ -444,6 +445,7 @@ public class ApacheDS
             // Sort ldifFiles in alphabetic order
             Arrays.sort( ldifFiles, new Comparator<File>()
             {
+                @Override
                 public int compare( File f1, File f2 )
                 {
                     return f1.getName().compareTo( f2.getName() );
@@ -472,7 +474,7 @@ public class ApacheDS
 
     /**
      * initialize the schema partition by loading the schema LDIF files
-     * 
+     *
      * @throws Exception in case of any problems while extracting and writing the schema files
      */
     private void initSchema() throws Exception
diff --git a/xdbm-partition/pom.xml b/xdbm-partition/pom.xml
index 48a54f7..9909a48 100644
--- a/xdbm-partition/pom.xml
+++ b/xdbm-partition/pom.xml
@@ -65,11 +65,6 @@
     </dependency>
     
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    
-    <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-model</artifactId>
     </dependency>
@@ -129,7 +124,6 @@
                 net.sf.ehcache;version=${ehcache.version},
                 net.sf.ehcache.config;version=${ehcache.version},
                 net.sf.ehcache.store;version=${ehcache.version},
-                org.apache.commons.collections;version=${commons.collections.version},
                 org.apache.directory.api.i18n;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.constants;version=${org.apache.directory.api.version},
                 org.apache.directory.api.ldap.model.cursor;version=${org.apache.directory.api.version},
diff --git a/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java b/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
index 91950d8..bd67f4d 100644
--- a/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
+++ b/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
@@ -6,23 +6,23 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.xdbm.search.cursor;
 
 
 import java.io.IOException;
+import java.util.ArrayDeque;
 
-import org.apache.commons.collections.ArrayStack;
 import org.apache.directory.api.ldap.model.constants.Loggers;
 import org.apache.directory.api.ldap.model.cursor.Cursor;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
@@ -69,10 +69,10 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     private String currentParentId;
 
     /** The stack of cursors used to process the depth-first traversal */
-    private ArrayStack cursorStack;
+    private ArrayDeque<Cursor> cursorStack;
 
     /** The stack of parentIds used to process the depth-first traversal */
-    private ArrayStack parentIdStack;
+    private ArrayDeque<String> parentIdStack;
 
     /** The initial entry ID we are looking descendants for */
     private String baseId;
@@ -110,14 +110,14 @@ public class DescendantCursor extends AbstractIndexCursor<String>
      * @param cursor The wrapped cursor
      * @param topLevel If we are at the top level
      */
-    public DescendantCursor( PartitionTxn partitionTxn, Store db, String baseId, String parentId, 
+    public DescendantCursor( PartitionTxn partitionTxn, Store db, String baseId, String parentId,
             Cursor<IndexEntry<ParentIdAndRdn, String>> cursor, boolean topLevel )
     {
         this.db = db;
         currentParentId = parentId;
         currentCursor = cursor;
-        cursorStack = new ArrayStack();
-        parentIdStack = new ArrayStack();
+        cursorStack = new ArrayDeque();
+        parentIdStack = new ArrayDeque();
         this.baseId = baseId;
         this.topLevel = topLevel;
         this.partitionTxn = partitionTxn;
@@ -132,6 +132,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     protected String getUnsupportedMessage()
     {
         return UNSUPPORTED_MSG;
@@ -141,6 +142,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     public void beforeFirst() throws LdapException, CursorException
     {
         checkNotClosed();
@@ -151,6 +153,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     public void afterLast() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
@@ -160,6 +163,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean first() throws LdapException, CursorException
     {
         beforeFirst();
@@ -171,6 +175,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean last() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
@@ -216,8 +221,8 @@ public class DescendantCursor extends AbstractIndexCursor<String>
             boolean hasNext = currentCursor.next();
 
             // We will use a depth first approach. The alternative (Breadth-first) would be
-            // too memory consuming. 
-            // The idea is to use a ChildrenCursor each time we have an entry with chidren, 
+            // too memory consuming.
+            // The idea is to use a ChildrenCursor each time we have an entry with chidren,
             // and process recursively.
             if ( hasNext )
             {
@@ -241,8 +246,8 @@ public class DescendantCursor extends AbstractIndexCursor<String>
                             throw new LdapException( ioe.getMessage(), ioe );
                         }
 
-                        currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn, String>> ) cursorStack.pop();
-                        currentParentId = ( String ) parentIdStack.pop();
+                        currentCursor = cursorStack.pop();
+                        currentParentId = parentIdStack.pop();
                     }
 
                     // And continue...
@@ -299,8 +304,8 @@ public class DescendantCursor extends AbstractIndexCursor<String>
                         throw new LdapException( ioe.getMessage(), ioe );
                     }
 
-                    currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn, String>> ) cursorStack.pop();
-                    currentParentId = ( String ) parentIdStack.pop();
+                    currentCursor = cursorStack.pop();
+                    currentParentId = parentIdStack.pop();
                 }
                 // and continue...
             }
@@ -313,6 +318,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * {@inheritDoc}
      */
+    @Override
     public IndexEntry<String, String> get() throws CursorException
     {
         checkNotClosed();
@@ -423,6 +429,7 @@ public class DescendantCursor extends AbstractIndexCursor<String>
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         return toString( "" );


Mime
View raw message