commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1537346 - /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Date Wed, 30 Oct 2013 23:50:03 GMT
Author: sebb
Date: Wed Oct 30 23:50:02 2013
New Revision: 1537346

URL: http://svn.apache.org/r1537346
Log:
Localise and document @SuppressWarnings

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java?rev=1537346&r1=1537345&r2=1537346&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Wed Oct 30 23:50:02 2013
@@ -536,14 +536,15 @@ public abstract class BaseGenericObjectP
      *
      * @see #getEvictionPolicyClassName()
      */
-    @SuppressWarnings("unchecked")
     public final void setEvictionPolicyClassName(
             String evictionPolicyClassName) {
         try {
             Class<?> clazz = Class.forName(evictionPolicyClassName);
             Object policy = clazz.newInstance();
             if (policy instanceof EvictionPolicy<?>) {
-                this.evictionPolicy = (EvictionPolicy<T>) policy;
+                @SuppressWarnings("unchecked") // safe, because we just checked the class
+                EvictionPolicy<T> evicPolicy = (EvictionPolicy<T>) policy;
+				this.evictionPolicy = evicPolicy;
             }
         } catch (ClassNotFoundException e) {
             throw new IllegalArgumentException(



Mime
View raw message