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 2021/05/27 12:19:56 UTC

[commons-pool] branch master updated: Replace C-style array declaration with Java style (#80)

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


The following commit(s) were added to refs/heads/master by this push:
     new abf5fd6  Replace C-style array declaration  with Java style (#80)
abf5fd6 is described below

commit abf5fd681db134607d61c41e7b51abc6c83e6940
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Thu May 27 14:19:51 2021 +0200

    Replace C-style array declaration  with Java style (#80)
---
 .../java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java     | 2 +-
 .../org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java     | 4 ++--
 .../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java     | 2 +-
 3 files changed, 4 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 810111f..7c2f258 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
@@ -239,7 +239,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject {
      */
     private class StatsStore {
 
-        private final AtomicLong values[];
+        private final AtomicLong[] values;
         private final int size;
         private int index;
 
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 3759758..37503ce 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
@@ -749,7 +749,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool {
                                     oneLength, twoLength));
                         }
                     }
-                    final int visits[] = new int[twoLength];
+                    final int[] visits = new int[twoLength];
                     for (int k = 0; k < twoLength; k++) {
                         tracker = intPool.borrowObject(KEY_TWO);
                         visitCount = tracker.getValidateCount();
@@ -2027,7 +2027,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool {
         gkoPool.setMaxWaitMillis(maxWait);
         gkoPool.setMaxTotalPerKey(threadsPerKey);
         // Create enough threads so half the threads will have to wait
-        final WaitingTestThread wtt[] = new WaitingTestThread[keyCount * threadsPerKey * 2];
+        final WaitingTestThread[] wtt = new WaitingTestThread[keyCount * threadsPerKey * 2];
         for(int i=0; i < wtt.length; i++){
             wtt[i] = new WaitingTestThread(gkoPool,Integer.toString(i % keyCount),holdTime);
         }
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 3fdf764..0ab031c 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
@@ -2255,7 +2255,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool {
         genericObjectPool.setMaxWaitMillis(maxWait);
         genericObjectPool.setMaxTotal(threads);
         // Create enough threads so half the threads will have to wait
-        final WaitingTestThread wtt[] = new WaitingTestThread[threads * 2];
+        final WaitingTestThread[] wtt = new WaitingTestThread[threads * 2];
         for (int i = 0; i < wtt.length; i++) {
             wtt[i] = new WaitingTestThread(genericObjectPool,holdTime);
         }