You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2026/01/20 16:11:59 UTC

(directory-server) branch coheigea/deprecated-fixes created (now 255b118511)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch coheigea/deprecated-fixes
in repository https://gitbox.apache.org/repos/asf/directory-server.git


      at 255b118511 Fixing some deprecated warnings

This branch includes the following new commits:

     new 255b118511 Fixing some deprecated warnings

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(directory-server) 01/01: Fixing some deprecated warnings

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 255b11851155f6c6e7bf635b0f823260eaef4eea
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jan 20 16:11:27 2026 +0000

    Fixing some deprecated warnings
---
 .../server/core/factory/DirectoryServiceFactory.java    |  4 +---
 .../directory/server/core/schema/SchemaInterceptor.java |  6 +++---
 .../core/integ/CreateLdapConnectionPoolExtension.java   | 17 +++++++++--------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java b/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
index e536e2e6fd..b8d2ccf52d 100644
--- a/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
+++ b/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
@@ -18,8 +18,6 @@
  */
 package org.apache.directory.server.core.factory;
 
-
-import org.apache.commons.collections4.Factory;
 import org.apache.directory.server.core.api.DirectoryService;
 
 
@@ -55,7 +53,7 @@ public interface DirectoryServiceFactory
     /**
      * Gets the partition factory.
      * 
-     * @return the partition {@link Factory}
+     * @return the partition Factory
      * @throws Exception If the partition cannot be created
      */
     PartitionFactory getPartitionFactory() throws Exception;
diff --git a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
index e1c25d8b0f..eb2b7ebe60 100644
--- a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
+++ b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.schema;
 
 
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -29,7 +30,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.codec.Charsets;
 import org.apache.directory.api.ldap.model.constants.MetaSchemaConstants;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.EmptyCursor;
@@ -358,7 +358,7 @@ public class SchemaInterceptor extends BaseInterceptor
         {
             if ( !value.isHumanReadable() )
             {
-                return new Value( attributeType, new String( value.getBytes(), Charsets.UTF_8 ) );
+                return new Value( attributeType, new String( value.getBytes(), StandardCharsets.UTF_8 ) );
             }
         }
         else
@@ -1818,7 +1818,7 @@ public class SchemaInterceptor extends BaseInterceptor
             {
                 // we have a byte[] value. It should be a String UTF-8 encoded
                 // Let's transform it
-                String valStr = new String( value.getBytes(), Charsets.UTF_8 );
+                String valStr = new String( value.getBytes(), StandardCharsets.UTF_8 );
                 attribute.remove( value );
                 attribute.add( valStr );
                 isModified = true;
diff --git a/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java b/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java
index cc013a7f84..623b083cdb 100644
--- a/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java
+++ b/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java
@@ -23,6 +23,7 @@ import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
+import java.time.Duration;
 
 import org.apache.commons.pool2.PooledObjectFactory;
 import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
@@ -174,23 +175,23 @@ public class CreateLdapConnectionPoolExtension implements BeforeAllCallback, Aft
             config.setBinaryAttributeDetector( binaryAttributeDetector );
         }
 
-        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
+        GenericObjectPoolConfig<LdapConnection> poolConfig = new GenericObjectPoolConfig<>();
         poolConfig.setLifo( createLdapConnectionPool.lifo() );
         poolConfig.setMaxTotal( createLdapConnectionPool.maxActive() );
         poolConfig.setMaxIdle( createLdapConnectionPool.maxIdle() );
-        poolConfig.setMaxWaitMillis( createLdapConnectionPool.maxWait() );
-        poolConfig.setMinEvictableIdleTimeMillis( createLdapConnectionPool
-            .minEvictableIdleTimeMillis() );
+        poolConfig.setMaxWait( Duration.ofMillis( createLdapConnectionPool.maxWait() ) );
+        poolConfig.setMinEvictableIdleDuration( Duration.ofMillis( createLdapConnectionPool
+            .minEvictableIdleTimeMillis() ) );
         poolConfig.setMinIdle( createLdapConnectionPool.minIdle() );
         poolConfig.setNumTestsPerEvictionRun( createLdapConnectionPool
             .numTestsPerEvictionRun() );
-        poolConfig.setSoftMinEvictableIdleTimeMillis( createLdapConnectionPool
-            .softMinEvictableIdleTimeMillis() );
+        poolConfig.setSoftMinEvictableIdleDuration( Duration.ofMillis( createLdapConnectionPool
+            .softMinEvictableIdleTimeMillis() ) );
         poolConfig.setTestOnBorrow( createLdapConnectionPool.testOnBorrow() );
         poolConfig.setTestOnReturn( createLdapConnectionPool.testOnReturn() );
         poolConfig.setTestWhileIdle( createLdapConnectionPool.testWhileIdle() );
-        poolConfig.setTimeBetweenEvictionRunsMillis( createLdapConnectionPool
-            .timeBetweenEvictionRunsMillis() );
+        poolConfig.setTimeBetweenEvictionRuns( Duration.ofMillis( createLdapConnectionPool
+            .timeBetweenEvictionRunsMillis() ) );
         poolConfig.setBlockWhenExhausted( createLdapConnectionPool
             .whenExhaustedAction() == 1 );