commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1126361 - /incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
Date Mon, 23 May 2011 07:48:54 GMT
Author: simonetripodi
Date: Mon May 23 07:48:54 2011
New Revision: 1126361

URL: http://svn.apache.org/viewvc?rev=1126361&view=rev
Log:
fixed raw types in findObjectIndexedPropertyDescriptors() method

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

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java?rev=1126361&r1=1126360&r2=1126361&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java Mon May 23
07:48:54 2011
@@ -2102,11 +2102,11 @@ public class OgnlRuntime
         return result;
     }
 
-    static void findObjectIndexedPropertyDescriptors( Class<?> targetClass, Map intoMap
)
+    static void findObjectIndexedPropertyDescriptors( Class<?> targetClass, Map<String,
PropertyDescriptor> intoMap )
         throws OgnlException
     {
         Map<String, List<Method>> allMethods = getMethods( targetClass, false
);
-        Map pairs = new HashMap( 101 );
+        Map<String, List<Method>> pairs = new HashMap<String, List<Method>>(
101 );
 
         for ( Iterator<String> it = allMethods.keySet().iterator(); it.hasNext(); )
         {
@@ -2131,21 +2131,21 @@ public class OgnlRuntime
 
                     if ( isGet && ( parameterCount == 1 ) && ( m.getReturnType()
!= Void.TYPE ) )
                     {
-                        List pair = (List) pairs.get( propertyName );
+                        List<Method> pair = pairs.get( propertyName );
 
                         if ( pair == null )
                         {
-                            pairs.put( propertyName, pair = new ArrayList() );
+                            pairs.put( propertyName, pair = new ArrayList<Method>()
);
                         }
                         pair.add( m );
                     }
                     if ( isSet && ( parameterCount == 2 ) && ( m.getReturnType()
== Void.TYPE ) )
                     {
-                        List pair = (List) pairs.get( propertyName );
+                        List<Method> pair = pairs.get( propertyName );
 
                         if ( pair == null )
                         {
-                            pairs.put( propertyName, pair = new ArrayList() );
+                            pairs.put( propertyName, pair = new ArrayList<Method>()
);
                         }
                         pair.add( m );
                     }
@@ -2153,14 +2153,14 @@ public class OgnlRuntime
             }
         }
 
-        for ( Iterator it = pairs.keySet().iterator(); it.hasNext(); )
+        for ( Iterator<String> it = pairs.keySet().iterator(); it.hasNext(); )
         {
-            String propertyName = (String) it.next();
-            List methods = (List) pairs.get( propertyName );
+            String propertyName = it.next();
+            List<Method> methods = pairs.get( propertyName );
 
             if ( methods.size() == 2 )
             {
-                Method method1 = (Method) methods.get( 0 ), method2 = (Method) methods.get(
1 ), setMethod =
+                Method method1 = methods.get( 0 ), method2 = methods.get( 1 ), setMethod
=
                     ( method1.getParameterTypes().length == 2 ) ? method1 : method2, getMethod
=
                     ( setMethod == method1 ) ? method2 : method1;
                 Class<?> keyType = getMethod.getParameterTypes()[0], propertyType =
getMethod.getReturnType();



Mime
View raw message