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 2020/11/21 02:46:33 UTC

[commons-pool] branch master updated (ca822eb -> 6af7b0d)

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 ca822eb  Remove redundant calls to super().
     new e5f8532  Travis: Replace Java 14 with 15. One Java 11 build.
     new 6af7b0d  No need to initialize to default value.

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:
 .travis.yml                                                          | 3 +--
 .../java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java   | 4 +---
 .../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java    | 5 ++---
 3 files changed, 4 insertions(+), 8 deletions(-)


[commons-pool] 02/02: No need to initialize to default value.

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 6af7b0d815ca203990fff0e8064effbce915afde
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 21:46:29 2020 -0500

    No need to initialize to default value.
---
 .../java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java   | 4 +---
 .../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java    | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
index 8429589..5dc1a26 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -1355,11 +1355,9 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T>
         final int maxTotal = getMaxTotal();
         final int maxTotalPerKeySave = getMaxTotalPerKey();
 
-        int objectDefecit = 0;
-
         // Calculate no of objects needed to be created, in order to have
         // the number of pooled objects < maxTotalPerKey();
-        objectDefecit = getMinIdlePerKey() - objectDeque.getIdleObjects().size();
+        int objectDefecit = getMinIdlePerKey() - objectDeque.getIdleObjects().size();
         if (maxTotalPerKeySave > 0) {
             final int growLimit = Math.max(0,
                     maxTotalPerKeySave - objectDeque.getIdleObjects().size());
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
index 7fa8519..f9d6f91 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
@@ -1759,7 +1759,6 @@ public class TestGenericObjectPool extends TestBaseObjectPool {
 
     @Test(timeout = 60000)
     public void testFIFO() throws Exception {
-        String o = null;
         genericObjectPool.setLifo(false);
         genericObjectPool.addObject(); // "0"
         genericObjectPool.addObject(); // "1"
@@ -1767,7 +1766,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool {
         assertEquals("Oldest", "0", genericObjectPool.borrowObject());
         assertEquals("Middle", "1", genericObjectPool.borrowObject());
         assertEquals("Youngest", "2", genericObjectPool.borrowObject());
-        o = genericObjectPool.borrowObject();
+        String o = genericObjectPool.borrowObject();
         assertEquals("new-3", "3", o);
         genericObjectPool.returnObject(o);
         assertEquals("returned-3", o, genericObjectPool.borrowObject());
@@ -1879,7 +1878,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool {
 
     @Test(timeout = 60000)
     public void testLIFO() throws Exception {
-        String o = null;
+        String o;
         genericObjectPool.setLifo(true);
         genericObjectPool.addObject(); // "0"
         genericObjectPool.addObject(); // "1"


[commons-pool] 01/02: Travis: Replace Java 14 with 15. One Java 11 build.

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 e5f8532df8bf4af1567bae2f36d73b1d6c569ab5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 21:45:54 2020 -0500

    Travis: Replace Java 14 with 15. One Java 11
    build.
---
 .travis.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f237a1a..4218f02 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,8 +22,7 @@ cache:
 jdk:
   - openjdk8
   - openjdk11
-  - oraclejdk11
-  - openjdk14
+  - openjdk15
   - openjdk-ea
 
 matrix: