[jboss-cvs] JBossAS SVN: r108127 - projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 13 12:52:00 EDT 2010


Author: pferraro
Date: 2010-09-13 12:51:59 -0400 (Mon, 13 Sep 2010)
New Revision: 108127

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java
Log:
Workaround for Sun JDK compiler error.

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java	2010-09-13 16:47:15 UTC (rev 108126)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java	2010-09-13 16:51:59 UTC (rev 108127)
@@ -46,10 +46,9 @@
     * @param data an atomic map
     * @return the entry value
     */
-   @SuppressWarnings("unchecked")
    public <T> T get(AtomicMap<Object, Object> data)
    {
-      return (T) this.cast(data.get(this.key()));
+      return this.<T>cast(data.get(this.key()));
    }
 
    /**
@@ -59,7 +58,6 @@
     * @param value the entry value
     * @return the old entry value, or null if no previous entry existed
     */
-   @SuppressWarnings("unchecked")
    public <T> T put(AtomicMap<Object, Object> data, Object value)
    {
       if (value == null) return null;
@@ -69,13 +67,14 @@
          throw new IllegalArgumentException(String.format("Attempt to put value of type %s into %s entry", value.getClass().getName(), this));
       }
       
-      return (T) this.cast(data.put(this.key(), value));
+      return this.<T>cast(data.put(this.key(), value));
    }
    
    @SuppressWarnings("unchecked")
    private <T> T cast(Object value)
    {
-      return (value != null) ? (T) this.targetClass.cast(value) : null;
+      Class<T> targetClass = (Class<T>) this.targetClass;
+      return (value != null) ? targetClass.cast(value) : null;
    }
    
    private Byte key()



More information about the jboss-cvs-commits mailing list