You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/03/07 15:43:10 UTC

[commons-pool] branch master updated (69b2b4d8 -> f9b2049b)

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

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


    from 69b2b4d8 More precise measurements
     new dab28c75 Fomrat method
     new f9b2049b Better test failure message

The 2 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.


Summary of changes:
 pom.xml                                                            | 6 ++++++
 .../java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java  | 7 +++----
 .../org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java  | 3 ++-
 3 files changed, 11 insertions(+), 5 deletions(-)


[commons-pool] 02/02: Better test failure message

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

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

commit f9b2049b5bf37015005392a442f74acbacd0deae
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Mar 7 10:43:05 2023 -0500

    Better test failure message
---
 pom.xml                                                             | 6 ++++++
 .../org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java   | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e25ea42d..26583fc4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,6 +157,12 @@
       <version>2.2</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.12.0</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <distributionManagement>
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
index 3994c219..dbd28c28 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
@@ -55,6 +55,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.commons.pool2.BaseKeyedPooledObjectFactory;
 import org.apache.commons.pool2.DestroyMode;
 import org.apache.commons.pool2.KeyedObjectPool;
@@ -1002,7 +1003,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool {
                 Waiter.sleepQuietly(500L);
             }
             if (threads[i].failed()) {
-                fail("Thread " + i + " failed: " + threads[i].exception.toString());
+                fail("Thread " + i + " failed: " + ExceptionUtils.getStackTrace(threads[i].exception));
             }
         }
     }


[commons-pool] 01/02: Fomrat method

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

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

commit dab28c75f14049fef7031ae3fb736585f8f0b472
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Mar 7 10:22:23 2023 -0500

    Fomrat method
---
 .../java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
index 8bef3bc1..d567b3b6 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
@@ -143,8 +143,7 @@ public abstract class BaseGenericObjectPool<T, E extends Exception> extends Base
          */
         @Override
         public void run() {
-            final ClassLoader savedClassLoader =
-                    Thread.currentThread().getContextClassLoader();
+            final ClassLoader savedClassLoader = Thread.currentThread().getContextClassLoader();
             try {
                 if (factoryClassLoader != null) {
                     // Set the class loader for the factory
@@ -162,9 +161,9 @@ public abstract class BaseGenericObjectPool<T, E extends Exception> extends Base
                 // Evict from the pool
                 try {
                     evict();
-                } catch(final Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
-                } catch(final OutOfMemoryError oome) {
+                } catch (final OutOfMemoryError oome) {
                     // Log problem but give evictor thread a chance to continue
                     // in case error is recoverable
                     oome.printStackTrace(System.err);