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:22:58 UTC

(directory-server) branch master updated: Fixing some deprecated warnings (#296)

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

coheigea 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 078a6a113f Fixing some deprecated warnings (#296)
078a6a113f is described below

commit 078a6a113fecc6f1f6ea7d39d9416c36f810734c
Author: Colm O hEigeartaigh <co...@users.noreply.github.com>
AuthorDate: Tue Jan 20 16:22:52 2026 +0000

    Fixing some deprecated warnings (#296)
---
 .../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 );