You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2017/12/04 15:00:26 UTC

[1/6] commons-pool git commit: Make license header identical across all .java source files

Repository: commons-pool
Updated Branches:
  refs/heads/master d3a92a731 -> fc0f9c905


Make license header identical across all .java source files

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

Branch: refs/heads/master
Commit: ea59bd130ed436df2bf90b06b6c165d97ad15277
Parents: d3a92a7
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:53:47 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:53:47 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/commons/pool2/impl/CallStack.java     | 10 +++++-----
 .../org/apache/commons/pool2/impl/CallStackUtils.java     | 10 +++++-----
 .../java/org/apache/commons/pool2/impl/NoOpCallStack.java | 10 +++++-----
 .../org/apache/commons/pool2/impl/ThrowableCallStack.java | 10 +++++-----
 4 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ea59bd13/src/main/java/org/apache/commons/pool2/impl/CallStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/CallStack.java b/src/main/java/org/apache/commons/pool2/impl/CallStack.java
index 6caf6e1..da7d4bb 100644
--- a/src/main/java/org/apache/commons/pool2/impl/CallStack.java
+++ b/src/main/java/org/apache/commons/pool2/impl/CallStack.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.pool2.impl;
 

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ea59bd13/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java b/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java
index 3b0bdda..0e79d55 100644
--- a/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java
+++ b/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.pool2.impl;
 

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ea59bd13/src/main/java/org/apache/commons/pool2/impl/NoOpCallStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/NoOpCallStack.java b/src/main/java/org/apache/commons/pool2/impl/NoOpCallStack.java
index b2d6a60..bfda56c 100644
--- a/src/main/java/org/apache/commons/pool2/impl/NoOpCallStack.java
+++ b/src/main/java/org/apache/commons/pool2/impl/NoOpCallStack.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.pool2.impl;
 

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ea59bd13/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java b/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
index c10ed36..16a4b0a 100644
--- a/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
+++ b/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.pool2.impl;
 


[6/6] commons-pool git commit: Fix typo

Posted by ma...@apache.org.
Fix typo

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

Branch: refs/heads/master
Commit: fc0f9c905c1d087ee7e0d1d80c4af3cba5530323
Parents: 8cc7962
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:59:54 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:59:54 2017 +0000

----------------------------------------------------------------------
 .../org/apache/commons/pool2/impl/SoftReferenceObjectPool.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/fc0f9c90/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
index c5533f9..f7d57de 100644
--- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
@@ -111,7 +111,7 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
      *             if an exception occurs creating a new instance
      * @return a valid, activated object instance
      */
