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

ggregory pushed a commit to branch POOL_2_X
in repository https://gitbox.apache.org/repos/asf/commons-pool.git


The following commit(s) were added to refs/heads/POOL_2_X by this push:
     new eb44c26b Can't make DefaultPooledObjectInfo.getPooledObject() public 
here.
eb44c26b is described below

commit eb44c26b9dff4118fbfbdc699b8dec3c3512f31a
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Jan 20 22:29:16 2026 +0000

    Can't make DefaultPooledObjectInfo.getPooledObject() public here.
---
 .../org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java    | 2 +-
 .../org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java  | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java 
b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java
index c4dae41d..0b5f714c 100644
--- a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java
+++ b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java
@@ -93,7 +93,7 @@ public class DefaultPooledObjectInfo implements 
DefaultPooledObjectInfoMBean {
      * @return the pooled object for debugging, use at your own risk, changing 
the state of this object may have unintended consequences for the pool.
      * @since 2.14.0
      */
-    public PooledObject<?> getPooledObject() {
+    PooledObject<?> getPooledObject() {
         return pooledObject;
     }
 
diff --git 
a/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java 
b/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
index 6d97df93..4acffa20 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
@@ -19,6 +19,7 @@ package org.apache.commons.pool2.impl;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.lang.management.ManagementFactory;
@@ -219,8 +220,7 @@ class TestBaseGenericObjectPool {
     }
 
     /**
-     * POOL-393
-     * Tests JMX registration does not add too much latency to pool creation.
+     * POOL-393: Tests JMX registration does not add too much latency to pool 
creation.
      */
     @SuppressWarnings("resource") // pools closed in finally block
     @Test
@@ -232,7 +232,9 @@ class TestBaseGenericObjectPool {
         try {
             // final long startTime = System.currentTimeMillis();
             for (int i = 0; i < numPools; i++) {
-                pools.add(new GenericObjectPool<>(new WaiterFactory<>(0, 0, 0, 
0, 0, 0), new GenericObjectPoolConfig<>()));
+                final GenericObjectPool<Waiter> gop = new 
GenericObjectPool<>(new WaiterFactory<>(0, 0, 0, 0, 0, 0), new 
GenericObjectPoolConfig<>());
+                assertNotNull(gop.getJmxName());
+                pools.add(gop);
             }
             // System.out.println("Duration: " + (System.currentTimeMillis() - 
startTime));
             final ObjectName oname = pools.get(numPools - 1).getJmxName();

Reply via email to