commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject [23/50] [abbrv] commons-pool git commit: Fix various IDE warnings
Date Sun, 12 Mar 2017 19:47:53 GMT
Fix various IDE warnings

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735057 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/2566fd6c
Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/2566fd6c
Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/2566fd6c

Branch: refs/heads/master
Commit: 2566fd6c479f86f46a0f0a65c4587572100b5cfc
Parents: cd3f495
Author: Mark Thomas <markt@apache.org>
Authored: Tue Mar 15 11:16:13 2016 +0000
Committer: Mark Thomas <markt@apache.org>
Committed: Tue Mar 15 11:16:13 2016 +0000

----------------------------------------------------------------------
 src/main/java/org/apache/commons/pool2/BaseObject.java      | 9 +++++++--
 src/main/java/org/apache/commons/pool2/BaseObjectPool.java  | 1 +
 .../apache/commons/pool2/impl/BaseGenericObjectPool.java    | 7 ++++---
 .../org/apache/commons/pool2/impl/BaseObjectPoolConfig.java | 1 +
 .../commons/pool2/impl/GenericKeyedObjectPoolConfig.java    | 1 +
 .../apache/commons/pool2/impl/TestDefaultPooledObject.java  | 4 +++-
 .../org/apache/commons/pool2/impl/TestPoolImplUtils.java    | 2 ++
 7 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/BaseObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/BaseObject.java b/src/main/java/org/apache/commons/pool2/BaseObject.java
index 6a69abd..cc7f376 100644
--- a/src/main/java/org/apache/commons/pool2/BaseObject.java
+++ b/src/main/java/org/apache/commons/pool2/BaseObject.java
@@ -18,7 +18,7 @@ package org.apache.commons.pool2;
 
 /**
  * A base class for common functionality.
- * 
+ *
  * @since 2.4.3
  */
 public abstract class BaseObject {
@@ -33,8 +33,13 @@ public abstract class BaseObject {
         return builder.toString();
     }
 
+    /**
+     * Used by sub-classes to include the fields defined by the sub-class in the
+     * {@link #toString()} output.
+     *
+     * @param builder Field names and values are appended to this object
+     */
     protected void toStringAppendFields(final StringBuilder builder) {
         // do nothing by default, needed for b/w compatibility.
     }
-
 }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/BaseObjectPool.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/BaseObjectPool.java b/src/main/java/org/apache/commons/pool2/BaseObjectPool.java
index 2349622..7ef7187 100644
--- a/src/main/java/org/apache/commons/pool2/BaseObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/BaseObjectPool.java
@@ -119,6 +119,7 @@ public abstract class BaseObjectPool<T> extends BaseObject implements
ObjectPool
 
     private volatile boolean closed = false;
 
+    @Override
     protected void toStringAppendFields(final StringBuilder builder) {
         builder.append("closed=");
         builder.append(closed);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
----------------------------------------------------------------------
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 6eafcd1..6e197c9 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
@@ -1176,7 +1176,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject
{
         }
 
     }
-    
+
     /**
      * Wrapper for objects under management by the pool.
      *
@@ -1189,7 +1189,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject
{
     static class IdentityWrapper<T> {
         /** Wrapped object */
         private final T instance;
-        
+
         /**
          * Create a wrapper for an instance.
          *
@@ -1209,7 +1209,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject
{
         public boolean equals(final Object other) {
             return ((IdentityWrapper) other).instance == instance;
         }
-        
+
         /**
          * @return the wrapped object
          */
@@ -1227,6 +1227,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject
{
         }
     }
 
+    @Override
     protected void toStringAppendFields(final StringBuilder builder) {
         builder.append("maxTotal=");
         builder.append(maxTotal);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java b/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
index 60b2384..2f1a595 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
@@ -640,6 +640,7 @@ public abstract class BaseObjectPoolConfig extends BaseObject implements
Cloneab
         this.jmxNamePrefix = jmxNamePrefix;
     }
 
+    @Override
     protected void toStringAppendFields(final StringBuilder builder) {
         builder.append("lifo=");
         builder.append(lifo);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
index bf05d53..2e201e5 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
@@ -182,6 +182,7 @@ public class GenericKeyedObjectPoolConfig extends BaseObjectPoolConfig
{
         }
     }
 
+    @Override
     protected void toStringAppendFields(final StringBuilder builder) {
         super.toStringAppendFields(builder);
         builder.append(", minIdlePerKey=");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
index 07f1629..6484afd 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
@@ -27,7 +27,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class TestDefaultPooledObject {
-    
+
     /**
      * JIRA: POOL-279
      * @throws Exception
@@ -39,6 +39,7 @@ public class TestDefaultPooledObject {
         final ExecutorService executor = Executors.newFixedThreadPool(
                                       Runtime.getRuntime().availableProcessors()*3);
         final Runnable allocateAndDeallocateTask = new Runnable() {
+            @Override
             public void run() {
                 for (int i=0;i<10000;i++) {
                     if (dpo.getIdleTimeMillis() < 0) {
@@ -57,6 +58,7 @@ public class TestDefaultPooledObject {
             }
         };
         final Runnable getIdleTimeTask = new Runnable() {
+            @Override
             public void run() {
                 for (int i=0;i<10000;i++) {
                     if (dpo.getIdleTimeMillis() < 0) {

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java b/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java
index 6e0b20c..001b186 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java
@@ -47,6 +47,7 @@ public class TestPoolImplUtils {
         }
     }
 
+    @SuppressWarnings("unused")
     private abstract static class FactoryAB<A,B>
             extends BasePooledObjectFactory<B> {
     }
@@ -57,6 +58,7 @@ public class TestPoolImplUtils {
     private abstract static class FactoryC<C> extends FactoryBA<C, String> {
     }
 
+    @SuppressWarnings("unused")
     private abstract static class FactoryDE<D,E> extends FactoryC<D>{
     }
 


Mime
View raw message