-    @SuppressWarnings("null") // ref can not be null
+    @SuppressWarnings("null") // ref cannot be null
     @Override
     public synchronized T borrowObject() throws Exception {
         assertOpen();


[3/6] commons-pool git commit: Fix indentation

Posted by ma...@apache.org.
Fix indentation

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

Branch: refs/heads/master
Commit: f7fbc3eca923f22df5fbbb647ac45339b95cd981
Parents: 1c7e75e
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:57:49 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:57:49 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/f7fbc3ec/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
----------------------------------------------------------------------
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 4a64b33..2a6e225 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -78,7 +78,7 @@ import org.apache.commons.pool2.SwallowedExceptionListener;
  * @since 2.0
  */
 public class GenericKeyedObjectPool<K,T> extends BaseGenericObjectPool<T>
-implements KeyedObjectPool<K,T>, GenericKeyedObjectPoolMXBean<K> {
+        implements KeyedObjectPool<K,T>, GenericKeyedObjectPoolMXBean<K> {
 
     /**
      * Create a new <code>GenericKeyedObjectPool</code> using defaults from


[4/6] commons-pool git commit: Fix unused import warning

Posted by ma...@apache.org.
Fix unused import warning

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

Branch: refs/heads/master
Commit: a80613b6573f9511683bae109cee69660a58ece5
Parents: f7fbc3e
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:59:10 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:59:10 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a80613b6/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
index c8edf90..9323771 100644
--- a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
+++ b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * An optionally-bounded {@linkplain java.util.concurrent.BlockingDeque blocking
@@ -1381,7 +1380,8 @@ class LinkedBlockingDeque<E> extends AbstractQueue<E>
 
     /**
      * Returns true if there are threads waiting to take instances from this deque.
-     * See disclaimer on accuracy in {@link ReentrantLock#hasWaiters(Condition)}.
+     * See disclaimer on accuracy in
+     * {@link java.util.concurrent.locks.ReentrantLock#hasWaiters(Condition)}.
      *
      * @return true if there is at least one thread waiting on this deque's notEmpty condition.
      */


[5/6] commons-pool git commit: Fix autoboxing warnings

Posted by ma...@apache.org.
Fix autoboxing warnings

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

Branch: refs/heads/master
Commit: 8cc7962b287140928866ea32451b0906bdc01146
Parents: a80613b
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:59:41 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:59:41 2017 +0000

----------------------------------------------------------------------
 .../org/apache/commons/pool2/impl/SecurityManagerCallStack.java    | 2 +-
 .../java/org/apache/commons/pool2/impl/ThrowableCallStack.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/8cc7962b/src/main/java/org/apache/commons/pool2/impl/SecurityManagerCallStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/SecurityManagerCallStack.java b/src/main/java/org/apache/commons/pool2/impl/SecurityManagerCallStack.java
index 83110d4..7ffff10 100644
--- a/src/main/java/org/apache/commons/pool2/impl/SecurityManagerCallStack.java
+++ b/src/main/java/org/apache/commons/pool2/impl/SecurityManagerCallStack.java
@@ -71,7 +71,7 @@ public class SecurityManagerCallStack implements CallStack {
             message = messageFormat;
         } else {
             synchronized (dateFormat) {
-                message = dateFormat.format(snapshotRef.timestamp);
+                message = dateFormat.format(Long.valueOf(snapshotRef.timestamp));
             }
         }
         writer.println(message);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/8cc7962b/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java b/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
index 16a4b0a..3f04e91 100644
--- a/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
+++ b/src/main/java/org/apache/commons/pool2/impl/ThrowableCallStack.java
@@ -58,7 +58,7 @@ public class ThrowableCallStack implements CallStack {
             message = messageFormat;
         } else {
             synchronized (dateFormat) {
-                message = dateFormat.format(snapshotRef.timestamp);
+                message = dateFormat.format(Long.valueOf(snapshotRef.timestamp));
             }
         }
         writer.println(message);


[2/6] commons-pool git commit: Fix a Java 9 IDE nag. Ensure possible exceptions are handled.

Posted by ma...@apache.org.
Fix a Java 9 IDE nag. Ensure possible exceptions are handled.

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

Branch: refs/heads/master
Commit: 1c7e75e7e01c7fc6934b4b2b07ce680d77081a7d
Parents: ea59bd1
Author: mark <ma...@study04.dev.local>
Authored: Mon Dec 4 14:56:10 2017 +0000
Committer: mark <ma...@study04.dev.local>
Committed: Mon Dec 4 14:56:10 2017 +0000

----------------------------------------------------------------------
 .../apache/commons/pool2/impl/BaseGenericObjectPool.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-pool/blob/1c7e75e7/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 5686588..b523e83 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
@@ -21,6 +21,7 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.lang.management.ManagementFactory;
 import java.lang.ref.WeakReference;
+import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 import java.util.Deque;
 import java.util.Iterator;
@@ -608,7 +609,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject {
             } catch (final ClassNotFoundException e) {
                 clazz = Class.forName(evictionPolicyClassName);
             }
-            final Object policy = clazz.newInstance();
+            final Object policy = clazz.getConstructor().newInstance();
             if (policy instanceof EvictionPolicy<?>) {
                 @SuppressWarnings("unchecked") // safe, because we just checked the class
                 final
@@ -630,6 +631,14 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject {
             throw new IllegalArgumentException(
                     "Unable to create EvictionPolicy instance of type " +
                     evictionPolicyClassName, e);
+        } catch (final InvocationTargetException e) {
+            throw new IllegalArgumentException(
+                    "Unable to create EvictionPolicy instance of type " +
+                    evictionPolicyClassName, e);
+        } catch (final NoSuchMethodException e) {
+            throw new IllegalArgumentException(
+                    "Unable to create EvictionPolicy instance of type " +
+                    evictionPolicyClassName, e);
         }
     }