commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1096368 - in /commons/proper/pool/trunk/src/test/org/apache/commons/pool2: MethodCall.java MethodCallPoolableObjectFactory.java
Date Sun, 24 Apr 2011 20:07:10 GMT
Author: simonetripodi
Date: Sun Apr 24 20:07:09 2011
New Revision: 1096368

URL: http://svn.apache.org/viewvc?rev=1096368&view=rev
Log:
added generics to MethodCall and related PoolableObjectFactory classes

Modified:
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCall.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCall.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCall.java?rev=1096368&r1=1096367&r2=1096368&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCall.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCall.java Sun Apr 24
20:07:09 2011
@@ -29,7 +29,7 @@ import java.util.Arrays;
  */
 public class MethodCall {
     private final String name;
-    private final List params;
+    private final List<Object> params;
     private Object returned;
 
     public MethodCall(final String name) {
@@ -44,7 +44,7 @@ public class MethodCall {
         this(name, Arrays.asList(new Object[] {param1, param2}));
     }
 
-    public MethodCall(final String name, final List params) {
+    public MethodCall(final String name, final List<Object> params) {
         if (name == null) {
             throw new IllegalArgumentException("name must not be null.");
         }
@@ -52,7 +52,7 @@ public class MethodCall {
         if (params != null) {
             this.params = params;
         } else {
-            this.params = Collections.EMPTY_LIST;
+            this.params = Collections.emptyList();
         }
     }
 
@@ -60,7 +60,7 @@ public class MethodCall {
         return name;
     }
 
-    public List getParams() {
+    public List<Object> getParams() {
         return params;
     }
 
@@ -77,6 +77,7 @@ public class MethodCall {
         return this;
     }
 
+    @Override
     public boolean equals(final Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
@@ -90,6 +91,7 @@ public class MethodCall {
         return true;
     }
 
+    @Override
     public int hashCode() {
         int result;
         result = (name != null ? name.hashCode() : 0);
@@ -98,6 +100,7 @@ public class MethodCall {
         return result;
     }
 
+    @Override
     public String toString() {
         final StringBuffer sb = new StringBuffer();
         sb.append("MethodCall");

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java?rev=1096368&r1=1096367&r2=1096368&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
Sun Apr 24 20:07:09 2011
@@ -29,8 +29,8 @@ import org.apache.commons.pool2.Poolable
  * @version $Revision$ $Date$
  * @see MethodCall
  */
-public class MethodCallPoolableObjectFactory implements PoolableObjectFactory {
-    private final List methodCalls = new ArrayList();
+public class MethodCallPoolableObjectFactory implements PoolableObjectFactory<Object>
{
+    private final List<MethodCall> methodCalls = new ArrayList<MethodCall>();
     private int count = 0;
     private boolean valid = true;
     private boolean makeObjectFail;
@@ -50,7 +50,7 @@ public class MethodCallPoolableObjectFac
         setDestroyObjectFail(false);
     }
 
-    public List getMethodCalls() {
+    public List<MethodCall> getMethodCalls() {
         return methodCalls;
     }
 



Mime
View raw message