commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1125938 - /incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java
Date Sun, 22 May 2011 12:20:29 GMT
Author: simonetripodi
Date: Sun May 22 12:20:29 2011
New Revision: 1125938

URL: http://svn.apache.org/viewvc?rev=1125938&view=rev
Log:
fixed List raw type

Modified:
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java?rev=1125938&r1=1125937&r2=1125938&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/ListPropertyAccessor.java Sun
May 22 12:20:29 2011
@@ -41,7 +41,7 @@ public class ListPropertyAccessor
     public Object getProperty( Map<String, Object> context, Object target, Object name
)
         throws OgnlException
     {
-        List list = (List) target;
+        List<?> list = (List<?>) target;
 
         if ( name instanceof String )
         {
@@ -105,7 +105,8 @@ public class ListPropertyAccessor
             return;
         }
 
-        List list = (List) target;
+        @SuppressWarnings( "unchecked" ) // check performed by the invoker
+        List<Object> list = (List<Object>) target;
 
         if ( name instanceof Number )
         {
@@ -141,7 +142,7 @@ public class ListPropertyAccessor
                     if ( !( value instanceof Collection ) )
                         throw new OgnlException( "Value must be a collection" );
                     list.clear();
-                    list.addAll( (Collection) value );
+                    list.addAll( (Collection<?>) value );
                     return;
                 }
             }



Mime
View raw message